[thelist] RE: Help with Red Hat 6.1 root dir space (root)

root djc at five2one.org
Tue Sep 19 12:58:38 CDT 2000


alrighty.. as you can see, your /(root) mount is all used up.. what
we're going to do is slide all your data onto the /files mount and then
make that your root mount.

Before we do any of this, I'd very much recommend that you backup
anything important on this computer like financial data, tommy lee and
pamela mpg's, email files, etc.. I'm not saying something will go wrong,
but ya never know :)

first off, rename /files( i assume you have nothing on there.. if you
do, put it somehwere else for now) to /new with 'mv /files /new' then
copy everything over to the /new directory from your root mount like so:
'cp -a / /new' the -a flag with the cp(copy) command will get everything
underneath /

Go make a nice manhatten or other beverage if thats your thing, cus this
step will take a while while it copies everything over(only about a GB
though, which is ok).. It looks like you have SCSI drives though so it
might not be too long.. At any rate..

Once its done copying everything over, take a look around /new and check
to see that the all important files are there, and the directory
sturcutre is somewhat similar to what it used to be. 

At this point you should have two copies of your root(/) filesystem. One
mounted on / the other mounted on /new - make sure everything is over on
new before we go any further.

Now comes the (somewhat) tricky part. Print this out, or look at it on a
different computer, or just memorize it :)

you're going to issue the command 'init 1' which will bring you down to
single user mode.
Next you're going to type 'umount /dev/sda7' and 'umount '/dev/sda6' -
then you can type 'df -h' again to get this:
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda5             988M  956M     0 100% /

Only you're old root filesystem should be showing at this point. Now
we're going to unmountyour old root drive, and remount what was /new as
the new root drive. 
'umount /dev/sda5'
then remount the new one
'mount -t ext2 /dev/sda7 /'

thats telling linux to mount the physical drive /dev/sda7 with the ext2
filesystem(normal linux FS) on the / mount point. At this point, type
'df -h' again and you should see something like:

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda7             4.0G  976M  3.2G  23% /

Congrats, you've just remounted your root filesytem :)

But we're not done yet. Lets remount our old root partition just in case
with 'mount -t ext2 /dev/sda5 /old' and get our home directories back up
with 'mount -t ext2 /dev/sda6 /home'

at this point, look around and make sure everything is good to go.
Before we're done, we have to edit a file to make sure that whenever the
machine is restarted, it will mount the drives just like you did now.

Open up /etc/fstab with your favorite editor and rearrange it so the top
couple lines looks something(well, pretty much exactly) like this:

/dev/sda7               /                       ext2    defaults       
1 2
/dev/sda5               /files                  ext2    defaults       
1 2
/dev/sda6               /home                   ext2    defaults       
1 2

now there will be some other lines below that, but you should need to
touch them. The above will basically mount sda7 to the root partition,
sda5*(your old root partition) to /files(all the data should still be
there untill you delete it) and sda6 to /home just like before.

Save the /etc/fstab file. Now we're ready to go back into multi-user-
normal - mode. After you've saved, type 'init 3' which will bring us
back to where we were before and everything should be kosher. If you run
the 'df -h' command at this point, we'll see:
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda7             4.0G  976M  3.2G  23% /
/dev/sda5             988M  956M     0 100% /old
/dev/sda6             2.9G  949M  1.8G  34% /home 

Now you've got plenty of space on your root directory, problem solved!
And all without rebooting!! :)

Shout if you have any more questions. :)

.djc.

> 
> First, lets see what you've got left for space.. Run the command 'df -h'

thanks, I get:

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda5             988M  956M     0 100% /
/dev/sda7             4.0G   20k  3.8G   0% /files
/dev/sda6             2.9G  949M  1.8G  34% /home 

nk




More information about the thelist mailing list