Ubuntu: Difference between linux subdirectories [duplicate]


This question already has an answer here:

I am building a computer and installing Linux of it. I am considering of getting:

A small capacity SSD for frequently accessed files (such as the OS and programs),

A small capacity hard drive for frequently written files (such as temp files),

And a large capacity hard drive for backup, and various media (such as music and movies).

So how should I divide the subdirectories so that I can minimize wear on the SSD but keep my computer fast? Below are a couple of websites I visited, but I still need clarification. Thanks in advance, Sam.

Table 3-2 of http://www.tldp.org/LDP/intro-linux/html/sect_03_01.html



Bulk data does normally go to /home and /srv, with the latter often beeing completely unused on desktop systems. Obviously these two directories should reside on your "big" storage, possibly symlinked to each other.

/dev, /proc and /sys are not usually written to on the file system. Instead temporary file systems get mounted into these folders and consequently there is no need to put them anywhere else. Same goes for /mnt (rarely used today) and /media, on which empty mount point directories are created each time you put in a USB drive or similar medium. This is not likely to ever kill your SSD though.

/bin, /sbin, /lib, /usr and /etc are all classical examples for things you would keep on the SSD, Those dorectories contain your program files and they are not normally written into unless you modify your software setup or make system wide configuration chages.

/var is the only directory which is supposed to contain changing, persistent data during regular system operation, by your logic you would put this one on the small hard disk.

Trickier is what to do with /tmp and /run. These two contain rapidly changing data, which is not needed across reboots. The system can profit a lot from the speedup provided by having those on the SSD, however they would also be the most weary storage areas.

Directories of this name are also available in /var, yet they are seperate because the equivalents in the / directory are considered more vital to the system function and traditionally they should be available even in situations where /var is unmountable for some reason. Actually it is rather safe to symlink them to /var/tmp and /var/run respectively.

You can also think about mounting them as ram disks, but beware that some applications might try to write a lot of data into these folders and lately I came across programs that rely on persisten directory structures in /run and /var/run or mechanisms that tend to act irritated when writing data to /tmp early in the boot process and finding themselfes unable to retrieve this data later after a ramfs has been mounted there.

In general I would not worry too much about straining a modern SSD. They are an order of magnitude more durable than a common USB stick and I am happily running /var, /run/ and /tmp on a SSD myself. The increase in operation speed is probably worth it.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »