1

How do I move the existing /boot partion of a 14.04 root encrypted installation to a usb key?

2
  • Do you want /boot (and grub_) or just grub boot loader in MBR of external drive? You can do either one. It would be just like moving /home. You need to create a new partition on flash drive and copy files from old /boot to new one. Then reinstall grub to use new UUID and update fstab to use new partition for /boot. This is moving /home but very similar other than reinstall of grub. help.ubuntu.com/community/Partitioning/Home/Moving
    – oldfred
    Oct 20, 2014 at 21:00
  • 2
    Please be aware that encrypting /boot and physically removing it from your computer, doesn't prevent people from accessing the rest of the data on the internal drive(s). Oct 21, 2014 at 0:57

1 Answer 1

1

Test this:

In a normal session:

Insert the usb stick.

Open a terminal. CtrlAltT.

Identify the usb-stick, suppose is /dev/sdc1, umount it:

sudo -i
fdisk -l
umount /dev/sdc1

Load gparted

gparted

Delete a patition, create an ext4 partition, apply the changes and close gparted

You must mount the new /boot partition, suppose is new ext4 /dev/sdc1 on a temporary directory, suppose is /media/newboot to copy files to it the original /boot.

Run it:

You create the temporary directory

 mkdir /media/newboot

Umount and mount partition

umount /dev/sdc1 
mount /dev/sdc1 /media/newboot

To copy files:

cd /boot
cp -ax . /media/newboot

This last line is the only one used to clone, attention "." the end.

Now mount the new /boot previous rename the /boot partition.

cd /
mv /boot /boot.old
mkdir /boot
umount /dev/sdc1
mount /dev/sdc1 /boot

Now you have to find the UUID of the partition and edit the /etc/fstab file to mount the partition at startup.

blkid /dev/sdc1
nano /etc/fstab

And you add these lines at the end with that reported blkid UUID.

# /dev/sdc1 was /boot
UUID=c676ae51-cb6f-4c0e-b4a9-76850aafa1d6  /boot ext4 errors=remount-ro  0  1

Ctrl + O, save file. Ctrl + X, close nano.

update-grub

Restarting have everything working exactly the same, but with other partitions.

Once everything is working well, delete the /boot.old and /media/newboot

sudo -i
rm /boot.old
rm /media/newboot

Note:You should be aware that without the usb-stick the system will be unusable.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .