Is there a recommened way to install Ubuntu on128GB SSD and use 2TB HDD as main storage

Hi, is there a recommended way to install Ubuntu 24.04 onto a small SSD and use a lager HDD for storing the bulk of my data?

I looked and the install guide,
https://ubuntu.com/tutorials/install-ubuntu-desktop#6-type-of-installation”,
the only reference I saw for multiple hard drives was for installing alongside another operating system,
“If your PC has multiple hard drives then this option allows you to install Ubuntu alongside an existing OS as long as they each have their own drive. Take care to ensure that you are selecting the right drive in this instance!”,
that is not what I’m after.

I’d like to install Ubuntu on the SSD for speed and keep most of my data on the slower HDD, if that is possible?

Thanks

As far as I know, there isn’t any recommended official tutorial.
However, there are bound to be a variety of opinions, so I’ll, briefly, start the ball rolling.

Install Ubuntu 24.04 on your SSD in UEFI mode with GPT (partition table)
Use the home directory in the SSD to store transient files, which change frequently.
Using GPT again, create an ext4 Data partition on your HDD for files which rarely change but which receive additions from time to time
e.g. Photos, Videos, Music (generally media files)

Ensure that the HDD is mounted when the PC boots up

Finally, have you installed Ubuntu before?
It’s often helpful to have an idea of your experience because some expressions may be unfamiliar?
e.g. UEFI, GPT, ext4, mount

Hello tea-for-one, thanks for the quick reply.
Yes I have but not very well. I currently have Ubuntu 22.04 installed on the computer in question, I have Ubuntu on the SSD and storage on the HDD but the HDD doesn’t mount automatically I have to manually mount it each time.
This wasn’t a problem as I wasn’t using the computer much before but now I am and I’d like to do it properly this time.

sdb
sda

Thanks

Let’s translate that into Linux-speak. It seems like you are saying that you want…

  • Your root (/) on the SSD. This is your existing Ubuntu system.
  • Your user data directories (/home) on the HDD, mounted automatically at startup.

Question: Is this an accurate description of what you want?
If not, this is the time to ask questions or to correct us.

Question: Have you ever used the blkid command or edited the /etc/fstab file before?

Hi ian-weisser, thanks for your reply.

I’m not sure what I need exactly hence my question? I failed at it last time and just lived with it because it seemed easier than trying to figure how to fix it but in the end it probably wasn’t worth it.
I’m happy with any king of setup that’ll work as I’m not tech savvy.

if that works in your opinion then I’ll try it.

No, I haven’t I just followed a guide back in the day and lived with the outcome.

Thanks

  1. How exactly do you “mount” your HDD right now?
    What is the exact command(s) or method(s) you use?

  2. Have you used other methods in the past that might still be floating around in your system?

  3. Is your HDD an external/removable/portable drive?
    If so, say so now and skip the next steps.

  4. How familiar are you with a Text Editor like Nano or Vim? (NOT a Word Processor!)
    If unfamiliar, look for a quick Nano tutorial.

    • Later on, you will need to edit a critical system file. You will need to open, maneuver to the right place within the file, add characters, delete characters, save, and exit without making any mistakes using only keyboard commands. A mistake during that edit may be catastrophic. It’s probably best if you make any learning mistakes on a test file.

    • Your Ubuntu Desktop system already includes the Nano text editor. You don’t need to install anything.

  5. In a terminal, run the following commands and show us the complete output of each.

    cat /etc/fstab
    blkid /dev/sd* | cut -d' ' -f1-2
    
    • How to copy/paste the output: Use your mouse to highlight the entire output, then right-click for a menu to select ‘copy’. You can also use Shift+CTRL+C to copy.

    • The first command cat /etc/fstab simply shows a file of storage devices that get mounted at startup. You will be editing this file later.

    • The second command blkid shows some of the data you will be entering into that file. Don’t edit anything yet. Just show us the output.

I open files by clicking on the picture of the folder in the app bar. then I click other locations and mount the other HDD.

Probably. I cant recall. But I’m planning a fresh install not an upgrade so all these shouldn’t be a problem, right?

No, both are internal.

Not at all. I’m not tech savvy I just use the computer for browsing and downloading.

cat etc fstab
$ cat /etc/fstab

/etc/fstab: static file system information.

Use ‘blkid’ to print the universally unique identifier for a

device; this may be used with UUID= as a more robust way to name devices

that works even if disks are added and removed. See fstab(5).

/ was on /dev/sdb1 during installation

UUID=778411e6-e2ec-456d-9506-89cba5d0c28f / ext4 errors=remount-ro 0 1

swap was on /dev/sdb5 during installation

UUID=f2bec1e7-a62b-4d2e-8122-291f8e4a95c1 none swap sw 0 0

blkid
$ blkid /dev/sd* | cut -d’ ’ -f1-2
/dev/sda1: UUID=“654b6d4b-8028-4e0b-8788-4b9b3b1872ad”
/dev/sdb1: UUID=“778411e6-e2ec-456d-9506-89cba5d0c28f”
/dev/sdb5: UUID=“f2bec1e7-a62b-4d2e-8122-291f8e4a95c1”

Here is a simple setup using two disks, vda and vdb:

NAME   LABEL  MOUNTPOINT
sr0           
vda           
├─vda1        
└─vda2        /
vdb           
└─vdb1 Common /mnt/Common-Files

Here, vdb1 is the data partition. I assign a label to it (Common).
Then decide where to mount it. I always use a sub-folder of /mnt because it gives snap applications easy access.
Make your user name the owner of the mountpoint.
Then make an entry in the file /etc/fstab to mount it at startup. You can use the label to make the entry easier to create and read.

The entry to mount partition vdb1 with label Common would be:

LABEL=Common /mnt/Common-Files ext4 defaults 0 2

gparted will label a file system for you.
Instead of a Label, you could use the UUID of the partition to identify it.

Your post shows that your /home partition is on sda1 and that you have no entry for it in the /etc/fstab file so you need to manually mount it each time you want to use it. The page at the link below explains fstab and at the bottom of the page shows an example. You would simply copy/paste that into your fstab file, change the UUID to the correct one for sda1, set the mount point to /home. The page gives some information on the parameters you can use rather than defaults, your choice.

https://linuxconfig.org/how-fstab-works-introduction-to-the-etc-fstab-file-on-linux

I had a try today.
I installed the boot, swap and root on the SSD and the home on the HDD.

Selection_002

I didn’t create the /dev/sdb2 partition but I assume it came about by clicking the “device for the bootloader instalation”.
I’m not sure the the swap is in GiB not MiB like all the others. I’m also not sure why there is 1.34MiB left unallocated I thought I used it all up.

Apart from that I think it work mostly ok. I didn’t loose all my data on the HDD not sure how to access it yet. The disk shows that the data is still there, (I hope thats what I’m seeing).

image

Very new users should just use default or ESP if UEFI system and / (root). But if very larger drive or multiple drive then splitting system / from data makes sense. Easiest is to have /home on slower drive or HDD and system, swap & ESP on faster drive or SSD. Advantage is that install defines partition, so formatted, mounted, and ownership & permissions set correctly. Bit more advanced is separate data partition where some or all the data normally in /home is on HDD. But then you have to have partition on HDD, create mount point, add mount to fstab, and give yourself ownership & permissions. Example: https://askubuntu.com/questions/1013677/storing-data-on-second-hdd-mounting I will copy details here is you decide that is what you want.

1 Like

How to access that disk and have it mounted at startup is outlined in post #8. Maybe you missed it? Ask if you need more on that.

Hi Dennis_N
I had already given it a go before your post.
I don’t understand understand what you are saying, I’m very new to this.
Should I have put,

this instead of /home like I did?
Below is a screen shot of what I did on my sda1?

I’m happy to start it over .I was just having a go there other night as I has the free time, which is hard to get at the moment with it being school holidays presently.

Thanks

Hi oldfred,
thanks for you reply.
I don’t believe I want to go down this,

path. If I understand correctly i’ll be splitting my home over both drives. I am happy to have all of my home on the HDD it sounds easier, which is better for me.

Thanks

First, if you want to mount it somewhere in your home folder, your home folder is /home/user-name, not /home. And user-name should be your actual user name.

In addition, you need to make a new sub-folder in your home folder as a place to mount sda1. Create the new folder, (lets call it Data) then your mount point would be:

/home/user-name/Data

Again change user-name to your actual user name.

Then in /etc/fstab the entry to mount it would depend on whether you made a label for sda1 or not. It would start with UUID= or LABEL= . Change /mnt/Common-Files in the example to the mount point you plan to use.

I’m hoping to clear things up @curmudgeonlyirascibl

but if what I say here doesn’t make sense to you disregard what I say here

To illustrate what @ Dennis_N and others is attempting to say your /etc/fstab file should have a line of something as this

/dev/disk/by-uuid/654b6d4b-8028-4e0b-8788-4b9b3b1872ad”  /home/[insert-your-username-here]/Data  ext4  defaults 0 0
or you could mount with this IF YOU didn't make a directory of Data
/dev/disk/by-uuid/654b6d4b-8028-4e0b-8788-4b9b3b1872ad”  /home/[insert-your-username-here]  ext4  defaults 0 0

the example above is your /dev/sda1 uuid . Which I think is correct one that is not mounting.
Thanks to @ian-weisser for the PM pointing out your uuid ( I missed it in the traffic)

Now how to find the UUID for your drive this part is for your knowledge

ls -lh /dev/disk/by-uuid |grep sd[what ever drive you have for the spinner drive]
Which I will use sdm1 for my system yours I think is sdb1???
displays,
ls -lh /dev/disk/by-uuid |grep sdm1
lrwxrwxrwx 1 root root 10 Dec 27 07:39 12936433190397560490 -> ../../sdm1


OR


lsblk -o type,name,uuid
which will display every drive  (again my system)
 lsblk -o type,name,uuid
TYPE NAME            UUID
disk sdc
part ├─sdc1          190813331791085406
part └─sdc9
disk sdd
part ├─sdd1          190813331791085406
part └─sdd9

Use which ever command is easier for YOU to understand
Your output will be different.
But once the spinner drive (aka regular hard drive) is mounted IT will write all data to the spinner drive at the mount point ( /home/user-name/Data ) not your SSD/NvME or what ever drive your loading the OS/etc etc.

Once you have the UUID for the drive you desire to mount you can use nano to edit the /etc/fstab. The command is simply

sudo nano /etc/fstab

once there go to the bottom of the file (use the directional arrows on your keyboard to navigate) paste or type in the drive uuid and path to mount to
hit control + o to save
then control + x to exit.

There is a reason that these fine folks are telling you to use the UUID versus /dev/sdb1 or what ever is that SOMETIMES the system switches the /dev/sd [letter partition number] when loading. But the uuid is a static method meaning it doesn’t change on a reboot and is more stable.

Generally easier to set up separate /home when installing. You just specify another partition for /home. And then on any reinstall, never format that /home partition. But you can move /home to another partition. Manually create & format partition, temp mount partition, cp or rsync all data from /home to temp home. Then add new entry in fstab to mount new partition as /home. Data will still be in old /home folder under / but hidden by new mount, so you may want to houseclean using a live installer, so you can see data.

1 Like

Yeah yeah what Oldfred said ^^^^^^
:smile: (forgive my silly attempts at humor)
and that is good advice from Fred

I’d have the SSD as the OS and /home then have the larger drive formatted to XFS and mounted as /data
You can then put your casual data on there. You can symlink for convenience as you need

A post was split to a new topic: Need help with new Wubuntu install