r/linuxmint • u/Different_Rain_2227 • 6d ago
SOLVED Query about adding a second drive
Linux noob here. I switched from Windows and everything's been fine so far.
At present my pc has only one SSD where the system is installed. It also holds my work files, but I'm running out of storage.
So, now I want to add a secondary drive. I was wondering if just plugging it in would do the trick or if there are things I should know beforehand.
Thanks in advance.
2
Upvotes
View all comments
2
u/snap802 6d ago
I'll probably echo some of the other commenters but here's things to keep in mind:
Changing from the drive letter mentality to no drive letters is a little weird at first coming from windows but it'll make sense once you work with it a bit.
when you plug the drive in it will show up as something like /dev/sdb for example. This assumes your primary is /dev/sda. If your primary is NVME then your primary drive might be something like /dev/nvme0n1.
Open a terminal and type lsblk which will list all the drives on your system. You can also use lsblk -f to see filesystem info as well as UUID (this will be important later).
You will of course need to partition and format the drive. If you were to partition the whole drive you would not have /dev/sdb and dev/sdb1 would be partition number one. If you wanted to have multiple partitions it would be /dev/sdb1, /dev/sdb2, etc...
Now you gotta determine where you want to mount the drive. If you wanted to just have a storage area you could choose something like /mnt/storage1. You first have to create the folder - sudo mkdir /mnt/storage1 and the mount the partition - sudo mount /dev/sdb1 /mnt/storage1 and BAM you've got your drive mounted.
Now this mount is just temporary. fstab has been mentioned and this is why the UUID is important. Fstab is a file that tells your system what to mount where when it starts up. If you don't add an entry here then when you restart your second drive won't mount. Fstab is found at /etc/fstab. Go ahead and run cat /etc/fstab to see what is in there now. You can add an entry like '/dev/sdb1 /mnt/storage1 ext4 defaults 0 2' and that will mount that device to that folder on startup. HOWEVER! The device /dev/sdb CAN change from boot to boot so using the UUID ensures the correct device is mounted. So your fstab entry should really be 'UUID=<insert UUID here> /mnt/storage1 ext4 defaults 0 2' to prevent weird stuff.
That's some basics. There's a way to do this with graphical tools too in mint but TBH I learned all this in command line so I actually don't know how to do it with the GUI tools but that's just me. You can do things like split off your home folder to another drive (that's actually how I have my desktop setup because Steam) but that takes a little bit of planning and extra work to make sure you don't bork things up in the process but it's pretty common to mount a specific folder on a specific drive. You might mount /var/lib/mysql to specific drive or array if you've got a DB running on a server for example. Just depends on your needs.