LinHES Forums
http://forum.linhes.org/

migrate system to a larger HD
http://forum.linhes.org/viewtopic.php?f=1&t=4599
Page 1 of 1

Author:  graysky [ Mon May 16, 2005 2:18 pm ]
Post subject:  migrate system to a larger HD

I'd like to migrate my system from its current 160 gig drive to a 320 or 400 in the near future. Unless I'm mistaken, I can run mythbackup on the old drive, copy those files plus /myth to the new drive and do a myth restore. Has anyone done this before? If so, what process worked best for you (i.e. clean install on the new drive and migrate the files over)?

Currently running R5A15.1

Thanks all.

Author:  cesman [ Mon May 16, 2005 2:56 pm ]
Post subject: 

Yes, what you describe will work. Yes, it has been done before. As far as which process worked best, you're not giving us as second option to compare against. Various ways of do this has been discussed on the forum before....

Author:  ceenvee703 [ Mon May 16, 2005 3:03 pm ]
Post subject: 

If you have room in your case for a second hard drive, I would just add the new larger hard drive as a slave and use LVM to get both drives working together. That way you could use the space on your old 160 as well as the new space.

There are good docs on the wiki on how to use LVM.

Author:  graysky [ Mon May 16, 2005 3:17 pm ]
Post subject: 

Thanks for the quick replies. I actually have a use for the old drive, so after the transfer, it'll be out of the case. I'll go the mythbackup route. I'm not a real LINUX guru so it'll probably be painful. Here's the process as I see it:

1. install new drive/unplug old drive
2. install/setup r5a15.1 on new drive
3. add old drive and mount to something like /old
4. copy mythbackup files to new dir structure
5. copy old myth contents to new drive (is it as simple as: $ mv /old/myth /myth)?

Does that seem reasonable?

Thanks again.

Author:  Liv2Cod [ Mon May 16, 2005 5:31 pm ]
Post subject: 

If it were me, I think I'd put the new disk in and do a fresh install. Then I'd stick in the "old" disk as a second drive and copy the contents of its /myth partition to the new drive. Then I'd do a "mythrestore", pull out the old drive again, and all's well. Heck, you could probably even put the old disk in a USB2.0 enclosure to copy its /myth partition.

This approach has the advantage that at any point you can punt and put in the old drive again. Nothing on it is touched until you re-purpose it in your next computer.

Author:  graysky [ Mon May 16, 2005 6:24 pm ]
Post subject: 

OK... sounds like a plan. Thanks for the input.

Author:  graysky [ Thu May 26, 2005 2:52 pm ]
Post subject: 

If Airborne Express comes on time, I'll be trying this on new drive this weekend. I'll post in this thread once it's complete.

Author:  graysky [ Fri May 27, 2005 4:40 pm ]
Post subject: 

Cool... the R5A15.1 install on the new 320 gig drive went flawlessly (thanks again Cesman and Dale). Now I'm at a point where I have connected the old drive as a slave and would like to copy over the files and run mythrestore.

I mounted the drive like this (please be nice since I'm pretty new at using LINUX):

Code:
# mount /dev/hdb4 /old


That successfully placed the old drive's /myth to the new drive's /old

Now, I'm just planning to manually copy the contents of /old/tv /old/backup and /old/video over to the /myth/tv /myth/backup and /myth/video


:EDIT:

Ran mythrestore and everything worked great!

Author:  kebe [ Mon May 30, 2005 6:32 am ]
Post subject: 

For future reference, an easy way to copy a directory tree is

Code:
cp -a source destination


or in this case

Code:
cp -a /old /myth


The -a means "archive" which tells cp to:
    copy all files recursively (all subdirectories);
    preserve all symlinks, but not follow them; and
    preserve file ownership and time stamps.

Author:  graysky [ Mon May 30, 2005 7:41 am ]
Post subject: 

Thanks for the tip, Kebe. I saw those switches in the man page, but doing each of the dirs separately was the safest bet for me :)

Author:  tjc [ Mon May 30, 2005 9:14 am ]
Post subject: 

The old Unix portability stand-by for this is:
Code:
(cd source_dir ; tar cf - *) | (cd dest_dir ; tar xvf -)

There are any number of ways to do this on more modern systems using "cp -a", "rsync -av", ... but the "tar trick" is one that works pretty much everywhere.

Author:  brendan [ Mon May 30, 2005 12:34 pm ]
Post subject: 

tjc wrote:
The old Unix portability stand-by for this is:
Code:
(cd source_dir ; tar cf - *) | (cd dest_dir ; tar xvf -)

There are any number of ways to do this on more modern systems using "cp -a", "rsync -av", ... but the "tar trick" is one that works pretty much everywhere.


Does `tar cf - *` automatically include dotfiles (hmmm...I guess my concern is the top level directory of that subtree)?

-brendan

Author:  tjc [ Mon May 30, 2005 4:41 pm ]
Post subject: 

No it doesn't, but that's trivial to fix by using "tar -cf .* *" or "tar cf ." if you have dotfiles to worry about.

Author:  khrusher [ Mon May 30, 2005 6:00 pm ]
Post subject: 

Quote:
No it doesn't, but that's trivial to fix by using "tar -cf .* *" or "tar cf ." if you have dotfiles to worry about.


dont forget the hyphen

tar -cf - .* *

Author:  tjc [ Mon May 30, 2005 11:16 pm ]
Post subject: 

Sigh... My bad... For one that gets dot files too, use:
Code:
(cd source_dir ; tar cf - .) | (cd dest_dir ; tar xvf -)

Serves me right for tossing out an answer without thinking... :(

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/