Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
New install of Mandriva 2005 LE.
Here is the result when doing a fdisk -l
Disk /dev/sda: 160.0 GB, 160000000000 bytes
255 heads, 63 sectors/track, 19452 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 764 6136798+ 83 Linux
/dev/sda2 765 19452 150111360 5 Extended
/dev/sda5 765 904 1124518+ 82 Linux swap
/dev/sda6 905 19452 148986778+ 83 Linux
And the result of doing a df command:
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 5.8G 4.1G 1.5G 75% /
/dev/sda6 140G 601M 140G 1% /home
Now I guess my question is how can I and how should I modify this so that my "/" wil now get full. (as you can see , there's only 1.5G available and 140G on my /home.
Overall, how does this look to you? Any suggestions appreciated.
The /usr directory is where new software you add thes installed to. It is probably the largest non-home directory, and it will grow with time. Consider shrinking your home partition and make a new partition for /usr in the space you freed up, and move the contents of /usr there.
This should free up a lot of space in your root (/) partition.
On my system, I've created five partitions:
/
/home
/usr/local
/var
swap
/home is a separate partition for obvious reasons: easy to keep across a distro change or upgrade - no loss of user settings
/usr/local is separate for similar reasons. A distro is not supposed to touch anything in /usr/local, but I don't know how faithfully the distros follow this. Regardless, it keeps any stuff I have added separate from the system.
/var is a separate filesystem since it contains the logs. If this filesystem runs out of space, the whole system doesn't come crashing down. It just means I don't get anymore log information until something gets freed up.
Using 'cp -a /usr/* /usr-new' would probably work better.
The /usr directory may be needed while Linux is running. First mount the new partition under a different name. If you have it mounted as /usr to start, you will mount over the old /usr directory and won't be able to copy the files.
You could perform these steps as root:
1) create a new directory: mkdir /usr-new
2) mount the new directory at /usr-new: mount -t ext3 /dev/hda7 /usr-new # Here I am assuming /dev/hda7 and ext3 filesystem.
3) copy the directory: cp -a /usr/* /usr-new
4) edit the /etc/fstab entry. Add an entry for /usr at /dev/hda7: /dev/hda7 /usr ext3 acl,user_xattr 1 2
note: You might want to copy the fstab line for /home as a model, and change the device and directory fields. The device field should be the device of the new partition and the directory field should say /usr. (I'm assuming /dev/hda7)
Next we will need to change the name of the /usr directory so that we can have a new /usr partition mounted. We don't want the new partition mounted over the current /usr because that will hide the directory contents we want to delete. mv /usr /usr-old # This just renames the directory, it doesn't move the contents. mkdir /usr # This is the directory for /usr that will be mounted over by the contents of the new partition. mount -t ext3 /dev/hda7 /usr # Now we have the new partition acting as /usr (in this shell at least) rm -R /usr-old # Remove the old contents to free up space.
note: Using "rm -d /usr-old" or "unlink /usr-old" may be quicker. If it works on your system, it will remove the directory entry for /usr-old and not recursively delete every file of its contents.
Lastly cross your fingers and reboot: /sbin/shutdown -r now
Good Luck.
P.S.
a) Before you do these steps it may be better to log out of KDE. Then go into single user mode. For Mandrake this is "telinit 1".
b) For step 3, consider using a "tar" command similar to the example given at the end of the info tar manual to copy the files.
#> cd sourcedir; tar -cf - . | (cd targetdir; tar -xf -)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.