- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Moving a filesystem to an seperate LV.
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-31-2006 12:54 AM
тАО01-31-2006 12:54 AM
Moving a filesystem to an seperate LV.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-31-2006 01:00 AM
тАО01-31-2006 01:00 AM
Re: Moving a filesystem to an seperate LV.
You could use 'cpio' or 'tar' easily:
# cd srcdir && find . -depth -print | cpio -pudlmv dstdir
# cd srcdir && tar cf - . | ( cd dstdir && tar xpf - )
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-31-2006 01:03 AM
тАО01-31-2006 01:03 AM
Re: Moving a filesystem to an seperate LV.
Why not use cp.
grtz. Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-31-2006 01:04 AM
тАО01-31-2006 01:04 AM
Re: Moving a filesystem to an seperate LV.
Create a new logical volume and mount it on mnt
# cd /var/xxx
# find . | cpio -pcmudv /mnt
# rm -r /var/xxx
# mkdir /var/xxx
# umount /mnt
mount the new filesystem on the /var/xxx mount point and add this to the /etc/fstab.
You will have to be sure that there are no open files inside this /var/xxx directory.
Hope this helps,
Robert-Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-31-2006 01:37 AM
тАО01-31-2006 01:37 AM
Re: Moving a filesystem to an seperate LV.
Dear Mitchell,
1. If the other filesystem (destination) is already UP then you can use "cp" itself.
1a. mount the new f/s in a temp_mountpint
1b. use #cp -R -p
( The -p option preserves the permissions
1c. umount both existing&temp_mnt and mount the new f/s in the reqd mountpoint or make necessary changes in /etc/fstab and reboot the server.
Otherwise
2. use #tar -cvf /dev/rmt/0m /
and use #tar -xvf to restore back in the new lv.
With Regards,
Siva.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-31-2006 01:58 AM
тАО01-31-2006 01:58 AM
Re: Moving a filesystem to an seperate LV.
Use CP or CPIO for doing that.
Also note, /var has few mounted file systems like /var/adm/crash etc, so if you do a find use -nodepth option.
Finally note that /var is required by system, so ensure that it is also mirrored to resolve a Single point failure.
Chan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-31-2006 02:00 AM
тАО01-31-2006 02:00 AM
Re: Moving a filesystem to an seperate LV.
vxdump 0f - /var|(cd /destfs;vxrestore rf -)
Others:
CPIO:
cd /var;find ./ -depth -print|cpio -pdvmu /destdir
DD: Fastest (assuming destination LV is sized exactly as source - do prefrably in single user mode):
dd if=/dev/vg00/rlvolX bs=4096 of=/dev/vgXX/rlvolX
(where rlvolX is the raw LVOL name of your /var if you use regular LV names, rvar if using named LVOLS. Destivation LVOL should not be mounted. Also, fsck the destination LVOL after the dd is done.)
HTH.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-31-2006 02:12 AM
тАО01-31-2006 02:12 AM
Re: Moving a filesystem to an seperate LV.
/var is a system area and why do you want to move data to another file system instead of extending the file system online.
If you must, you may have to be on single user level for some directory. can we know the specific directory you plan to move.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-31-2006 02:14 AM
тАО01-31-2006 02:14 AM
Re: Moving a filesystem to an seperate LV.
Use tar in a pipeline to copy the entire file system hierarchy under fromdir to todir:
cd fromdir ; tar cf - . | ( cd todir ; tar xf - )
This works fine, from my personel experience.
Rgds,
Ajit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-31-2006 02:18 AM
тАО01-31-2006 02:18 AM
Re: Moving a filesystem to an seperate LV.
Moreover, generally the entire /var filesystem is not moved but rather directories beneath var are given their own mountpoints (e.g. /var/spool, /var/mail, /var/tmp, /var/adm/sw, /var/opt/omni --- depending upon your applications and needs). It's so easy to fill up /var/spool that it is an extremely good candidate for its own filesystem. Fill up /var/spool is really no big deal -- lp may break but filling up /var can kill your entire system.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-31-2006 02:26 AM
тАО01-31-2006 02:26 AM
Re: Moving a filesystem to an seperate LV.
brief steps if you must mv directory.
make new file systems and mount on junk
mkdir /tmp/junk_new
mount /dev/vg00/lvol?? /tmp/junk_new
Move to your source files
cd /var/junk_old
tar cvf - *|(cd /tmp/junk_new; tar xvf -)
above would tar the files from /var/junk_old and dump them on /tmp/junk_new
after confirming the files are the same, then follow the next step
Hopefully, the files system or files you plan to move are those that could be moved withput an outage.
If the directory is a file system, try to mount, if it does then you may be ok. If not you might need to be on single user level before you can do that or maintenance level.
If it is a dirctory, if it is in use it could be difficult to mount on.
Let us knowthe directory in question.