TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TCLUG:674] Adding new space



Safer might be:

(as root)
0. Make sure you have a bootable disk -- just in case
1. Install & partition your new drive.
2. As Init mode-3, Mount the new drive (change fstab).
3. cp -r your /usr directory onto your new drive into the correct
   directories / filesystems.
4. mv usr usr.backup
5. Immediately creat a link by: ln -s <mount_dir> usr
6. Make sure the file/directory ownerships are OK.
6. Make sure everything works find by cd'ing into all of your
   usual /usr directories, as if nothing were different.
7. Reboot and test again.
8. If everything is working correctly, you can delete your /usr.backup
9. Since there are system binaries in the /usr directory, there is 
   a possibility that you will not even be able to reboot. This is
   where you pull out the emergency boot disk, mount the hda drive, 
   delete the link, and move the /usr.backup back and reboot and
   try again.

This works great for minor directories -- but I've never tried it on
system directories. Should be the same though... It is important that
you create the link immediate after moving the /usr directory. you
can even make it a single command by:

    mv usr usr.backup; ln -s <?> usr

Messing with your primary drives and directories is always risky.
Have a boot disk handy -- and if you have a tape drive, backup first!
At least save any critical files that are not already on disk or
tape before doing this.

Good luck.

>
>This is dangerous, so be careful. :)
>
>A simple way to approach it would be to partition the drive so that
>you
>have a partition for every large directory you want to move and
>create
>ext2 filesystems on each. After that is done, temporarily mount the
>partitions under /mnt and copy the corresponding directory to each.
>After that (for safety's sake), mv /usr to /oldusr (or some other
>temporary name) just so it's out of the way and easy to delete later
>(but you can get it back if something goes bad). Then mkdir /usr and
>modify /etc/fstab so that the ext2 filesystem for /usr (say
>/dev/hdb2
>maybe) is mounted at /usr. Then mount it. Do it for all the other
>directories and mount them. Then, try to use the system. If it
>works,
>reboot and see if it still works. If so your changes are done. I
>would
>leave it run for a few days before deleting all the /old* directories
>and
>realizing your dream of extra elbow-room (disk-wise).
>
>Another approach would be to do this with one directory and use
>symlinks, but that's kind of messy and might not work well for you.
>
>I would certainly appreciate anyone pointing out errors in my
>methods
>or offering constructive criticism, or anything that isn't clear
>(though I
>know these instructions are anything but explicit). :)
>
>Happy day to you all,
>Troy Johnson
>
>>>> Perry Hoekstra <dutchman@mn.uswest.net> 07/15 1:43 PM >>>
>Different machine, different topic...
>
>My Linux machine at work was running out of space so I added a second
>hard
>drive.  I have it formatted to ext2.  Now I would like to mount it
>and move
>some of my larger directories over to it like /usr.  I am kind of
>clueless
>on how to do this.  Would I copy over my /usr directory to /dev/hdd
>and
>then create a mount point for /usr and add it to my fstab file?
>
>Perry Hoekstra
>


______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com