Operating System - HP-UX
1820201 Members
3791 Online
109620 Solutions
New Discussion юеВ

Migrate Old FileSystem to new FIleSystem

 
SOLVED
Go to solution

Migrate Old FileSystem to new FIleSystem

Currently, this is my FS look like.

# bdf
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 204800 140128 64560 68% /
/dev/vg00/lvol1 298928 214936 54096 80% /stand
/dev/vg00/lvol8 4710400 4426560 28215294% /var
/dev/vg00/lvol7 2244608 1305632 93166458% /usr
/dev/vg00/lvol4 204800 8912 194576 4% /tmp
/dev/vg00/lvol6 2727936 2418512 30704889% /opt
/dev/vg00/lvol5 24576 2336 22072 10% /home
/dev/vg01/lvol1 18432000 14461856 3924392 79% /db
/dev/vg01/lvol2 16384000 11346282 4894200 70% /app
/dev/vg02/lvol1 46080000 3680 45716360 0% /db1
/dev/vg02/lvol2 24576000 19035464 5454008 78% /app1

I want to copy out all content in /db FS to the new /db1 FS. How can i do this? tar? cpio?
in /db contains the oracle db server daemon, so after copyying all the files, how can i mount back /db1 as /db?

I'm seeking guru's help as i'm new in HP-ux.
11 REPLIES 11
Peter Godron
Honored Contributor

Re: Migrate Old FileSystem to new FIleSystem

Mohd,
please have aread of thread:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=786133

In summary:
Copy old filesystem to the new filesystem (via tar, cpio or cp -pr)
Then edit the fstab file to rename the mount point.
Robert-Jan Goossens
Honored Contributor
Solution

Re: Migrate Old FileSystem to new FIleSystem

Hi,

# cd /db
# find . -xdev | cpio -pcmudv /db1

# umount /db
# umount /db1
change the /etc/fstab
/dev/vg02/lvol1 ... /db
and remove the line
/dev/vg01/lvol1 ... /db
# mount /db

Regards,
Roert-Jan
Antonio Cardoso_1
Trusted Contributor

Re: Migrate Old FileSystem to new FIleSystem

Hi

If you can stop the applications during operations, this could be done by:
- backup to tape (e.g. dump, fbackup)
- restore to new device (e.g. restore, frecover)
- umount /db
- mount /dev/vg02/lvol1 /db

Another way, (possibly on-line if using On-line JFS), would be to extend /dev/vg01, /dev/vg01/lvol1, /db instead of moving to a new vg.
consider lvextend, fsadm commands for that.

antonio.

Re: Migrate Old FileSystem to new FIleSystem

Hi Robert,
I'm thinking of using ur method. In this case, can i use these cmd?
# cd /db
# find . ├в depth |cpio ├в pvd /db1
then, in fstab can i swap the mountpoint for /db to /db1 and /db1 to /db? like this:
/dev/vg01/lvol1 18432000 14461856 3924392 79% /db1
/dev/vg01/lvol2 16384000 11346282 4894200 70% /app
/dev/vg02/lvol1 46080000 3680 45716360 0% /db
Robert-Jan Goossens
Honored Contributor

Re: Migrate Old FileSystem to new FIleSystem

Hi Mohd,

find . ├Г┬в├В ├В depth |cpio ├Г┬в├В ├В pvd /db1
It is a bit difficult to read your command options, use the -u and the -m too otherwise your file dates will be changed.

I normaly use
find . | cpio -pcmudv


can i swap the mountpoint for /db to /db1 and /db1 to /db?
Yes you are correct.

Robert-Jan

Re: Migrate Old FileSystem to new FIleSystem

ok, sorry for the unreadable cmd.

it should look like this
#find .-depth |cpio -pvd /db1

so for safety, i should execute this cmd
#find .-depth |cpio -pvdmu /db1

and 1 more thing, if i want to change the /db1 mount point to other name, can i just simply change it in fstab? for example
change the name /db1 mountpoint to /newfs mountpoint?
Robert-Jan Goossens
Honored Contributor

Re: Migrate Old FileSystem to new FIleSystem

Your /etc/fstab should look similar to below output.

before change:
/dev/vg01/lvol1 /db vxfs largefiles,rw,suid 0 2
/dev/vg02/lvol1 /db1 vxfs log,nodatainlog,largefiles,rw,suid 0 2

after change:
/dev/vg01/lvol1 /db1 vxfs largefiles,rw,suid 0 2
/dev/vg02/lvol1 /db vxfs log,nodatainlog,largefiles,rw,suid 0 2

Just don't forget to unmount the filesystems :-)

so umount -> change fstab -> mount

Best regards,
Robert-Jan
Baiju Kumar.B_1
Advisor

Re: Migrate Old FileSystem to new FIleSystem

dear dollah,
first shutdown the oracle databae
then take the backup of /db from root
#tar -cvf ./db
then
#umount /db
#umount /db1
#vi /etc/fstab

change the mount point of /dev/vg02/lvol1 from db1 to db

and comment (put one# in front of /dev/vg01/lvl1 entry)
and save the modified /etc/fstab

#mount -a

and
restore thae backup from tha tape using tar-xvf

up the oracle database

please enable all the largefiles support options in /etc/fstab

regards
Baiju Kumar.B

nothing is impossible

Re: Migrate Old FileSystem to new FIleSystem

Hi, consider that i dont have any tape backup, is it safe for me to do the cpio cmd?
James R. Ferguson
Acclaimed Contributor

Re: Migrate Old FileSystem to new FIleSystem

Hi:

I'd much rather do a disk-to-disk copy than disk-to-tape-to-disk copy. It's faster and less likely to have errors.

I've used the 'cpio' method many times to migrate data from one set of disks to another as Robert-Jan shows.

Regards!

...JRF...
Tom Henning
Trusted Contributor

Re: Migrate Old FileSystem to new FIleSystem

One comment/possible gotchya in Robert-Jan's post:

From his post:

# cd /db
# find . -xdev | cpio -pcmudv /db1

# umount /db


You will need to do a cd in between the find command and the umount commands, since you will not be able to umount the filesystem you are currently working out of.

Also, if there are any open files on either filesystem the umount commabnds will not work, so you might have to use the fuser command if the umount commands fail to determine what processes are still using the filesystem.
What is it that possesses otherwise sane individuals to change something just because it has not been changed in a while?