[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Copy entire /usr



On Fri, Sep 12, 2008 at 08:15:04AM +0200, Raven wrote:
> Hi all.
> I am in a sticky situation. I run remotely a server and one of the disks
> is starting to fail.

Sticky indeed.

> Every couple days (or more, depends on the www traffic level) scsi drive
> sdc fails (with "rejecting I/O to device bla bla bla"). This a BIG
> problem because my /usr resides on sdc1, and everytime it happens I have
> to send somebody to kill the server and restart it.

You can do this without rebooting, I think.

> 
> I figured, since I do not have physical access to the server, that the
> best choice would be copying the whole /usr to another drive and (hoping
> there are no problems while copying) change the required stuff in fstab.
> 
> Before starting blindly cp'ing files, I would like to hear your advice
> on the process and if I have any chance of succeeding (or if you have
> another method that would work better)

Example: assume /usr is the only thing on /dev/sdc1,
/dev/sdd1 (or some partition on another disk) has enough space available for
the /usr directory, and is formatted.

Do: ~# mount /dev/sdd1 /mnt
    ~# mkdir /mnt/usr
    ~# cp -ax /usr/* /mnt/usr/
    ~# umount /dev/sdd1

Edit your /etc/fstab to reflect the new location of /usr, i.e.:

/dev/sdc1       /usr            ext3    defaults,nodev 0 2

would now read:

/dev/sdd1       /usr            ext3    defaults,nodev 0 2

Then do: ~# mount -o remount /usr

Then check the transition with:

    ~# cat /proc/mounts

You should see the new partition mounted at /usr.  Then you can retire your
faulty disc. 

Regards,
Dave

--

Thasai, Ampoe Meuang |       Linux is addictive, I'm hooked!
Nonthaburi           |           -- MaDsen Wikholm's .sig
Thailand	     |

Attachment: signature.asc
Description: Digital signature


Reply to: