@BobK
What is the easiest way to move the home folder from the main disc (ssd) to a separate, quite a bit larger, second disc (hdd)?
Edit.
Bit more info should come in handy.
It will be a fresh install, Linux Mint on a 128GB ssd. The second disc is a 2 TB hdd. As the missus is quite the clutterbug, I prefer that she fills up the hdd instead of the ssd.
Edit.
That didn't work. Eh.
That's pretty much the system I'm running right now; a 128GB SSD and a 2.5TB HDD.
Install the system normally but before you install anything more than the bare system, install the big HDD. partition it with four partitions: one which will be /home, one which will be /var/, one which will be /tmp, and one which will be the swap partition. Do not let the system create a swap file when you first install the system; we'll be doing that ourselves; the last place to put a swap file is on an SSD.
Make the swap partition about twice the size of your RAM; I have 32GB of RAM and a 50GB swap file. I made my /tmp and /var partitions 50GB each also, but that was massive overkill; right now /tmp is using 600 MB and /var is 1.2GB. The reason for /tmp and /var being on the hard drive rather than the SSD is because logs are written to /var/logs, and /tmp accumulates lots of junk. More to the point, log files are written to
very frequently which will degrade the SSD.
gparted is the tool to use for creating partitions.
I just checked my Linux Mint box and /var is over 11 GB on that system, mostly in /var/cache/apt which of course I don't have on my Slackware system.
Give the rest of the space on the drive to /home of course.
Make a note of which partition is which block device, you'll need this info later. On my system, the HD is /dev/sdb, /dev/sdb1 is /home, /dev/sdb2 is /var/ /dev/sdb3 is /tmp, and /dev/sdb4 is the swap partition.
lsblk is a useful command here.
It's easiest to become root instead of prefixing everything with sudo; do this with "sudo su", type your opassword, and you will then be root until you end the session.
Format the partitions with mkfs on the data partitions and mkswap on the swap partition.
Now we transfer the existing /var/tmp and /home directories (which were created on the SSD) to the hard drive. Mount the HD on a convenient mount point such as /mnt via:
#mount /dev/sdb1 /tmp
or some such, using the appropriate block device for /dev/sdb1
#cp -a /home /mnt
#umount /dev/sdb1 ("umount /mnt" also works here)
#mount /dev/sdb2 /mnt
#cp -a /var /mnt
#umount /dev/sdb2
#mount /dev/sdb3 /mnt
#cp -a /tmp /mnt
#umount /mnt
Now edit /etc/fstab accordingly. Mine looks like this:
Code:
/dev/sdb4 swap swap defaults 0 0
/dev/sda1 / ext4 discard,noatime 1 1
/dev/sdb1 /home ext4 defaults 1 2
/dev/sdb2 /var ext4 defaults 1 2
/dev/sdb3 /tmp ext4 defaults 1 2
There's other stuff for my NFS partitions etc but that isn't relevant here.
Notice the entry for the root partition uses flags of "discard, noatime" instead of "defaults". This is to avoid writing the access time every time a file or directory is accessed; again to save wear and tear on the SSD and nobody cares about atime, just the creation time and modification times on files.
Reboot and cross your fingers! See if everything is mounted properly with the mount command, lsblk, and/or df -h
We still have some cleanup to do but it's fairly minor and we can worry about it later.
Note that I am writing all this off the top of my head and glancing at my own system files, it looks good to me but I can't guarantee I'm not overlooking something. Like UUIDs, lol
It's also possible that when you install the system, it can automagically handle a SSD/HDD setup if it finds such. That would probably be easier.
EDIT: Looks like that askubuntu article covers it, but I'd still put /tmp and /var on the HD too.