View previous topic :: View next topic |
Author |
Message |
MehdiYM Tux's lil' helper
Joined: 13 Apr 2003 Posts: 82 Location: France
|
Posted: Sat May 31, 2003 7:58 am Post subject: Moving installed Gentoo from a partition to another |
|
|
Is it possible to move easily an installed Gentoo from a partition to another, precisely from a HDD to another ?
Can I copy all files with a
Code: | # cp -r / /mount_point |
then modify /etc/fstab ?
and what about /proc, /dev, .... ? |
|
Back to top |
|
|
iwasbiggs Apprentice
Joined: 17 Jan 2003 Posts: 203
|
Posted: Sat May 31, 2003 8:23 am Post subject: |
|
|
if you're just trying to mirror stuff, and you have another partition of similar size (and plan on swapping the disks), I would just use dd if=/dev/old of=/dev/new
Then double check /etc/fstab and your boot stuff. _________________ www.ruinedsoft.com
Freeware development. |
|
Back to top |
|
|
MehdiYM Tux's lil' helper
Joined: 13 Apr 2003 Posts: 82 Location: France
|
Posted: Sat May 31, 2003 9:04 am Post subject: |
|
|
and if my another partition have a different size ? |
|
Back to top |
|
|
Cossins Veteran
Joined: 21 Mar 2003 Posts: 1136 Location: Copenhagen, Denmark
|
Posted: Sat May 31, 2003 9:14 am Post subject: |
|
|
Just ensure that the one you're copying to is larger than the original.
- Simon |
|
Back to top |
|
|
infirit l33t
Joined: 11 Jan 2003 Posts: 778 Location: Hoofddorp / The Netherlands
|
Posted: Sat May 31, 2003 3:34 pm Post subject: |
|
|
Code: | cp -pR / /mountofnewpartition | should also work i think.
Greetz |
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20503
|
Posted: Sun Jun 01, 2003 12:50 am Post subject: |
|
|
Moved from Installing Gentoo. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
iwasbiggs Apprentice
Joined: 17 Jan 2003 Posts: 203
|
Posted: Sun Jun 01, 2003 10:37 am Post subject: |
|
|
If you do end up using cp, try to use the -p for saving permissions. _________________ www.ruinedsoft.com
Freeware development. |
|
Back to top |
|
|
StuBear Apprentice
Joined: 26 Feb 2003 Posts: 157 Location: Melbourne,AUSTRALIA
|
Posted: Sun Jun 01, 2003 11:59 am Post subject: |
|
|
cp -ax / /mntpoint
the -a will keep permissions and modtimes etc and the -x will only copy stuff on the same partiton - /dev/ and /proc won't be copied to the new partiton, make sure you mkdir /mntpoint/dev and mkdir /mntpoint/proc after you finish copying.
You can do some stuff like piping into tar and untar, but I've never had a problem with cp -ax _________________ Since it is the optimal DVD-RAM correspondence for backup of personal computer data, and lighting soft needlessness, it is data preservation by floppy disk feeling. |
|
Back to top |
|
|
beandog Bodhisattva
Joined: 04 May 2003 Posts: 2072 Location: /usa/utah
|
Posted: Thu Jun 05, 2003 12:15 am Post subject: |
|
|
Sooooooo... has anyone actually had any success with this? I'm gonna wipe my XP off my dual boot sometime soon, and I'd like to bump Gentoo up to /hda3 instead of /hda6 (and move around /home/steve at the same time too ... ), but I'd feel a lot better if I saw a success story. _________________ If it ain't broke, tweak it. dvds | blurays | blog | wiki |
|
Back to top |
|
|
MacFlecknoe Apprentice
Joined: 11 Feb 2003 Posts: 189 Location: Ann Arbor, MI
|
Posted: Thu Jun 05, 2003 1:13 am Post subject: |
|
|
I JUST did this 4 days ago. I moved my gentoo distro from a 20gig drive to an 80gig drive. I used cp -ax as described above. The only trick is reinstalling grub in the MBR... but to do that without much thought you can simply use a boot cd/disk (at least I did... you can also just copy it to the akternate hd by running grub and specifying the new drive in your 'root' and 'setup' commands but I get confused easily and a boot disk seemed more straightforward).
Incidently... dont copy /proc.. that file system is dynamically created by the kernel. You will need to copy /dev over however (esp if youve created new nodes).
This is a good tutorial:
http://www.tldp.org/HOWTO/mini/Hard-Disk-Upgrade/index.html
Best of luck! |
|
Back to top |
|
|
StuBear Apprentice
Joined: 26 Feb 2003 Posts: 157 Location: Melbourne,AUSTRALIA
|
Posted: Thu Jun 05, 2003 3:20 am Post subject: |
|
|
I've done this at least 10 times with about 4 different linux distros - always trying to get the "optimum" partition layout.
Unless you move your /boot parttion there is on need to reinstall grub, just add a new entry in grub.conf pointing to your new / partition.
Reboot and try it out, this way if it doesn't work properly you can always reboot back into your old setup and correct any errors (like forgetting to update /etc/fstab to point to your new partions).
Only when I'm happy that everything is working will I reomve the old partition. _________________ Since it is the optimal DVD-RAM correspondence for backup of personal computer data, and lighting soft needlessness, it is data preservation by floppy disk feeling. |
|
Back to top |
|
|
beandog Bodhisattva
Joined: 04 May 2003 Posts: 2072 Location: /usa/utah
|
Posted: Thu Jun 05, 2003 12:43 pm Post subject: |
|
|
StuBear wrote: | I've done this at least 10 times with about 4 different linux distros - always trying to get the "optimum" partition layout. |
That's one thing I was wanting to do too.... any suggestions? I've got 40 gigs in two partitions from Gentoo right now, on an 80 gig HD (xp took up the other 40), so Ive got a 10, 30, 20 and 20 gig partition setup right now. _________________ If it ain't broke, tweak it. dvds | blurays | blog | wiki |
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20503
|
|
Back to top |
|
|
|