=== zoktar_ is now known as zoktar === lan3y is now known as Laney === tsimpson_ is now known as tsimpson === jibel_ is now known as jibel [14:05] Hi folks - is there a way that I could use the busybox shell in the Ubuntu installer environment to put an MBR on a disk? I've got a failed disk in a mirror pair, and it turns out that the second half of the mirror isn't bootable although it (presumably) holds a good copy of all the data. [14:08] Peanut: you can do it with parted ('anna-install parted-udeb' if it isn't already there) [14:09] cjwatson: ah, neat - I'll try that. [14:15] Ah, parted is a different udeb than partman (tried it with partman, but that didn't quite want to do what I wanted it to do). [14:16] parted is a command-line UI to libparted, which partman uses [14:17] I suggest setting its units to sectors so that it doesn't try to get too clever [14:18] kpartx (kpartx-udeb) might help too [14:19] Actually, given your problem description, it's possible you'd be best off using sfdisk (fdisk-udeb) to dump the partition table from the first disk and restore it onto the second [14:20] sfdisk -d working-disk-device >sfdisk-out; READ THE OUTPUT FILE VERY CAREFULLY; sfdisk broken-disk-device cjwatson: thanks, thanks, I was just finding out that parted doesn't have an easy way to copy partitions from one drive to the other. [14:22] And I've used cfdisk in the past when I had a prompt, but didn't know I could anna-install it in the network boot environment. [14:24] Might need to modify partition references in that file [14:32] also backup the broken disk, in it's current state. [14:32] just in case. [14:32] (partition table at least) [14:41] Meh.. I copied over the partition table, then synched the mirrors.. but it just goes in a reboot loop when trying to boot from disk. [14:41] Oh.. and I did a 'grub-install' as /etc/default/grub knows about both mirrors. [14:42] 15:19 Actually, given your problem description, it's possible you'd be best off using sfdisk (fdisk-udeb) to dump the partition table from the first disk and restore it onto the second [14:42] 15:20 sfdisk -d working-disk-device >sfdisk-out; READ THE OUTPUT FILE VERY CAREFULLY; sfdisk broken-disk-device 15:21 Might need to modify partition references in that file [14:42] Sorry, bad timing on disconnect [14:43] Ah ok - I did read those things you said :-) [14:55] What's the correct syntax to make grub-installer put GRUB on the MBR of /dev/sda ? [14:56] grub-installer or grub-install? (they're different) [14:56] The one from the boot environment - grub-installer [14:57] You don't want to use that ... [14:57] Not unless you're doing an install from scratch and using it as part of the menu-driven interface [14:58] Ah ok, I'm not. I've used dd to verify that there's no grub on the bootsector of /dev/sda [14:58] Boot into rescue mode instead and use the "Reinstall GRUB boot loader" option [14:58] "Rescue a broken system" from the CD boot menu [14:59] cjwatson: ah ok.. these machines have no CDrom, but I have a netboot d-i setup that I'm booting them into, without giving them a preseed file (that'd be a full re-install). [15:02] rescue/enable=true as a boot param, then [15:03] Ah, that's how you get to that.. thanks. [15:04] * Peanut is getting very tempted to just copy the first 466 bytes from /dev/sdb onto /dev/sda though ;-) [15:05] Because any attempt at running in-target grub-install fails as well, due to the chroot environment. So having that in all my late_run.sh turns out to have been quite useless. [15:07] Err, GRUB doesn't reside in just the first 466 bytes [15:07] Copying that is likely a very bad idea since sometimes there's a signature [15:07] (as in a disk ID, not a crypto sig) [15:10] cjwatson: ah, ok. Both disks should now have identical contents within their partitions, and identical partition tables, so only the stage 1 of grub is missing. I'll try the rescue/enable=true. [15:12] A bit more than that actually (stage 1 is a GRUB Legacy concept, although it's roughly equivalent to boot.img in GRUB 2; https://www.gnu.org/software/grub/manual/grub.html#Images). I expect you will be missing the core image too. [15:12] Since in the MBR layout that does not reside within a partition. [15:14] This is a lucid64 system (grub 1.98) that I'm trying to fix. [15:14] GRUB 1.98 is GRUB 2. [15:14] GRUB Legacy got up to 0.97. [15:15] More accurately, I should say that GRUB 1.98 is from the GRUB 2 series. [15:15] For this purpose the URL above is accurate for 1.98. === Guest14861 is now known as maxb [18:09] cjwatson: thanks for all the help, I got all my nodes back up and running again. [18:52] Great === ppetraki_ is now known as ppetraki