The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > SUN Solaris
Google UNIX.COM


SUN Solaris The Solaris Operating System, usually known simply as Solaris, is a free Unix-based operating system introduced by Sun Microsystems .

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
copying/moving partition antalexi SUN Solaris 4 11-11-2006 02:59 PM
Moving the root partition (simple fstab / grub question) d11wtq UNIX for Dummies Questions & Answers 6 06-10-2005 11:50 AM
Moving AutoRaid array to another system ranias HP-UX 3 05-29-2003 05:04 AM
moving a file? Holistic UNIX for Dummies Questions & Answers 1 02-20-2003 03:47 PM
moving space from one partition to another jason6792 UNIX for Advanced & Expert Users 4 10-08-2001 03:54 PM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-30-2006
Registered User
 

Join Date: Nov 2006
Posts: 36
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
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 11-30-2006
blowtorch's Avatar
Supporter
 
Join Date: Dec 2004
Location: Singapore
Posts: 2,323
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).
Reply With Quote
  #3 (permalink)  
Old 11-30-2006
Registered User
 

Join Date: Nov 2006
Posts: 36
Smile 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
Reply With Quote
  #4 (permalink)  
Old 11-30-2006
reborg's Avatar
Administrator
 
Join Date: Mar 2005
Location: Ireland
Posts: 3,502
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 04:25 PM.
Reply With Quote
  #5 (permalink)  
Old 12-03-2006
Registered User
 

Join Date: Nov 2006
Posts: 252
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.

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.

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.

Last edited by sparcguy; 12-03-2006 at 03:44 AM.
Reply With Quote
  #6 (permalink)  
Old 12-03-2006
Registered User
 

Join Date: Dec 2005
Posts: 65
It cant be done using if of ?
Reply With Quote
  #7 (permalink)  
Old 12-03-2006
Registered User
 

Join Date: Nov 2006
Posts: 252
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.
Reply With Quote
Google UNIX.COM
Reply

Tags
cpio

Thread Tools
Display Modes




All times are GMT -7. The time now is 04:22 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0