Moving a file system to a new partition


 
Thread Tools Search this Thread
Operating Systems Solaris Moving a file system to a new partition
# 1  
Old 11-30-2006
Moving a file system to a new partition

Hi everybody. My task today is to move my file system that's 98% full to a new partition slice.
I think I'm pretty sure how to do it, but I just wanted to make sure, plus it's been a while since I last did one. The Let's say I have 2 disks c0t0d0 & c0t1d0 ...the file Iwant to move is in c0t0d0s5 & I have a space in c0t1d0s6.
1) When I do format, do I modify c0t1d0.
2) After creating a new slice, I do newfs on the new slice ???? correct?
3) mount the new slice on /tempoary mount point
4) cd to old file
5) tar cf-* |(cd /newmount point; tar xvBpf-)
6) cd .. , unmount /old file , unmount new
7) mount /dev/dsk/c0t1d0s6 /old file name
8) edit /etc/vfstab to refelct new disk & mount point.

The tar part of it is what I'm mostly concern about....Is this right.

Thanks
Rems
# 2  
Old 11-30-2006
You've got that right. Just a couple of things:
step 5: in the tar extraction, do you really need the B switch? I don't think so.
step 8: in the /etc/vfstab you just have to change the /dev/dsk part of the entry that already exists for the current mount point (because you are not going to change the name of the filesystem after you do the copy).
# 3  
Old 11-30-2006
Bug Moving a file system to a new partition

I just finished the task ...............Thank God it was successful.

Thank you also for the comment.

Remi
# 4  
Old 11-30-2006
This is merely an observation.

The use of tar in this way is risky if you have long full pathnames. ufsdump & ufsrestore or cpio would in general be better tools to use.

Last edited by reborg; 12-03-2006 at 08:25 PM..
# 5  
Old 12-03-2006
I can't remember which OS versions but it seems from time to time when you check sunsolve ufsdump and ufsrestores have a lot of bug issues. I believe tar previously also has some issues like copying of softlinks but generally much less. I prefer using tar to ufsdump/ufsrestore due to some bad experience. Smilie

I recall years ago we did a filesystem migration for an telecom customer, we were quite inexperienced at that time but even then it was a very simple migration job. The migration called for moving his webserver folder from one filesystem to another we used ufsdump | ufsrestore command.

For a 2 GB filesystem It took nearly from midnite when they shutdown the apps till past 9am in the morning, we overshot the downtime window by over 3hrs. And after that the webapplication somehow could not work and require a further 3 more hours of troubleshooting to finally realise what was happening to get it working again. meantime the customer's website was down, There was hell of explaining to the customer as we stood there at the aftermath in the meeting room while their senior managers each took turns grilling us until they were satisfied on how such a simple migration took so long and went horribly wrong. Smilie

That folder contained apart from the applicaitons, there was also over 300,000 cookies each no larger than 2k, the ufsdump was very fast it was the ufsrestore that took hours because for each of the 300k files that we restored using ufsrestore it will first create a file inode for each cookie file before doing any restore so it took nearly 4-5 hours just to create the inodes for all 300,000 files before any physical restore could begin. And after it was restored some of the permissions and file ownerships changed.

I think if we used tar it would have been over pretty quickly, I will never forget that experience. Smilie

Last edited by sparcguy; 12-03-2006 at 07:44 AM..
# 6  
Old 12-03-2006
It cant be done using if of ?
# 7  
Old 12-03-2006
Quote:
Originally Posted by XP_2600
It cant be done using if of ?
you mean using

dd if=/dev/rdsk/c0t0d0s5 of=/dev/rdsk/c0t1d0s6

we not really certain here if both c0t0d0 and c0t1d0 are single disk or lun's and part of hardware raid volume or not. If they are lun it will not work.

DD normally we do it for single disk to disk. But you could also be correct in using DD for the remi's migration.

In the case of my migration for the telecom customer, his folder was sitting on a old clariion disk storage system which runs hardware raid, so dd could not be used.

anyway be very careful abt using things like dd, one mistake in placing the wrong disk in the "if" you can say bye bye to your data. Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Solaris

Moving a zone path to a new file system

Hello Gurus, I need your help with this please. I am trying to move a zone to a new directory but it keeps failing. Below is what I did and the message I get. Your help will be appreciated. Thanks zoneadm -z testzone move /rpool/testzone cannot create ZFS dataset rpool/testzone: dataset... (1 Reply)
Discussion started by: cjashu
1 Replies

2. Solaris

System partition backup

Dear All, I am using solaris 9,I want to take the backup all the partition of my system 1 by 1 and put it into tape device. Below is the df -kh output Filesystem size used avail capacity Mounted on /dev/md/dsk/d1 11G 3.4G 7.9G 31% / /dev/md/dsk/d6 ... (4 Replies)
Discussion started by: monojcool
4 Replies

3. Solaris

Moving disk partition from Solaris sparc to x86

Hello Gurus, Im trying to migrate some SAN disks from sparc server to X86 one, and having issues with disks not getting mounted on the X86 server with " not this fstyp error" due to the different partitions lay out between the two OS. I have tried it from sparc to sparc server and it worked,... (10 Replies)
Discussion started by: aladdin
10 Replies

4. Solaris

Increase root partition by moving starting cylinder

I am trying to expand the root partition on Solaris 10. I can expand root partition using format/partition command, but usually increasing cylinders on partition is done on back end. In this case I would have to expand from the front end following the table below, meaning I would have to move the... (12 Replies)
Discussion started by: mjaminal
12 Replies

5. BSD

Moving /var partition to USB stick

I am currently running DesktopBSD as a live-CD and need to have a large /var partition because it is currently too small. I have a USB stick which is BSD formatted, and would like to have the /var partition moved over to it. How can this be done? Could I for instance use a symlink? (1 Reply)
Discussion started by: figaro
1 Replies

6. Solaris

copying/moving partition

I have a slice on a 72GB hard drive like this (example): /dev/dsk/c0t1d0s0 51424287 51009 50859036 1% /usr/stuff that I need to copy or move to a slice on a MUCH larger slice like this: /dev/dsk/c0t2d0s6 70592505 570236 69316344 1% /usr/newstuff What is the... (4 Replies)
Discussion started by: antalexi
4 Replies

7. HP-UX

Moving AutoRaid array to another system

Hi All, I'm trying to move a disk array installed to one server has HPUX 11.0 to another server with the same OS version. But how can I make the other server recognize the disks with all the volume groups and logical volumes I have created. Please advice. Thank you. :) (3 Replies)
Discussion started by: ranias
3 Replies

8. UNIX for Advanced & Expert Users

moving space from one partition to another

How can I move some space allocated to one partition to another, i.e. from "/var" to "/" . Thanks! (4 Replies)
Discussion started by: jason6792
4 Replies
Login or Register to Ask a Question