Move the whole installed files to another partition
Solution 1:
A1: no, it's not possible. The paths are fixed.
A2: if you want to move files to another partition, you'll need to use a Live CD. Please consider resizing partitions first which is much easier and less error-prone. This is only possible if you've enough space on one disk. Consider moving your /home
folder as described here too, 8GB should be enough for /
in most cases. If you want to use a second disk as root partition or wish to create a new partition on the current disk, please continue.
- Make a backup (preferably with disk-cloning software like Clonezilla).
- Boot into the Live CD, do not mount anything
- Create a new partition using the Disk Utility or GParted. This partition must support Linux file permissions. Such a filesystem is ext4. Label it "UbuntuRoot" so you can find the partition easier, otherwise you'll have to remember the partition name (e.g.
/dev/sdb1
) -
Open a terminal and run
sudo blkid
to get the UUID for your newly created partition. Example output, you'll need the last line:/dev/sda1: LABEL="HDD" UUID="AD078BC9C024FCDD" TYPE="ntfs" /dev/sda2: LABEL="DATA" UUID="FDE43758913E70EE" TYPE="ntfs" /dev/sda3: UUID="a88638ae-3cd3-45c0-ad06-2d56d89b19a0" TYPE="swap" /dev/sda4: UUID="e3f848cb-5a05-4d2d-92e0-3eaf7b27338c" TYPE="ext4" /dev/sdb1: LABEL="UbuntuRoot" UUID="1cdfadcf-0969-48ba-96a5-42557c23f8e9" TYPE="ext4"
-
Mount your old root partition (
/dev/sdb1
is your newly created partition,/dev/sda4
was your old partition):sudo mkdir /media/old sudo mount /dev/sda4 /media/old sudo mount /dev/sdb1 /mnt
-
Copy over the files (this may take a while):
sudo cp -prvT /media/old /mnt
-
Update
/mnt/etc/fstab
with the new UUID. Pick an editor at your choice:sudo nano /mnt/etc/fstab gksu gedit /mnt/etc/fstab
Find the line that looks like and replace the UUID of
/dev/sda4
with the/dev/sdb1
's UUID:# / was on /dev/sda4 during installation UUID=e3f848cb-5a05-4d2d-92e0-3eaf7b27338c / ext4 errors=remount-ro 0 1
-
Save
/mnt/etc/fstab
and exit the editor. Next, GRUB needs to be updated to boot from the new disk and partition.sudo grub-install --root-directory=/mnt /dev/sdb
-
Unmount the partitions to finish it:
sudo umount /mnt /media/old
- Reboot to check the result.