1833750 Members
2364 Online
110063 Solutions
New Discussion

move /opt to a lvol

 
mineismine
New Member

move /opt to a lvol

Hi,
/opt is under / mountpoint. I would like to create a logical volume for /opt to be separated from /
Could you please tell me if I am wrong regarding the procedure below ?
1) boot in single user mode
2) lvcreate -L 5000 -n lvol9 /dev/vg00
3) newfs -F vxfs -o largfiles /dev/vg00/lvol9
4) mkdir /new_opt
5) mount /dev/vg00/lvol9 /new_opt
6) cd /opt
7) find . -print | cpio -pdl /new_opt
8) mv /opt /old_opt
9) umount /new_opt
10) rmdir /new_opt
11) mkdir /opt
12) mount /dev/vg00/lvol9 /opt
13) update /etc/fstab
Best Regards
Eric
7 REPLIES 7
Michael Steele_2
Honored Contributor

Re: move /opt to a lvol

Hi, uh, lets do this instead
7) cp -p -r /opt/* /new_opt
8) OK
9) mv /new_opt /opt
10) not needed
11) not needed
12) not needed, already mounted under 5 and 8
13) yep

Once you rename new_opt to opt you're mounted to lvol9, right?
Support Fatherhood - Stop Family Law
mineismine
New Member

Re: move /opt to a lvol

So the procedure would be
1) boot in single user mode
2) lvcreate -L 5000 -n lvol9 /dev/vg00
3) newfs -F vxfs -o largfiles /dev/vg00/lvol9
4) mkdir /new_opt
5) mount /dev/vg00/lvol9 /new_opt
6) cd /opt
7) cp -p -r /opt/* /new_opt
-> Could you please confirm that there won't be a problem with symlinks ?
8) mv /opt /old_opt
9) mv /new_opt /opt
-> as /new_opt is a mountpoint, don't you think it is necessary to umount and create a new mountpoint ?
10) update /etc/fstab
Thx
TTr
Honored Contributor

Re: move /opt to a lvol

> 9) mv /new_opt /opt

You can't rename mountpoints. The original steps were perfectly fine.
Raj D.
Honored Contributor

Re: move /opt to a lvol


> as /new_opt is a mountpoint, don't you think it is necessary to umount and create a new mountpoint ?


AS in your command you moved /opt to /old_opt , you need to create one directory : # mkdir /opt
- Then you can mount it in /opt.

- -r option copies the symbolic links as well.


Cheers
Raj.

" If u think u can , If u think u cannot , - You are always Right . "
TTr
Honored Contributor

Re: move /opt to a lvol

How about (using your original steps)...
1. OK
2. OK
3. OK
4. mv /opt /old_opt
5. mkdir /opt
6. mount /dev/vg00/lvol9 /opt
7. mv /old_opt/* /opt (ensure there are no .files (dot-files) in /old_opt)
8. rmdir /old_opt
9. update /etc/fstab
mineismine
New Member

Re: move /opt to a lvol

Thanks to all of you ;-)
Michael Steele_2
Honored Contributor

Re: move /opt to a lvol

And thank you, but here, you say thanks by assigning points
Support Fatherhood - Stop Family Law