move data to larger drive

Timothy Payne tim at tmpco.com
Sat Sep 25 23:49:44 UTC 2004


Wow! A bit more than I bargained for but I think I can make it work.  
Before I jump into this head first, since I'm from the shallow end of
the gene pool, if I make my old drive a slave and boot from the new FC2
drive will grub give me the option to boot from the old drive and
kernel?  I may find after about a week or so my old drive is full of
stuff I never use, and I can just reboot or do the whole copy over to
the new drive thing.

If I put a really large magnet under the new drive and stack the old
drive on top, won't it just pull the data down into the new drive?  Now
is the time to hum the tune from the movie Deliverance"Squeal Boy"

Thanks for the help, you've been printed Tim...

On Sat, 2004-09-25 at 10:31, Keith Lofstrom wrote:
> Timothy Payne writes:
> > I have a machine running RH 7.3 but the disk is about full.  I would
> > like to move the data to a larger drive then upgrade that drive with FC2
> > keeping the original drive intact so I can just plug it back in if
> > things go wrong.
> 
> The first thing to do is to document the partitions you are using now,
> on your current drive, with (as root):
> 
> sfdisk -d /dev/hdX > sfdisk.hdX
> 
> Where hdX is your drive, probably hda .  Then look at the ascii file
> sfdisk.hdX .  Note, you can edit this file and pipe it into the sfdisk
> command to build your new disk.  I recommend this, as it makes tweaking
> sizes a lot easier.
> 
> Also do a "df" and a "df -i".  Get all that information on paper.
> 
> This is your opportunity to resize things, both larger and smaller.  
> If you have lots of little partitions, you might decide to merge some
> of the partitions on the new disk. 
> 
> 
> If you build the new disk with identically-sized partitions to the old
> disk, you can use dd to copy the partitions over, for example:
> 
> sync ; dd if=/dev/hda2 of=/dev/hdb2 bs=1M 
> 
> You can later resize them with parted .  So you could build the new
> disk with identically sized partitions with large gaps in between, 
> and use parted to expand the partitions into the gaps.  When you
> use dd this way, you don't even need to do a mkfs for the target
> partition.  However, you should do this in single user mode
> [run level 1] on unmounted partitions, and do a fsck afterwards. 
> This is as fast as a disk copy gets.
> 
> However, it is better to build the new partition with mkfs, and
> then copy the files.  This is slower but gives you more control. 
> You can also change file systems, for example ext2 to reiserfs3.6
> ( 4 is in dispute ) .   While some don't trust reiserfs, it does make
> more efficient use of the disk, and is usually faster than ext2/3 .
> 
> You can copy files with:
> 
>    mkdir /newdisk/newdir
>    cd    /olddisk/olddir
>    sync ; cp -a * .* /newdisk/newdir
> 
> This will transfer all the directories, files, and special files,
> though symbolic links will get their dates changed.  If you don't
> have much RAM, and the directories are big, you may want to do the
> copy in smaller chunks.  cp builds tables of copied file info in
> RAM, and when the tables get large it starts thrashing swap, slowing
> the copy down a lot.
> 
> You should do copying in single user mode, after a sync to write out
> buffers to the disk.  You probably can get by without the sync, but
> I am a superstitious old Unix geezer and believe this is a good habit.
> 
> Rather than typing all these commands in from the command line, you
> should put them in shell scripts.  That makes mistakes easier to
> catch, and if a mistake still slips by, you can correct and replay
> the entire session automagically.  You can also post the script in
> your next boo-hoo message to this list, making it more likely that
> we can spot your mistakes. 
> 
> MAKE ABSOLUTELY SURE that the target drive is your new drive, not
> your old one.  Read the man pages until they are burned into your
> brain; you can easily wipe out a lot of good data if you get drive
> or file order wrong in some of the above commands.
> 
> I hope that helps.  More experienced folk, please post errors in
> the above, and I will repost a corrected version in a few days. 
> No sense letting the archive fill with uncorrected nonsense.
> 
> Keith
> 
> 
> 
> -- 
> Keith Lofstrom          keithl at keithl.com         Voice (503)-520-1993
> KLIC --- Keith Lofstrom Integrated Circuits --- "Your Ideas in Silicon"
> Design Contracting in Bipolar and CMOS - Analog, Digital, and Scan ICs
> 





More information about the fedora-list mailing list