Instructions for creating a master partition in Ubuntu

Ubuntu does not use a separate master partition by default, although many Linux users prefer this. Use a separate master partition to allow you to reinstall Ubuntu without losing personal files and settings.

TipsMake.com - Ubuntu does not use a separate master partition by default, although many Linux users prefer this. Use a separate master partition to allow you to reinstall Ubuntu without losing personal files and settings.

While a master partition is usually selected during installation, you can also move the master partition after installing Ubuntu.

During Ubuntu installation

Creating a home folder (Home Folder) while installing Ubuntu is easy. Choose the option to install 'Something Else' to customize the partition and create multiple partitions. Set the mount point for each partition to '/' to contain the root file system and mount point of another partition as / home. When installing Ubuntu in the future, users can set the old master partition to / home again, but make sure not to tick the Format box or the entire file will be deleted.

Instructions for creating a master partition in Ubuntu Picture 1Instructions for creating a master partition in Ubuntu Picture 1

After installing Ubuntu

If you did not create a master partition during Ubuntu installation, you do not have to reinstall Ubuntu from the beginning. To move the master partition after installation, we will have to create a new partition, copy the file from the current home directory to this partition and tell Ubuntu to extract the new partition at / home.

Step 1: Create a new partition

If there is an empty storage space, this step is easy. If not, we will have to resize the system partition and create a new partition at the empty storage space. If there is an empty storage space or you do not need to resize the system partition, you only need to install GParted and create a partition without rebooting from the CD. Here we create a partition named ext4.

Instructions for creating a master partition in Ubuntu Picture 2Instructions for creating a master partition in Ubuntu Picture 2

Step 2: Copy the file in the Home Folder to the new partition

Ubuntu extracts the file to a new partition very easily, just click below the Devices section in the file manager. After that, click on the Go menu and select Location to view the mount point.

Instructions for creating a master partition in Ubuntu Picture 3Instructions for creating a master partition in Ubuntu Picture 3

Launch the command window and execute the following command to create a copy of the current home directory on the new partition, with / mount / location as the location of the extracted partition:

sudo cp –Rp / home / * / mount / location

We will see an error about a .gvfs folder but it's okay, ignore it.

Instructions for creating a master partition in Ubuntu Picture 4Instructions for creating a master partition in Ubuntu Picture 4

Users should check the new home directory to confirm that it contains your files. However, we have not deleted the old home directory yet.

Instructions for creating a master partition in Ubuntu Picture 5Instructions for creating a master partition in Ubuntu Picture 5

Step 3: Locate the UUID for the new partition

The long string of characters is actually the new UUID of the partition and we will need it to add the partition to the fstab file to tell Linux the location of the partitions when it starts. Users can also locate the UUID by entering the following command in the command window:

sudo blkid

Instructions for creating a master partition in Ubuntu Picture 6Instructions for creating a master partition in Ubuntu Picture 6

Step 4: Edit the fstab file

Before fixing the fstab file, we should create a backup to restore it if something goes wrong:

sudo cp / etc / fstab /fstab.backup

Next, enter the following command to open the fstab file in gedit. You can also use another text editor if you want.

gksu gedit / etc / fstab

Add the following text to the fstab file on a new line, replacing '_____' with the new master UUID from the sudo blkid statement on:

UUID = _____ / home ext4 nodev, nosuid 0 2

Instructions for creating a master partition in Ubuntu Picture 7Instructions for creating a master partition in Ubuntu Picture 7

Save the file after adding the line.

Step 5: Move the home directory location and reboot

From the command prompt, enter the following command to move the current home directory to a reserved location and create another new, empty home directory for the new partition to populate:

cd / && sudo mv / home / home_old && sudo mkdir / home

Instructions for creating a master partition in Ubuntu Picture 8Instructions for creating a master partition in Ubuntu Picture 8

Restart the computer after running this command. Can restart with the command:

sudo shutdown -r now

After restarting the computer, you can log in normally. Ubuntu now uses separate master partitions. After making sure everything is fine and you still have all the files in the / home directory, you can remove the / home_old folder to free up memory:

sudo rm -rf / home_old

5 ★ | 1 Vote