[<<][pool][>>][..]
Sun Mar 27 10:48:39 EDT 2016

installing grub to an image

This works up to the point that grub tries to load the UUID of the
main harddisk.  How to find the UUID of the main disk?  For a nbd, it
doesn't show up in /dev/disk/by-uuid.

NBD=/dev/nbd0

need_grub() {
    need_rfs
    mount_image
    (cd mnt ;
     ./chroot.sh apt-get --assume-yes install grub linux-image-amd64;
     echo "UUID=$UUID / ext3 errors=remount-ro 0 1" >>etc/fstab;
     grub-install $NBD;
     update-grub)
    umount_image
    
    # fix grub install
    grub-install $NBD --root-directory=mnt
}



# blkid -o export /dev/nbd0p1
DEVNAME=/dev/nbd0p1
UUID=65949277-de7b-4af8-b1d6-85d1038d82e1
TYPE=ext3
PARTUUID=be910b11-01




[Reply][About]
[<<][pool][>>][..]