Category Archives: partition

Partiton Full? Move your Stuff Somewhere Else

If you run out of space on a particular partition, but you have excess space on another partition you can relocate your data. Lets say you have 100 Megabytes left on /dev/hda1 but your have 10 gigs left on /dev/hda2. Lets say you have a folder on /dev/hda1 /home/user/backup that is over 2 gigs. Lets transfer these files to /dev/hda2 and then create a symbolic link at the original location so the folder can be accessed from the exact same location. For the example /dev/hda1 is mounted at /home/user/backup and /dev/hda2 is mounted on /home/user/backup2.

1) Create a new folder and move the contents.

cp -r /home/user/backup/* /home/user/backup2

Then check that the files have been successfully copied to the new directory. Then delete the original backup directory.

rm -r /home/user/backup

Then create a symbolic link to the backup directory.

ln -s /home/user/backup2 /home/user/backup

Now when you navigate to /home/user/backup you wont be able to tell the difference except that you have now alot of space on the /dev/hda1 partition.

Your partitions may be mounted to different locations, just apply the above example to your particular configuration.

Important Directories and Their Use

The home directory is the most important to be separate. Having your home directory, in a separate partition, allows you to format the entire root partition, to install or reinstall a new operating system, while preserving all of your files. I cannot tell you how many times this configuration saved my stuff. I always make this directory the largest, unless you plan to be installing large applications. Applications are primarily stored in the usr directory, and the only reason usr should be large is if your applications store large numbers, or many, of files.

Another partiton, that really needs to be large if you compile your own custom kernels, is boot. When you create a boot image this can take many a megabytes, therefore you should make the boot partition 500 megs or so. Initially I used to make this parition 50 megs, but I started to have problems when I compiled my own kernels. I would have to manually deleted old boot images before installing the new kernel.

The media directory holds your external devices. Your cdrom usually automounts, and will go to /media/cdrom. If it doesn’t auto mount you can mount it with:

sudo mount /dev/cdrom /media/cdrom

I mount a three drive, raid 1, partition in /media/media. On Ubuntu this conveniently places an icon on the desktop called “media”. I used this raid drive to hold my MythTV recordings.

There aren’t many other partitions that are incredibly important to reference. The temp directory comes in handy, and is used by many programs particularly caching programs to store data. You can, in most instances, delete the contents of this directory occasionally. For the most part, everything other than your home directory can be included in the same partition as root. I break down my system like this:

/boot: 300 Mb
/home: 200 Gb
/media/media: 500 Gb
swap: 10 Gb

I need a large swap file because of MythTV’s commflag application.

Server Memory Setup – To Swap or Not to Swap

For a while I turned off the swap file on my virtual machine. It worked, but then I began to use more php pages and the server began acting funny, especially with database queries. After a day or two of the system crashing I turned on a swap file and the system stability came back real quick. The virtual machine has 1024 megs of ram and 2048 megs of swap and the system appears to be managing memory much better. Review your system performance and status with the top binary.

As for the host, I turned the swap partition back on, but I dont think it is needed. I will try server configurations on my days off this week.

Evolution Folder Link from Home Partition

If you use Evolution main from an installation that was originally in the /home/user/.evolution folder, and have migrated to a separate partition with a different mount point, you will have to create a link to the folder in the home/user directory. For instance my .evolution folder is stored on my extra partition in /media/sda5/.evolution, and when I try and send mail it tries to save the data in /home/user/.bgevolution. To correct this error I simply placed a link to /media/sda5/.bgevolution inside the /home/user/ folder. This resolves everything and establishes folder location consistency for Evolution Mail.