7

I have SSD and HDD. I installed my OS on the SSD and created Ext 4 partition on my HDD which I want to permanently mount on the OS. I know it's done through fstab but I don't know in which directory to mount it.

I've read that /media is for external drives and /mnt is for temporary mount drives, but I want my drive to be permanently mounted on startup.

Should I use /mnt ?

7
  • You can use a mountpoint in both /media and /mnt as well as in some other directory. The classic directory for permanent mount points is /mnt, for example sudo mkdir /mnt/exthdd and use that as a mountpoint.
    – sudodus
    Commented Jan 6, 2018 at 7:56
  • /mnt is for internal disks. /media for external. I myself use my own mountpoint /discworld for my internal disk.
    – Rinzwind
    Commented Jan 6, 2018 at 8:00
  • I also have a mount right off the root for my /storage and /pvr
    – John Orion
    Commented Jan 6, 2018 at 8:07
  • So making a directory in the root and mount it there is viable option ? For example sudo mkdir /storage and perma mount my drive in /storage ?
    – BlackSova
    Commented Jan 6, 2018 at 8:13
  • There is no real standard, unless in a [enterprise] environment that has one. I used to use /mnt, but got tired typing it so moved to directory off / many years ago. Use whatever makes sense to you, and people in your environment that will use it.
    – guiverc
    Commented Jan 6, 2018 at 8:27

2 Answers 2

2

As there is no written-on-stone rule where to mount additional disks in linux:

I would use a custom folder in / to mount a permanent disk.

Example:

If I create a folder /d and mount my new SDD there (add to /etc/fstab for permanent mount upon boot), I would have this folder easily accessible via a very short path cd /d which will make sense for me.

Of course, You can also mount in /home or at other places, but it needs to make sense for your own setup. If it is a backup drive, I would mount it at /home/backup or /backup as long as it makes sense for me that this is descriptive enough.

1

I mounted my HDD on /mnt, created some folders and stored some files. After rebooting the laptop all was gone, nothing was shown under /mnt/myHDD. I thought I had lost everything but no. The data was still there, but for some reason the OS was not showing it.

After unmounting the HDD and mounting it on the root (as /myHDD) all went back to normal.

I suspect this is because of the nature of /mnt. The Filesystem Hierarchy Standar says this about /mnt:

/mnt : Mount point for a temporarily mounted filesystem

Purpose This directory is provided so that the system administrator may temporarily mount a filesystem as needed. The content of this directory is a local issue and should not affect the manner in which any program is run. This directory must not be used by installation programs: a suitable temporary directory not in use by the system must be used instead.

So it makes sense it 'dissapears' after rebooting the machine even if it was added to /etc/fstab which was true in my case.

The other option might be mounting the HDD under /media but the Filesystem Hierarchy Standar says this about /media:

/media : Mount point for removeable media

Purpose This directory contains subdirectories which are used as mount points for removeable media such as floppy disks, cdroms and zip disks.

It doesn't make sense to use it to mount an HDD either. What to do then?

Well, mounting the HDD anywhere else, like in the root folder /hdd.

Hope that helps!

2
  • Hi @Zanna I wanted to say I mounted the HDD on /hdd/ not in /` ... I know it looks confusing so I have updated my post to correct it. Do you recommend to mount the HDD in /media/hdd or it is fine just doing it in /hdd. I think doing it in /media doesn't make sense given the definition by the Filesystem Hierarchy Standard, but that is just my feeling and I'm new to Linux. Thanks!
    – ig-perez
    Commented Aug 26, 2020 at 0:44
  • 1
    I recommend using /media/hdd or /media/what-you-like. That's what is usually done and it's where the nautilus (and other file browser applications) expect other filesystems (including other partitions used for storage on the same drive) to be. If mounted at a custom location they might not show up conveniently under "Other Places", though they will still be accessible. There's nothing wrong with using a custom location like /hdd so it's fine to suggest that, but I don't think the FHS is to be interpreted as saying that it's wrong to permanently mount additional filesystems in /media
    – Zanna
    Commented Aug 26, 2020 at 1:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .