LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   'cp -R /' but keep old permissions (https://www.linuxquestions.org/questions/linux-newbie-8/cp-r-but-keep-old-permissions-329591/)

0pal_t0ad 06-02-2005 11:01 AM

'cp -R /' but keep old permissions
 
i bought a new hdd and need to move everything onto the new hdd.
I've tried
Code:

cp -R / /mnt/newroot
i ammended fstab and grub.conf to reflect the new partitions but grub was so garbled i could barely make out my boot menu but once the framebuffer kicked in everything was cool, or so i thought. I couldn't log in as a normal user because i didn't have permissions to my home dir. so logged in as root and chowned the home dir but that didn't give me permissions to run X. Is there a way around this, other than
Code:

chown -R opaltoad /
:)

aaa 06-02-2005 11:51 AM

That is what the -p option is for. "cp -Rp". Also, when you copy mount your original hd to /mnt/oldroot, so you can do "cp -Rp /mnt/oldroot /mnt/newroot". And don't forget to umount /proc.

0pal_t0ad 06-02-2005 12:32 PM

Quote:

Originally posted by aaa
Also, when you copy mount your original hd to /mnt/oldroot, so you can do "cp -Rp /mnt/oldroot /mnt/newroot". And don't forget to umount /proc.
which will mean i have to use a live cd to boot to, wouldn't i?. i was hoping i wouldn't have to do that as i only have two single connector ata/100 cables, so i can only have two drives running at a time :( fsck!

MasterC 06-02-2005 01:59 PM

You could use a boot floppy. Tom's rtb, or one of the several hundred other boot linux floppies could work for this too. You could also look at network or USB boot if your motherboard supports it, but I doubt it if you only have single connector cables ;)

You could also take the time to install a tiny distro into another partition, boot from it, and then do your work with the umounted devices.

Several very viable options, but really the best is to just grab a 2 connector cable for 5 bucks (USD, not sure what the conversion or cost is to the Euro currently ;) )

Cool

aaa 06-02-2005 02:18 PM

I don't think you need to use a boot cd/floppy:
Code:

# mount /dev/hda2 /mnt/tmp -t ext3
# mount
...
/dev/hda2 on / type ext3 (rw)
/dev/hda2 on /mnt/tmp type ext3 (rw)
...


0pal_t0ad 06-02-2005 02:57 PM

cheers! i'll give that a go.

0pal_t0ad 06-02-2005 04:15 PM

WICKED!! got it working...obviously! :D

Thanks guys!!!

only problem is the boot screen is still garbled.
any ideas?


All times are GMT -5. The time now is 01:50 AM.