Partitions and disk space

Geert Janssens geert.janssens3 at pandora.be
Mon Oct 4 11:02:02 MDT 2004


Hi Steven,

There are two options I see:
1. some time ago, there was an anouncement on this list for a commercial 
linux partioning tool, that was capable of resizing partitions without 
data loss. You could search the archives to see if it suits you.

2. Do a "partition dance" (although this is not non-destructive!): if I 
read the number correctly, you have only 62Gb of your 80Gb HD in use.
The partition dance would take the following steps:

* make an additional temporary partition in the free part of your HD, 
large enough to hold all data currently stored in /usr. In your case, 
that would be, larger than 1.6Gb.

* make a filesystem on the new partition, and mount it (eg in 
/mnt/your-mounted-temp-partition)

* as root, use cp -ax /usr /mnt/your-mounted-temp-partition
to copy over all of /usr to your temporary partition, preserving all 
file attributes

* IMPORTANT: modify your /etc/fstab to use the temporary partition as 
/usr next time you boot

* reboot

* if the boot process doesn't complain, you can delete the old usr 
partition, and in this free space create a new /var  and /usr partition. 
If you want your final /usr partition to be 10Gb, create the new /var 
partition 34Gb. If this is not enough, you will first have to move your 
old var partition into the temporary space just as you did with the usr 
partition. Then you can delete the old var partition also in this step, 
and have 45Gb to divide into a new /var and /usr partition.

* make a filesystem on the new partitions, and mount them (eg in 
/mnt/your-mounted-new-var-partition and /mnt/your-mounted-new-usr-partition)

* as root, use cp -ax /var /mnt/your-mounted-new-var-partition and
cp -ax /usr /mnt/your-mounted-new-usr-partition
to copy over all of /var to your new var partition and usr to the new 
usr partition, preserving all file attributes

* IMPORTANT: modify your /etc/fstab to use the new var partition as 
/var, and the new usr partition as /usr next time you boot

* reboot

* if all is well, you can delete the temporary /usr and /var partitions.

As I said, not non-destructive, but it works. I have done this more than 
once already. The safest thing in any case is to make a backup of all 
sensitive data before doing this.

Hope that helps,

Geert

Steven J. Norton wrote:
> Hello, all --
> 
> Here are some questions I've been meaning to ask for a while now: if you
> check out the disk space report from LogWatch on my YDL web server
> (reprinted below), you'll note that my /usr and /home partitions are quite
> large and only sparsely used, while the /var partition (home to the content
> files of my web server) is much smaller -- and already 17% full and
> climbing. I had accepted the partition scheme suggested by the YDL installer
> when this was set up.
> 
> So here goes:
> 1) Is there a non-destructive way to change the size of existing partitions
> (i.e. can I retrieve some space from, say, /home and give it to /var)?
> 
> 2) If so, which partitions that currently have extra space can be safely
> made smaller? Since I'm not using this as my main computer, I am assuming
> that /home does not need to be this big as there will not be too many user
> files. What about /usr -- if I'm not installing a bunch of productivity
> software, will this ever grow much?
> 
> [This is on an old beige G3 with a fresh 80 Gb hard drive and running YDL
> 3.01, by the way.]
> 
> I know that I can tell Apache to look elsewhere on the disk for content
> files, but I'd much rather keep everything inside /var/www/ for both
> security and sanity reasons. Of course, this isn't really a problem yet, but
> I've only just really started using the server and I want to head off
> problems if I can. Any advice appreciated!
> 
>   -- Steve
> 
> ------------------ Disk Space --------------------
> 
> Filesystem            Size  Used Avail Use% Mounted on
> /dev/hda14            496M  120M  350M  26% /
> /dev/hda12             16G  146M   15G   1% /home
> none                  187M     0  187M   0% /dev/shm
> /dev/hda10             44G  1.6G   39G   4% /usr
> /dev/hda13           1008M  155M  802M  17% /var
> 
> _______________________________________________
> yellowdog-general mailing list
> yellowdog-general at lists.terrasoftsolutions.com
> http://lists.terrasoftsolutions.com/mailman/listinfo/yellowdog-general
> HINT: to Google archives, try  '<keywords> site:terrasoftsolutions.com'
> 
> 


More information about the yellowdog-general mailing list