Brian49 wrote:
> Since my previous reply I had got as far as changing the UUID of the
> partition on the USB, and editing /etc/fstab on the USB, both of which were
> straightforward enough. But updating GRUB on the USB has defeated me so
> far. I tried editing /boot/grub/grub.cfg on the USB to reflect the new
> UUID, but then it wouldn't boot at all. The USB will carry only the cloned
> Linux install, and ideally I would like it to boot on its own. Many thanks
> once again for your kind help.
Once you have edited both /etc/fstab and /boot/grub/grub.cfg on the USB drive with the new UUID of the root partition on the USB drive, then you still need to install grub to the MBR of the USB drive. The KB article linked to below has a procedure for what you need to do. The article includes a link to a grub2 boot disk that you can boot from to follow the steps in the procedure.
http://www.terabyteunlimited.com/kb/article.php?id=408
Since that article is focused on systems booting Linux from BIBM, here's some notes and differences specific to the situation that you are dealing with:
1. In step 4, when you are searching for partition(s) containing a grub.cfg file, you will likely get more than one result, since you will have both the hard drive install, along with the root parttiion on the USB drive - both of which will contain a grub.cfg file. You will need to know which of those partitons is the root parttiion on the USB drive, so that you can boot from it in step 5. To do that you can use the grub 'cat' command to display the file contents of each grub.cfg. You need to identify which copy of grub.cfg contains the new UUID that you set on the USB root parttiion.
For example, if the search command in step 4 gave this result:
hd0,msdos2 hd1,msdos1, cd
That means it found a grub.cfg on both hd0,msdos2 (drive 0, partition 2), and on hd1,msdos1 (drive 1, partition 1).
To determine which of those 2 partitions is your USB root partition, run the 'cat' command like this:
cat (hd0,msdos2)/boot/grub/grub.cfg
cat (hd1,msdos1)/boot/grub/grub.cfg
...and see which of those files contains the new UUID. Then use that partition in step 5 to boot into Linux.
2. For step 5, assuming it was the 2nd partition listed above, the boot command would be:
configfile (hd1,msdos1)/boot/grub/grub.cfg
...which should boot the system into Linux from the USB drive.
3. For step 6, you need to install grub to the MBR of the USB drive (NOT to the root partition). First, make sure that you are actually booted from the USB drive, and that the root partition you are running from is actually the one on the USB drive. An easy way to do that would be to have a file there (create one there after restoring) that you can use to identify the root partition on the USB drive.
Once having verified that you are booted and running from the USB drive, run the 'df' command and determine the Linux designation for the USB drive. For example if 'df' lists your root partition (/) as /dev/sdb1, then you will want to use /dev/sdb in the grub-install command in step 6, like this:
grub-install /dev/sdb (/dev/sdb is just an example - your USB drive may be different)
Note that it's using /dev/sdb above (not /dev/sdb1) because you need to install to the MBR on the USB drive, not to the root partition.
Once again though, ensure you have a known good backup of your hard drive installation in case something goes wrong. The most important thing is that before running the 'grub-install' command above, make sure that the drive you're installing it to is actually the USB drive, as described above.