Like many I have several physical disks installed in my system and I set them up to be constantly mounted to some paths. I want to find a conventional general approach to it.
In my experience I've come across several conventions on that matter:
/[DriveName]/mnt/[DriveName]/Volumes/[DriveName]- OSX- Any path you like
The first approach seems to be polluting the root namespace. The second uses a directory supposed to be used for temporary mounts AFAIK. The third is alien to Linux world. The fourth is just chaotic.
I lean to the /mnt/[DriveName] approach but I have some doubts. Also I thought that /disks/[DriveName] or /volumes/[DriveName] could be nice but I haven't found such a convention.
Please name a preferred convention on that matter.
Answer
The Linux Filesystem Hierarchy says that /media is for
subdirectories which are used as mount points for removeable media such as floppy disks, cdroms and zip disks.
and /mnt is
provided so that the system administrator may temporarily mount a filesystem as needed.
I often find it convenient to have a temporary mounting point /mnt available, and therefore I don't create any sub-directories or such there.
Internal drives are perhaps not to be considered "removable", but since /media can hold a bit of everything concerning the mounting department, I use that for internal drives as well.
All of the LFS are just common recommendations and perhaps best practices, so whatever suits you is fine, within reasonable bounds. Personally it suits me best to use /mnt for very temporary mounts (loopback disc images, foreign USB drives) and /media for more stable mounts.
Since extra disks today often in practice holds just "media" (movies/music/etc), I find it quite mnemonic as well :-) .
To directly address your points:
1. /DriveName
The document I linked on the Linux filesystem hierarchy mentions your consideration regarding polluting /:
Placing the mount points for all removeable media directly in the root directory would potentially result in a large number of extra directories in /.
, which is implied to be something that should be avoided.
2. /mnt/DriveName
See earlier discussion.
3. /Volumes
Very un-Linux-y in my eyes, but of course it works.
4. "Any path you like"
In practice "yes", but why would one not like to have them mounted in an organized manner?
Regarding mount names, I would also suggest to at least avoid naming them e.g. /media/sdb1 and so on, since this is not really a partition specific parameter (as UUID already addresses). Personally, I use a combination of a personally assigned ID number and the partition size, such as /media/5-2000. The partition specific unique ID enables me to tab complete by a single number after /media/. But this is all discussion on very individual preferences, so I'll stop here.
No comments:
Post a Comment