Having trouble understanding file system in Linux

Hi everyone,
I just switched to Linux the other day, and I have 2 hard drives. One is an ssd 250gb, and I set this as "/" directory for booting, the problem is I wasn't sure what directory to set my 1tb hd so I set it to "/tmp". I also set 2gb of swap, idk if that's too much or not enough. I would like the 1tb hd for downloads and most of the programs to run off of. How do I configure the file system and multiple drives for this?

Thanks!

It doesn't make a whole lot of difference where the mount point (read: directory) for secondary drives is. Usually there is a /media directory for this, but the name doesn't really matter. /tmp is a directory for temporary files (intermittend downloads, etc) that is (usually) cleaned regularly.

1 Like

Oh ok, I figured as much is there a way to change the mount point?

Sure, you can simply edit the /etc/fstab.
Personally I'm mounting my stuff under something like: /storage or /files but something like /media/1tb_data or so is also great. I wouln't use /media directly, many distros mount stuff like external hdds or flashdrives under the partition-id or the label as directory there.

2 Likes

Oh yeah sorry, was worded a bit off. I meant a sub-directory inside /media of course :slight_smile:

1 Like

I have mine set up as:

24GB SSD OS drive is /
1TB HDD split into 2 partitions with one as /home

The other partition I copy important files to and copy things to an external drive and another machine for backups, so all 3 of these have the same contents. This partition isn't set to auto mount for me and comes up under the /media directory. Installing /home on the HDD will make it so programs and downloads and things will install there and leave the OS on the SSD.

Your typical personal files like Desktop, Documents, Downloads, Music, Pictures and so on will be under your user in the /home directory. You can show hidden files to see other programs installed like Firefox, Steam and the like.

The swap partition should be fine. I think mine is only 512MB with 8GB RAM and I rarely go beyond 2GB RAM used, no issues so far.

Caution!

As soon as you ask ten people for partitioning advise, you'll get fifteen different opinions. The reason for this is simple, Linux is so flexible, that it is equally at home on a smart phone, a laptop, a server, or a super computer. Therefore, the partitioning scheme can and should be adjusted to both the use case, as well as the available hardware.

There is no right answer, but most would be tempted to put /home on the spinning rust drive. Why would this be? Whelp, in the home directory, we find /documents, /downloads, /music, /pictures, /videos and /.steam. All of these types of data tends to take up quite a lot of room and most would not necessarily need to be on the SSD. Also, having /home on its own, makes upgrading your distribution far less painful, as data loss is less likely.

Some folks, on the other hand, want their /.steam directory on the SSD, because they wish to minimize game loading times, but are happy with their videos and music on the spinning drive.

Some would put /var and /tmp on the spinning drive to minimize the writes to their SSD, thus increasing its life. Having a separate /var also prevents this directory from growing too large and starving the rest of the filesystem for space.

Some don't like to have a /swap partition on a SSD, in order to minimize writes, but find that /swap on the spinning drive too slow, so they buy extra RAM and they don't use a /swap partition. Others would put the /swap on the SSD, but decrease the swappiness adjustment to a very low number, such as 10.

As you can see, there are many variables, but most folks are perfectly happy allowing the installer to set up a default filesystem. If they out-grow their primary disk, they can add a second disk, create a /music partition on it, for instance, and then create sym links between the /music directory of each disk.

BTW - There is no right, or wrong answer about the amount of swap space. If you have a lot of RAM, you may not need any swap at all. On the other hand, if you only have 2GB of RAM, but all you do is read e-mail on your machine, you still may not need any swap space. You have to monitor your RAM usage and see what is normal for your habits. If you find yourself running out of RAM, either buy more, or increase your swap space.

EDIT:
There is no such thing as a stupid question (usually). But I would urge you, as a new user, not to obsess over your filesystem. You will have plenty of opportunities to reinstall your system as distribution updates are released, or as you branch out and try different distributions. Believe me, you'll get plenty of opportunities to demonstrate your partitioning prowess. For now, get yourself a notebook, or a spreadsheet and document these nuggets that you are learning, so that you can plan your next install.

2 Likes

What programs?

@BarkingMad made a good post.

If a lot of your space will be steam games for example, then making your hard drive mount under /home is a safe bet.

Now that you've installed Linux, you'll have an issue that if you mount your hdd on /home it wont have anything that you had in /home (used for your desktop stuff, config etc.)

Its fixable. It depends if you want to fix it or just reinstall and look at how it works later?

I wouldn't worry to much about partitioning. I dont even bother these days.

I have a large SSD so i don't bother with a spinning disk. But when i did have a spinning disk, I used the default partitioning from Fedora. And mounted the hdd under /data then symlinked data to various folders in /home/username

For steam i just added a new install folder in steam to /data/steam.

It ended up being the easiest solution.

While this is true, it's possible to set multiple steam directories on Linux too, no? Or is this a windows-only feature?

I have /root and /home on totally different drives.

I used to do a lot of nuke n' paves, but its still hella useful for when you have a lot of stuff you plan to stick in /home.

1 Like

You can set as many as you like.

OK, would have been weird if this were Windows-only. So you could still have the ~/steam on the external spinning disc, then the fast-loading games in a second directory on the ssd... that's what I would do anyway :slight_smile: But then again, so many possibilities...

Pretty much yeah. I have had basically that setup before. Default folder on home (ssd) and another on a spinning disk.

I agree that there's a number of ways to address this...

My Desktop rig has / on one partition, /home on another (same drive), however if using an SSD I'd have / on that, /home on my 2TB drive I guess. I dual-boot, so the winblows drives are also mounted as /mnt/Diemus and /mnt/Leeloo, The are D and L drives in win. I don't bother mounting C as docs etc are on Deimus.

I edited fstab to make it all play nicely, I'm no linux guru but if you do enough searching you can generally find the info you need (and a number of different way to achieve it).

@BarkingMad post is great!