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
  • Older instructions will mention swap partition. Install now does not need one as it uses a swap file. If you have more than 4GB of RAM, you will not use swap anyway. Do not use a /boot partition either. https://askubuntu.com/questions/336439/any-problems-with-this-partition-scheme You can just have /home or a large data partition on HDD with / (root) on SSD. https://askubuntu.com/questions/461394/how-to-partition-ssdhdd & http://askubuntu.com/questions/343268/how-to-use-manual-partitioning-during-installation – oldfred Feb 12 '19 at 20:52
  • 1
    @oldfred re:"more than 4GB of RAM, you will not use swap anyway". This is not accurate. You especially need a large swap file if you hibernate. But even if you don't hibernate, a swap is still needed. I have 16G RAM, 8G Swap, vm.swappiness=10, and I still swap. – heynnema Feb 12 '19 at 21:09

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
  • 1
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – Mitch Feb 15 '19 at 17:18
  • As to SWAP. I have 8Gigs of ram and I do have a SWAP on the HDD (IMHO swap on SSD is not healthy) and I use it. – Zach Feb 17 '19 at 05:04
  • Thanks for the efforts @Zach and other who took out time to answer. I have successfully installed ubuntu. However I am facing heavy battery drain in Ubuntu compared to Windows (pre-installed) maybe cuz this PC is optimized for Windows by Dell and there maybe a few more drivers and stuff I may have to install manually in ubuntu. I'll post a separate question for this – D_jay Feb 19 '19 at 06:39