Ivor O’Connor

January 7, 2013

The Best Linux Directory Structure?

Filed under: Uncategorized — ioconnor @ 9:23 pm

I’m certainly not a *nix Admin. I have always ignored structural issues Admins must deal with and have lived in my own little home world of ~. This SSD drive is forcing me to think about directory structures though. Here are my discoveries.

  1. Use the entire disk as a single partition. This means you must not take the defaults the installer will supply but click on the advanced button. Assuming the system has 4+GBs there is no need for a separate partition for caching. Use your RAM for caching instead. If you attempt to use  any SSD for caching it will prematurely end the SSDs life.
  2. Don’t use your home directory for anything other than a link. So if you are user “/home/dduck” make a copy of it and then link dduck to it like dduck->disk_dduck. So /home/dduck points to /home disk_dduck. Now you can copy disk_dduck to say /tmp/home/ram_dduck and work from there without touching your SSD.
  3. Make a subdirectory under the home directory where the real stuff will go. Applications trample over the home directory making it not your home. So make a new directory called “me”. Make a few relative, not absolute, links into this directory from the home directory for files like .vimrc, .bashrc, etc.. So you will have links like this in your ~/dduck like “ln -s me/.bashrc .bashrc”. Avoid links in the “me” directory so the “me” directory can be copied to USB devices that are formatted with fat. Now make a backup of your “me” directory to some, multiple, USB devices. A “time rsync -av –progress ~/me /media/PENDRIVE/blah”.
  4. Live off a ramdrive and save your SSD. Do a “mkdir -p /tmp/home/; rsync -av /home/dduck /tmp/home; cd ~/..; ln -s /tmp/home/dduck /home/dduck”
  5. Make it automatic. Write scripts to do this on startup and shutdown. Then a few scripts that can be called to sync your work to USB or disk as needed.

This seems to be working best for me on this new SSD drive. I’ve tried adjusting the system settings so that the SSD doesn’t get used but doing so is laborious and the results are not acceptable. With this setup I rarely ever see the HD light flash. And that means to me my SSD drive isn’t being burned out.

UPDATE 2013-02-19: I put the scripts up that make this process automatic here Tutorial On Automatically Moving Home To Ram Drive And Back On Startup And Shutdown


Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: