=== zoktar_ is now known as zoktar
=== lan3y is now known as Laney
=== tsimpson_ is now known as tsimpson
=== jibel_ is now known as jibel
PeanutHi 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:05
cjwatsonPeanut: you can do it with parted ('anna-install parted-udeb' if it isn't already there)14:08
Peanutcjwatson: ah, neat - I'll try that.14:09
PeanutAh, 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:15
cjwatsonparted is a command-line UI to libparted, which partman uses14:16
cjwatsonI suggest setting its units to sectors so that it doesn't try to get too clever14:17
cjwatsonkpartx (kpartx-udeb) might help too14:18
cjwatsonActually, 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 second14:19
cjwatsonsfdisk -d working-disk-device >sfdisk-out;  READ THE OUTPUT FILE VERY CAREFULLY;  sfdisk broken-disk-device <sfdisk-out14:20
Peanutcjwatson: 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:21
PeanutAnd 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:22
cjwatsonMight need to modify partition references in that file14:24
xnoxalso backup the broken disk, in it's current state.14:32
xnoxjust in case.14:32
xnox(partition table at least)14:32
PeanutMeh.. 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
PeanutOh.. and I did a 'grub-install' as /etc/default/grub knows about both mirrors.14:41
cjwatson15:19 <cjwatson> 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 second14:42
cjwatson15:20 <cjwatson> sfdisk -d working-disk-device >sfdisk-out;  READ THE OUTPUT FILE VERY CAREFULLY;  sfdisk broken-disk-device <sfdisk-out14:42
cjwatson15:21 <cjwatson> Might need to modify partition references in that file14:42
cjwatsonSorry, bad timing on disconnect14:42
PeanutAh ok - I did read those things you said :-)14:43
PeanutWhat's the correct syntax to make grub-installer put GRUB on the MBR of /dev/sda ?14:55
cjwatsongrub-installer or grub-install?  (they're different)14:56
PeanutThe one from the boot environment - grub-installer14:56
cjwatsonYou don't want to use that ...14:57
cjwatsonNot unless you're doing an install from scratch and using it as part of the menu-driven interface14:57
PeanutAh ok, I'm not. I've used dd to verify that there's no grub on the bootsector of /dev/sda14:58
cjwatsonBoot into rescue mode instead and use the "Reinstall GRUB boot loader" option14:58
cjwatson"Rescue a broken system" from the CD boot menu14:58
Peanutcjwatson: 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).14:59
cjwatsonrescue/enable=true as a boot param, then15:02
PeanutAh, that's how you get to that.. thanks.15:03
* Peanut is getting very tempted to just copy the first 466 bytes from /dev/sdb onto /dev/sda though ;-)15:04
PeanutBecause 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:05
cjwatsonErr, GRUB doesn't reside in just the first 466 bytes15:07
cjwatsonCopying that is likely a very bad idea since sometimes there's a signature15:07
cjwatson(as in a disk ID, not a crypto sig)15:07
Peanutcjwatson: 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:10
cjwatsonA 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
cjwatsonSince in the MBR layout that does not reside within a partition.15:12
PeanutThis is a lucid64 system (grub 1.98) that I'm trying to fix.15:14
cjwatsonGRUB 1.98 is GRUB 2.15:14
cjwatsonGRUB Legacy got up to 0.97.15:14
cjwatsonMore accurately, I should say that GRUB 1.98 is from the GRUB 2 series.15:15
cjwatsonFor this purpose the URL above is accurate for 1.98.15:15
=== Guest14861 is now known as maxb
Peanutcjwatson: thanks for all the help, I got all my nodes back up and running again.18:09
=== ppetraki_ is now known as ppetraki

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!