View previous topic :: View next topic |
Author |
Message |
loki n00b
Joined: 01 Oct 2002 Posts: 36
|
Posted: Tue Jun 24, 2003 8:30 pm Post subject: Gentoo transfer ? |
|
|
A friend 'Sarlok' and I are busy installing his new 80gig harddrive and would like to move his gentoo installation, to avoid recompile and un-necessicary setup, we've try'd simply using 'cp -pRd' to copy each individual folder into the root of the new drive because it choke's on /proc and a couple of other things, the system actually boot's properly, but thing's like xterm and sshd dont work properly... perhap's theres a better way of going about cloneing his installation
thanks in advance |
|
Back to top |
|
|
ebrostig Bodhisattva
Joined: 20 Jul 2002 Posts: 3152 Location: Orlando, Fl
|
Posted: Tue Jun 24, 2003 9:47 pm Post subject: |
|
|
I have to say I love this phrase "like xterm and sshd dont work properly". What does properly mean? Can you use them or do they fail with a certain error?
The best way of moving the root partition to a new drive would be to use tar or cpio. It is not a straight forward issue and it may actually give you problems. The only thing that I can gurantee will work, is to use a decent backup program and then restore from the backup onto the new drive.
Erik _________________ 'Yes, Firefox is indeed greater than women. Can women block pops up for you? No. Can Firefox show you naked women? Yes.' |
|
Back to top |
|
|
Sarlok Tux's lil' helper
Joined: 03 Jan 2003 Posts: 98
|
Posted: Tue Jun 24, 2003 11:39 pm Post subject: |
|
|
Not working, meaning xterm won't start as a non-super user. As far as I can tell, every user should have permission to start it, the group files and read/write/owners of xterm file, and the folder it's in are all the same as on my other working drive (the one I've booted from at the moment).
As far as ssh goes, it freezes on the clients end if they try and connect to my pc after they enter their password. That requires killing the process to stop it.
Those are the only things we've noticed so far that are messed up, allthough I would like to make sure it all copys fine so that everything works.
Same thing happens trying to et to it from my PC.
I'd rather find a way to copy everything properly than get these individual things working again. cp almost worked, but it can't seem to get the permissions and owners right still. either all owned by root/root, or 0/0.
That or it keeps giving me "No room left on device" when there's still 32 gigs free.
fschk doesn't give any errors on bootup or when it's run either.
Any sort of backup apps you could suggest that I could emerge? I found 'flexbackup', a backup script... but it's a little on the scary side.
I'll get back to googleing, but if you reply before I find something... _________________ Four-thousand, six-hundred and ninety-one Irradiated haggis. |
|
Back to top |
|
|
PowerFactor Veteran
Joined: 30 Jan 2003 Posts: 1693 Location: out of it
|
Posted: Wed Jun 25, 2003 12:40 am Post subject: |
|
|
Well, here's an easy way to copy partitions that has always worked for me. Boot from the livecd. Mount both the old and new partitions. Then run the following. Code: | $ cd /mnt/old_part
$ find . -print | cpio -pamd /mnt/new_part |
|
|
Back to top |
|
|
Sarlok Tux's lil' helper
Joined: 03 Jan 2003 Posts: 98
|
Posted: Wed Jun 25, 2003 3:28 am Post subject: |
|
|
PowerFactor wrote: | Well, here's an easy way to copy partitions that has always worked for me. Boot from the livecd. Mount both the old and new partitions. Then run the following. Code: | $ cd /mnt/old_part
$ find . -print | cpio -pamd /mnt/new_part |
|
Fantastic. Worked perfectly.
Thankyou. _________________ Four-thousand, six-hundred and ninety-one Irradiated haggis. |
|
Back to top |
|
|
PowerFactor Veteran
Joined: 30 Jan 2003 Posts: 1693 Location: out of it
|
Posted: Wed Jun 25, 2003 5:56 pm Post subject: |
|
|
Sarlok wrote: | [Fantastic. Worked perfectly.
Thankyou. | Cool, no prob. |
|
Back to top |
|
|
jeffrice Tux's lil' helper
Joined: 25 Jun 2003 Posts: 89 Location: New York, USA
|
Posted: Tue Jul 08, 2003 8:16 pm Post subject: |
|
|
Am I right in assuming that cpio will work if the partitions aren't identical in size? dd, as far as I understand, will replicate them *exactly*, which is not what I want.
My plan is to put both HDs in, new being /dev/hdb and then copy /dev/hda1 -> /dev/hdb1, /dev/hda2 -> /dev/hdb2 and so forth. but the matching /dev/hdb* will be bigger (in general) than it's hda counterpart.
Will cpio do this? |
|
Back to top |
|
|
plate Bodhisattva
Joined: 25 Jul 2002 Posts: 1663 Location: Berlin
|
Posted: Tue Jul 08, 2003 9:09 pm Post subject: |
|
|
But of course. |
|
Back to top |
|
|
Smokerdave n00b
Joined: 13 Dec 2004 Posts: 17
|
Posted: Fri Dec 24, 2004 7:48 am Post subject: |
|
|
I tried doing this with a 2004.3 CD, but I get "cpio - command not found" trying. Am I using the wrong CD for this? |
|
Back to top |
|
|
madmango Guru
Joined: 15 Jul 2003 Posts: 507 Location: PA, USA
|
Posted: Fri Dec 24, 2004 2:06 pm Post subject: |
|
|
Apparently cpio isn't included on the 2003.4 cd. You could also accomplish this with rsync, which is what I do for backups.
Code: | cd /mnt/old_part
rsync -av --exclude=mnt --exclude=proc --exclude=usr/portage/distfiles ./ /mnt/new_part |
_________________ word. |
|
Back to top |
|
|
retsaw n00b
Joined: 16 Dec 2004 Posts: 10
|
Posted: Fri Dec 24, 2004 2:45 pm Post subject: |
|
|
jeffrice wrote: | Am I right in assuming that cpio will work if the partitions aren't identical in size? dd, as far as I understand, will replicate them *exactly*, which is not what I want. |
This is true, however dd will work and you could resize the filesystems once it is done. I haven't tried it on a partition by parition basis, but it worked when I copied a 2GB to 20GB disk, leaving me with 18GB unallocated space and I resized the partition after that.
What I normally do for copying all the files is use tar eg.
Code: | tar cpC /mnt/oldpart/ ./ | tar xpC /mnt/newpart/ |
|
|
Back to top |
|
|
Smokerdave n00b
Joined: 13 Dec 2004 Posts: 17
|
Posted: Fri Dec 24, 2004 6:37 pm Post subject: |
|
|
madmango wrote: | Apparently cpio isn't included on the 2003.4 cd. You could also accomplish this with rsync, which is what I do for backups.
Code: | cd /mnt/old_part
rsync -av --exclude=mnt --exclude=proc --exclude=usr/portage/distfiles ./ /mnt/new_part |
|
So, if I use this to copy my current 8gb partition to a new 16gb partition (on the same disc), everything will work and I will have 8gb free space? If so, then thanks alot |
|
Back to top |
|
|
Smokerdave n00b
Joined: 13 Dec 2004 Posts: 17
|
Posted: Mon Dec 27, 2004 2:50 am Post subject: |
|
|
Note: rsync isn't included on the CD either, and using tar gives me alot of "tar: ./path/file: socket ignored". Is it really safe trying to boot the new disc even if I get this? |
|
Back to top |
|
|
Kaapeli Tux's lil' helper
Joined: 27 Dec 2004 Posts: 110 Location: Oulu, Finland
|
Posted: Mon Dec 27, 2004 4:27 pm Post subject: |
|
|
Why didn't anyone mention this command:
Code: |
cp -a /mnt/old /mnt/new
|
I've transferred this Gentoo installation couple of times on a new partition and it has always worked with the first try. |
|
Back to top |
|
|
xbmodder Guru
Joined: 25 Feb 2004 Posts: 404
|
Posted: Tue Dec 28, 2004 4:57 am Post subject: |
|
|
kaapeli you beat me to it!
haha!
i think
do this in system boot:
Code: |
dd if=/dev/hda3 of=/dev/hdb3
mkswap /dev/hdb2
dd if=/dev/hda1 of=/dev/hda1
resize2fs /dev/hda1
resize2fs /dev/hda3
|
now boot into live CD
make sure that the drives are switched hdb > hda
http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=10#doc_chap2
go into chroot:
Code: |
mkdir -p /mnt/gentoo
mount /dev/hda3 /mnt/gentoo
mount /dev/hda1 /mnt/gentoo/boot
mount -t proc none /mnt/gentoo/proc
chroot /mnt/gentoo
env-update
source /etc/profile
|
follow step 10b
your done! _________________ http://xbmodder.us/ |
|
Back to top |
|
|
Bob P Advocate
Joined: 20 Oct 2004 Posts: 3374 Location: USA
|
Posted: Mon Feb 14, 2005 3:30 am Post subject: |
|
|
Kaapeli wrote: | Why didn't anyone mention this command:
Code: |
cp -a /mnt/old /mnt/new
|
I've transferred this Gentoo installation couple of times on a new partition and it has always worked with the first try. |
it sounds good. my bet is that you haven't actually tried it. |
|
Back to top |
|
|
teknomage1 Veteran
Joined: 05 Aug 2003 Posts: 1239 Location: Los Angeles, CA
|
Posted: Mon Feb 14, 2005 10:56 am Post subject: |
|
|
I have, it's part of my standard harddrive replacing spiel, I think you can find it if you search deep enough in the forums. It hasn't given me any issues. Why would it be worse than a bit for bit dumb copy like dd? Maybe it will take longer but it preserves all the important info. |
|
Back to top |
|
|
Bob P Advocate
Joined: 20 Oct 2004 Posts: 3374 Location: USA
|
Posted: Mon Feb 14, 2005 7:15 pm Post subject: |
|
|
well, here i am with my foot in my mouth, then.
i tried it yesterday and ran into problems when it tried to copy /mnt. |
|
Back to top |
|
|
jsheedy Tux's lil' helper
Joined: 26 Nov 2004 Posts: 101 Location: IL:USA
|
Posted: Tue Jun 28, 2005 7:10 pm Post subject: |
|
|
I want to move from one hard drive 36gig to another 73 gig.
I have partitioned the second disk
/dev/sdb1 will be boot 73MB
/dev/sdb2 will be swap 300MB
/dev/sdb3 will be root rest
I was going to boot up the live cd and mount the the root part /mnt/oldroot /mnt/newroot and cd /mnt/oldroot, cp -ax * /mnt/newroot. (boot also)
Will this work ok?
I will just have to make some changes to grub.conf then?
Thanks _________________ Just J |
|
Back to top |
|
|
jsheedy Tux's lil' helper
Joined: 26 Nov 2004 Posts: 101 Location: IL:USA
|
Posted: Tue Jun 28, 2005 11:40 pm Post subject: |
|
|
In trying to do the cp -ax, I received some SCSI IO errors. Is there something else I should try?
SCSI error : <1 0 1 0> return code = 0x80000002
Current sdc: seanse = 70b
ASC=47 ASCQ= 0
Raw sense data:0.70 0x00 0x0b 0x00 0x00 0x00 0x00 0x0a 0x00 0x00 0x00 0x00 0x47 0x00 0x08 0x00 0x00 0x00
end_request: I/O erro, dev sdc, sector 5084074
printk: 13 messages suppressed
Buffer I/O error on device sdc3, logical block 470843
lost page write due to I/O error on sdc3
that error is repeated a countless number of times
Josh _________________ Just J |
|
Back to top |
|
|
|