2

I am an absolute Linux beginner installing Ubuntu for the first time. Following is the H/W config:

1) 128 GB SSD with Win 10 pre installed (55 GB free)

2) 1 TB HDD (875 GB free)

3) Core i7-7th gen @ 2.8 GHz with 16 GB RAM

Usage:

Ubuntu: For dev purposes. I'll be doing basic machine learning and all other coding stuff here

Windows: Just in case I need it for anything else other than coding. Occasional gaming etc.

However, I want to keep only the OS (Win 10 + Linux) and any other more important software in SSD rest will be in HDD.

Need step by step instructions as to what partitions should be made in SSD and HDD while installing Ubuntu with respective size allotments for optimum performance.

Thanks --Jay

D_jay
  • 61

1 Answers1

0

I am running exactly that way. Since the majority of data "bulk" is going to be located in side your users' home folders I migrated my home folder to the HDD.

Assuming you are not using any partition on the HDD for linux currently you can dismount the HDD and make a new home folder partition. You will need gparted and nano or your own choice of partition tool and text file editor.CAUTION: these instructions have you blindly erasing hard drive space

Open gparted and create a partition for your home folder on the HDD by selecting the hard disk from the list. It should be labeled something like “sda”. Either format the hard drive as you wish or split up a current partition and make a new home folder partition.

Migrating the Home folder To migrate your current Home folder to an HDD partition, there are four things that you need to do:

Mount the HDD partition onto a temporary Home location. Copy the files from your current Home folder to this temporary Home folder. Relocate the current Home folder Mount the new Home folder.

  1. Create a temporary Home folder

Open a terminal and type the following:

sudo blkid

This will display the UUID(a pseudo-random identifier for every each and every partition) of all the partitions. Record down the UUID for the partition that you have created in gparted.

Next, open the fstab file (contains the necessary information to automate the process of mounting partitions ):

sudo nano /etc/fstab

and add the following line to the end of the file.

UUID=xxx-xxxxx-xxxxx /media/home ext4 nodev,nosuid 0 2
Replace the UUID with the UUID value of the external partition

Save (Ctrl + o) and exit (ctrl + x) the file.

Next, create a mount point to make a place to put your file from the SSD onto the HDD:

sudo mkdir /media/home

and reload the updated fstab.

sudo mount -a

  1. Copy the files from your SSD Home folder to the HDD Home folder

sudo rsync -aXS /home/. /media/home/.
both periods needed(it means "everything")

  1. Relocate the current Home folder

cd /
sudo mv /home /home_backup
sudo mkdir /home

  1. Mount the new Home folder

sudo nano /etc/fstab and change to line which says

UUID=XXXX.XXXXX.XXXX.XXXX /media/home ext4
to
UUID=XXXX.XXXXX.XXXX.XXXX /home ext4

Save(ctrl+o) and exit(ctrl+x) the file.

Lastly, reload the fstab file:

sudo mount -a

remove the back-up copy and regain the space on your SSD

sudo rm -rf /home_backup

This allows the kernel and all the binaries to be run from SSD and you can use the slower HDD to store your bulky data.

Answers excerpted from https://www.tecmint.com/move-home-directory-to-new-partition-disk-in-linux/

Zach
  • 178