remotely moving /usr

Moving /home or /usr (or /var?)

This can be done in multi-user mode. Be VERY careful NOT to use sudo (like I did). After moving /usr to /ousr, you will be doomed (I realized it the instant I pushed Enter). Instead, su. Because of this mistake I had to get off my chair to fix it locally.

mkdir /mnt/nusr
mount /dev/sdb1 /mnt/nusr
cp -a /usr/* /mnt/nusr
umount /mnt/nusr
mv /usr /ousr
mkdir /usr
mount /dev/sdb1 /usr

Edit /etc/fstab, mount -a, reboot to make sure it survives it OK.

Tested remotely from putty.

Leave a Reply