Operating System - HP-UX
1751947 Members
4893 Online
108783 Solutions
New Discussion юеВ

Move /usr back to internal disks

 
SOLVED
Go to solution
Dan Matlock_1
Regular Advisor

Move /usr back to internal disks

I just found one of our older K boxes has /usr on a SAN. I want to move it back to internal....

1. tar -cvf - /usr/* | (cd /usr_new/; tar -xvf -)
2. change fstab and reboot

Will this work?
6 REPLIES 6
Adisuria Wangsadinata_1
Honored Contributor
Solution

Re: Move /usr back to internal disks

Hi,

You can try the following steps :

NOTE : do the necessary backup first (Ignite backup is recommended)

1. goto single user mode
2. create the lvol for /new_usr
3. copy over the contain at /usr to /new_usr

# fbackup -i /usr -f - | (cd /new_usr; frecover -Xrf -)

4. umount /usr and umount /new_usr
5. mount the prev lvol for /new_usr to /usr
6. reboot the system
7. check whether the system can up & running without any problem
8. put the system into monitoring for some period
9. if the system fine, you can safely remove the prev lvol for /usr (the old one)

Hope this information can help you.

Cheers,
AW
now working, next not working ... that's unix
Adisuria Wangsadinata_1
Honored Contributor

Re: Move /usr back to internal disks

Hi,

Before you reboot the system, dont forget to change /etc/fstab to reflect the changes.

Cheers,
AW
now working, next not working ... that's unix
Dan Matlock_1
Regular Advisor

Re: Move /usr back to internal disks

still working the issue, the 'tar' option killed a test srv...
Dan Matlock_1
Regular Advisor

Re: Move /usr back to internal disks

Didn't quite work right..... It created a usr dir. under /new_usr/usr.
Howard Marshall
Regular Advisor

Re: Move /usr back to internal disks

What I would do is create the new_lv and file system for /usr where ever you want it. Create a temporary mount point /newusrmnt and mount new_lv to /newusrmnt

Then use cpio to copy the files from one to the other

Cd /usr
Find . -xdev -print | cpio -pdxamv /newusrmnt

When that├в s done change /etc/fstab to mount new_lv on /usr reboot

The -xdev is important if you have any file systems mounted under /usr

If you can get down time it may be best to do the find and cpio in single user mode but if you can't it should work OK any way as long as you don't have weeks between the copy and the reboot

After the reboot you can mount /old_lv to /oldusrmnt and get anything that was missed

When your sure the system is back drop the old_lv and its miller time.
Florian Heigl (new acc)
Honored Contributor

Re: Move /usr back to internal disks

*cough*

is Your /usr still in /dev/vg00? if yes, please simply use pvmove.

otherwise Your plan will work fine, but I'd run it in singleuser or lvm maint. mode to be 100% sure of consistency.
yesterday I stood at the edge. Today I'm one step ahead.