I'm planning on moving the Fedora-20 system on my laptop to a new hard disk (500GB instead of 80GB). I've partitioned the new disk. When I copy partitions from the old disk to the new one with "cp -a" (running under a Fedora Live CD) I get a lot of messages of the form diff: a/bin/acroread: No such file or directory diff: b/bin/acroread: No such file or directory
All the messages concern symbolic links. I see in "man cp" that "cp -a" included "--no-dereference never follow symbolic links in SOURCE"
Does this mean cp is not an appropriate way to copy partitions? I thought of using dd, but the partitions are not the same size, and I was not sure if this would cause problems.
Any suggestions gratefully received.
On 05/28/2014 09:36 AM, Timothy Murphy wrote:
I'm planning on moving the Fedora-20 system on my laptop to a new hard disk (500GB instead of 80GB). I've partitioned the new disk. When I copy partitions from the old disk to the new one with "cp -a" (running under a Fedora Live CD) I get a lot of messages of the form diff: a/bin/acroread: No such file or directory diff: b/bin/acroread: No such file or directory
All the messages concern symbolic links. I see in "man cp" that "cp -a" included "--no-dereference never follow symbolic links in SOURCE"
Does this mean cp is not an appropriate way to copy partitions? I thought of using dd, but the partitions are not the same size, and I was not sure if this would cause problems.
find | cpio pipelines work well here, using cpio in 'pass' mode. See the man page.
On Wed, 28 May 2014 14:36:27 +0100 Timothy Murphy wrote:
Any suggestions gratefully received.
I've used rsync to do this (you have to go through the gazillion options to get all the appropriate ones though).
You'll also have to do something like boot from a live CD in order to run grub-install (or grub2-install) to make the new disk bootable.
I'd also have expected cp -a to work. Sorry, I can't say what the problem with that is, but my next try would be rsync.
On Wed, May 28, 2014 at 11:50 PM, Tim Evans tkevans@tkevans.com wrote:
On 05/28/2014 09:36 AM, Timothy Murphy wrote:
I'm planning on moving the Fedora-20 system on my laptop to a new hard disk (500GB instead of 80GB). I've partitioned the new disk. When I copy partitions from the old disk to the new one with "cp -a" (running under a Fedora Live CD) I get a lot of messages of the form diff: a/bin/acroread: No such file or directory diff: b/bin/acroread: No such file or directory
All the messages concern symbolic links. I see in "man cp" that "cp -a" included "--no-dereference never follow symbolic links in SOURCE"
Does this mean cp is not an appropriate way to copy partitions? I thought of using dd, but the partitions are not the same size, and I was not sure if this would cause problems.
find | cpio pipelines work well here, using cpio in 'pass' mode. See the man page.
-- Tim Evans | 5 Chestnut Court Linux/UNIX Consulting | Owings Mills, MD 21117 http://www.tkevans.com/ | 443-394-3864
-- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines Have a question? Ask away: http://ask.fedoraproject.org
There must be a zillion ways to do this (rsync, cpio, even cp) so I'll throw in my personal favorite:
# cd /old # tar --one-file-system -cf - . | (cd /new && tar xpf -)
--Greg
On 5/28/14, 9:36, Timothy Murphy wrote:
I'm planning on moving the Fedora-20 system on my laptop Any suggestions gratefully received.
If your using lvm, what I typically do is add both disks to the volume group, then you can use pvmove to move your lv's to the new pv. The just vgreduce the old pv out of the vg. Then you can lvextend your lv's as you see fit from your new disk.
Of course, I /boot has to be out side of lvm, but can be copied manually. And you'll have to manually install the grub boot loader on the new disk as well.
- Derrik
"dd" is a much better command that "cp" for this. See the following for more info and a good background as to what is going on:
https://wiki.archlinux.org/index.php/Disk_Cloning
The sections on "Cloning a partition" and "Cloning an entire hard disk" are the bits you want. Also take a look at the bit about the MBR - useful if you want a bootable drive after the cloning if you didn't take care of it when you created the partitions on the new drive.
Andy
On 28 May 2014 at 14:36, Timothy Murphy wrote:
To: users@lists.fedoraproject.org From: Timothy Murphy gayleard@eircom.net Subject: Moving Fedora system to new disk Date sent: Wed, 28 May 2014 14:36:27 +0100 Organization: Trinity College Dublin Send reply to: gayleard@eircom.net, Community support for Fedora users users@lists.fedoraproject.org mailto:users-request@lists.fedoraproject.org?subject=unsubscribe mailto:users-request@lists.fedoraproject.org?subject=subscribe
I'm planning on moving the Fedora-20 system on my laptop to a new hard disk (500GB instead of 80GB). I've partitioned the new disk. When I copy partitions from the old disk to the new one with "cp -a" (running under a Fedora Live CD) I get a lot of messages of the form diff: a/bin/acroread: No such file or directory diff: b/bin/acroread: No such file or directory
All the messages concern symbolic links. I see in "man cp" that "cp -a" included "--no-dereference never follow symbolic links in SOURCE"
Does this mean cp is not an appropriate way to copy partitions? I thought of using dd, but the partitions are not the same size, and I was not sure if this would cause problems.
Any suggestions gratefully received.
One issue that you may run into is that the UUID of the disks will not be the same, so without modifying the boot files, the system will not work.
Generally, I just clone the old disk to the new disk using a livecd with G4L, which I am the maintaner of, or other ones like clonezilla or G4U. That will give you the same size partitions on the new disk, but you can then use other programs like gparted or LVM utilities to use the extra space.
I recently cloned an 80G disk to a 1T disk with no issues, and since the clone process uses dd to copy the raw data, all the links and other issues are not a problem.
-- Timothy Murphy e-mail: gayleard /at/ eircom.net School of Mathematics, Trinity College, Dublin 2, Ireland
-- users mailing list users@lists.fedoraproject.org To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines Have a question? Ask away: http://ask.fedoraproject.org
+----------------------------------------------------------+ Michael D. Setzer II - Computer Science Instructor Guam Community College Computer Center mailto:mikes@kuentos.guam.net mailto:msetzerii@gmail.com http://www.guam.net/home/mikes Guam - Where America's Day Begins G4L Disk Imaging Project maintainer http://sourceforge.net/projects/g4l/ +----------------------------------------------------------+
http://setiathome.berkeley.edu (Original) Number of Seti Units Returned: 19,471 Processing time: 32 years, 290 days, 12 hours, 58 minutes (Total Hours: 287,489)
BOINC@HOME CREDITS ROSETTA 15887438.900756 | SETI 26475216.029716 ABC 16613838.513356 | EINSTEIN 25267413.884942
On Wed, 28 May 2014, Timothy Murphy wrote:
I'm planning on moving the Fedora-20 system on my laptop to a new hard disk (500GB instead of 80GB). I've partitioned the new disk. When I copy partitions from the old disk to the new one with "cp -a" (running under a Fedora Live CD) I get a lot of messages of the form diff: a/bin/acroread: No such file or directory diff: b/bin/acroread: No such file or directory
All the messages concern symbolic links. I see in "man cp" that "cp -a" included "--no-dereference never follow symbolic links in SOURCE"
Does this mean cp is not an appropriate way to copy partitions?
From the man page,
I see no way to tell cp to copy a symbolic link as a symbolic link.
I thought of using dd, but the partitions are not the same size, and I was not sure if this would cause problems.
Use dd and resize2fs. resize2fs defaults to the size of the partition.
On 05/28/2014 04:37 PM, Michael Hennebry wrote:
On Wed, 28 May 2014, Timothy Murphy wrote:
I'm planning on moving the Fedora-20 system on my laptop to a new hard disk (500GB instead of 80GB). I've partitioned the new disk. When I copy partitions from the old disk to the new one with "cp -a" (running under a Fedora Live CD) I get a lot of messages of the form diff: a/bin/acroread: No such file or directory diff: b/bin/acroread: No such file or directory
All the messages concern symbolic links. I see in "man cp" that "cp -a" included "--no-dereference never follow symbolic links in SOURCE"
Does this mean cp is not an appropriate way to copy partitions?
From the man page, I see no way to tell cp to copy a symbolic link as a symbolic link.
I think the Option "-P" will do it.
Joachim Backes
On 14-05-28 12:09:15, Joachim Backes wrote:
On 05/28/2014 04:37 PM, Michael Hennebry wrote:
On Wed, 28 May 2014, Timothy Murphy wrote:
I'm planning on moving the Fedora-20 system on my laptop to a new hard disk (500GB instead of 80GB). I've partitioned the new disk. When I copy partitions from the old disk to the new one with "cp -a" (running under a Fedora Live CD) I get a lot of messages of the form diff: a/bin/acroread: No such file or directory diff: b/bin/acroread: No such file or directory
All the messages concern symbolic links. I see in "man cp" that "cp -a" included "--no-dereference never follow symbolic links in SOURCE"
Does this mean cp is not an appropriate way to copy partitions?
From the man page, I see no way to tell cp to copy a symbolic link as a symbolic link.
I think the Option "-P" will do it.
-a does it, but diff is complaining that the links are broken. In my case, /bin/acroread -> /opt/Adobe/Reader9/bin/acroread.
On 05/28/2014 06:19 PM, Tony Nelson wrote:
On 14-05-28 12:09:15, Joachim Backes wrote:
On 05/28/2014 04:37 PM, Michael Hennebry wrote:
On Wed, 28 May 2014, Timothy Murphy wrote:
I'm planning on moving the Fedora-20 system on my laptop to a new hard disk (500GB instead of 80GB). I've partitioned the new disk. When I copy partitions from the old disk to the new one with "cp -a" (running under a Fedora Live CD) I get a lot of messages of the form diff: a/bin/acroread: No such file or directory diff: b/bin/acroread: No such file or directory
All the messages concern symbolic links. I see in "man cp" that "cp -a" included "--no-dereference never follow symbolic links in SOURCE"
Does this mean cp is not an appropriate way to copy partitions?
From the man page, I see no way to tell cp to copy a symbolic link as a symbolic link.
I think the Option "-P" will do it.
-a does it, but diff is complaining that the links are broken. In my case, /bin/acroread -> /opt/Adobe/Reader9/bin/acroread.
Are you sure? I did the following:
backes@eule [~]: mkdir aaaaa backes@eule [~]: cd aaaaa backes@eule [~/aaaaa]: ln -s ~ l backes@eule [~/aaaaa]: cd .. backes@eule [~]: cp -rP aaaaa bbbbb/ backes@eule [~]: ls -l bbbbb total 0 lrwxrwxrwx 1 backes backes 12 May 28 18:26 l -> /home/backes
(r is used for recursivity)
So "-P" will do it :-)
On 14-05-28 12:28:31, Joachim Backes wrote:
On 05/28/2014 06:19 PM, Tony Nelson wrote:
On 14-05-28 12:09:15, Joachim Backes wrote:
...
I think the Option "-P" will do it.
-a does it, but diff is complaining that the links are broken. In my case, /bin/acroread -> /opt/Adobe/Reader9/bin/acroread.
Are you sure? I did the following:
backes@eule [~]: mkdir aaaaa backes@eule [~]: cd aaaaa backes@eule [~/aaaaa]: ln -s ~ l backes@eule [~/aaaaa]: cd .. backes@eule [~]: cp -rP aaaaa bbbbb/ backes@eule [~]: ls -l bbbbb total 0 lrwxrwxrwx 1 backes backes 12 May 28 18:26 l -> /home/backes
(r is used for recursivity)
So "-P" will do it :-)
-a includes -P, so copying symlinks is not his problem. His problem is that the links are broken, as reported by diff.
On Wed, 28 May 2014, Timothy Murphy wrote:
Does this mean cp is not an appropriate way to copy partitions? I thought of using dd, but the partitions are not the same size, and I was not sure if this would cause problems.
Any suggestions gratefully received.
IMHO, the best choice for these kind of tasks is using bare metal recovery with tools like Mondorescue: http://www.mondorescue.org/
You can create with it a liveCD (or a USB bootable image) of the operating system filesystems, install the OS in this manner, then recover the user data (i.e. /home) using tools like rsync (even tar!) with the appropiate options.
Once upon a time, Tony Nelson tonynelson@georgeanelson.com said:
-a includes -P, so copying symlinks is not his problem. His problem is that the links are broken, as reported by diff.
I'm not sure what environment the OP was using to do the copy (e.g. rescue mode, live CD, etc.), but some things install relative links, which should always work, while some install fully-specified links, which won't when the FS is mounted under a different location.
For example, if you have /usr/bin/acroread as a symlink to /opt/Adobe/Reader/9/bin/acroread, but then you boot a recue mode and mount the root FS under /mnt/sysimage, the /usr/bin/acroread link will be broken.
If instead you have something like /usr/bin/Mail linked to ../../bin/mailx, it will still work.
That may be all the OP is seeing, depending on the environment used.
Tom Horsley wrote:
I've used rsync to do this (you have to go through the gazillion options to get all the appropriate ones though).
Thanks for your and the many other suggestions. I'm going to follow your advice and use rsync, which seems most appropriate since the I have already copied the partitions.
I'm planning on saying "rsync -auvz" (which is my usual recipe). If anyone can suggest better options I shall be glad to hear them.
You'll also have to do something like boot from a live CD in order to run grub-install (or grub2-install) to make the new disk bootable.
I did actually do that, after changing the UUID settings in fstab. But I was surprised to find that Fedora-20 Live CD (on a USB stick) did not seem to do the trick, but the Netinstall CD did the job.
Once upon a time, Timothy Murphy gayleard@eircom.net said:
I'm planning on saying "rsync -auvz" (which is my usual recipe). If anyone can suggest better options I shall be glad to hear them.
For copying the OS, you will also want -HAX to correctly copy hard-linked files, access-control lists, and extended attributes. For disk-to-disk copies, drop -z (don't need to compress). -u shouldn't be needed (since you want an identical system, something newer on the target shouldn't happen, and should probably be replaced if found). If the target has possibly been altered (or files have been deleted from the source), add --delete.
I like adding -P (for --partial --progress); it gives more info during sync and won't remove any partially-copied files (not usually an issue for disk-to-disk, but useful for network transfers).
So, "rsync -aHAXvP --delete" would be my recommendation.
Also, unless you've disabled SELinux, you may need to relabel on the first boot from the copy (not sure if rsync -X will set that correctly or not; haven't checked in a while).
On May 28, 2014, at 7:56 AM, Tom Horsley horsley1953@gmail.com wrote:
On Wed, 28 May 2014 14:36:27 +0100 Timothy Murphy wrote:
Any suggestions gratefully received.
I've used rsync to do this (you have to go through the gazillion options to get all the appropriate ones though).
Anaconda LiveCD uses -pogAXtlHrDx
I'm pretty sure that's the same as -aAHXx
Realize with x that it expect to rsync each volume separately, so you don't do rsync on / and expect that it will copy things correctly to /boot on a volume separate from /var or /.
Chris Murphy
On 28.05.2014, Timothy Murphy wrote:
I'm planning on moving the Fedora-20 system on my laptop to a new hard disk (500GB instead of 80GB). I've partitioned the new disk. When I copy partitions from the old disk to the new one with "cp -a" (running under a Fedora Live CD) I get a lot of messages of the form diff: a/bin/acroread: No such file or directory diff: b/bin/acroread: No such file or directory
I've done that quite often, and it's no problem.
1. Boot from an external medium, e.g. www.sysresccd.org 2. Mount both disks 3. Use "rsync -avxHSAX /source/ /target" to copy the partitions 4. Install grub2 on the new disk: - mount /dev/sdaX /mnt - grub2-install --root-directory=/mnt /dev/sda - grub2-mkconfig -o /mnt/boot/grub2./grub.cfg
Reboot, and you're done.
On 05/29/2014 02:19 AM, Heinz Diehl wrote:
On 28.05.2014, Timothy Murphy wrote:
I'm planning on moving the Fedora-20 system on my laptop to a new hard disk (500GB instead of 80GB). I've partitioned the new disk. When I copy partitions from the old disk to the new one with "cp -a" (running under a Fedora Live CD) I get a lot of messages of the form diff: a/bin/acroread: No such file or directory diff: b/bin/acroread: No such file or directory
I've done that quite often, and it's no problem.
- Boot from an external medium, e.g. www.sysresccd.org
- Mount both disks
- Use "rsync -avxHSAX /source/ /target" to copy the partitions
- Install grub2 on the new disk:
- mount /dev/sdaX /mnt
- grub2-install --root-directory=/mnt /dev/sda
- grub2-mkconfig -o /mnt/boot/grub2./grub.cfg
Reboot, and you're done.
I am planning a migration from a present F20 installation to a new system--that is, a new physical box on which I will do a completely fresh installation of F20 from the KDE spin. I am prepared to re-install all applications. All I want to do is move the contents of /home. What are the best commands for doing this?
Temlakos
On 05/28/14 09:36, Timothy Murphy wrote:
I'm planning on moving the Fedora-20 system on my laptop to a new hard disk (500GB instead of 80GB). I've partitioned the new disk. When I copy partitions from the old disk to the new one with "cp -a" (running under a Fedora Live CD) I get a lot of messages of the form diff: a/bin/acroread: No such file or directory diff: b/bin/acroread: No such file or directory
All the messages concern symbolic links. I see in "man cp" that "cp -a" included "--no-dereference never follow symbolic links in SOURCE"
Does this mean cp is not an appropriate way to copy partitions? I thought of using dd, but the partitions are not the same size, and I was not sure if this would cause problems.
Any suggestions gratefully received.
i do not know what version of 'cp' you have, but i can tell you that "cp (GNU coreutils) 8.4" does not copy directories or files that have a space in their name. which is why i use 'find|cpio' for disk and directory path coping.
to insure that i have all directories and files, i open a terminal at top of copy source and target paths and run 'ls -lR > 00-path'. then i use kwrite to open files, move to bottom of files and compare the line number to insure all has been copied.
On 05/29/2014 01:20 PM, g wrote:
On 05/28/14 09:36, Timothy Murphy wrote:
I'm planning on moving the Fedora-20 system on my laptop to a new hard disk (500GB instead of 80GB). I've partitioned the new disk. When I copy partitions from the old disk to the new one with "cp -a" (running under a Fedora Live CD) I get a lot of messages of the form diff: a/bin/acroread: No such file or directory diff: b/bin/acroread: No such file or directory
All the messages concern symbolic links. I see in "man cp" that "cp -a" included "--no-dereference never follow symbolic links in SOURCE"
Does this mean cp is not an appropriate way to copy partitions? I thought of using dd, but the partitions are not the same size, and I was not sure if this would cause problems.
Any suggestions gratefully received.
i do not know what version of 'cp' you have, but i can tell you that "cp (GNU coreutils) 8.4" does not copy directories or files that have a space in their name. which is why i use 'find|cpio' for disk and directory path coping.
Hi G, you are sure?
backes@eule [~]: rm -rf 'aa aa' 'bb bb' backes@eule [~]: mkdir 'aa aa' backes@eule [~]: cp -xaP 'aa aa' 'bb bb'/ backes@eule [~]: ls -l aa* bb* aa aa: total 0
bb bb: total 0
My /bin/cp belongs to coreutils-8.21-21.fc20.x86_64
Kind regards
Joachim Backes
Heinz Diehl wrote:
I'm planning on moving the Fedora-20 system on my laptop to a new hard disk (500GB instead of 80GB).
I've done that quite often, and it's no problem.
- Boot from an external medium, e.g. www.sysresccd.org
- Mount both disks
- Use "rsync -avxHSAX /source/ /target" to copy the partitions
- Install grub2 on the new disk:
- mount /dev/sdaX /mnt
- grub2-install --root-directory=/mnt /dev/sda
- grub2-mkconfig -o /mnt/boot/grub2./grub.cfg
Reboot, and you're done.
Don't you have to correct UUIDs in /etc/fstab on the new disk?
On 05/29/14 07:31, Joachim Backes wrote: <<<>>>
hello Joachim,
Hi G, you are sure?
backes@eule [~]: rm -rf 'aa aa' 'bb bb' backes@eule [~]: mkdir 'aa aa' backes@eule [~]: cp -xaP 'aa aa' 'bb bb'/ backes@eule [~]: ls -l aa* bb* aa aa: total 0
bb bb: total 0
My /bin/cp belongs to coreutils-8.21-21.fc20.x86_64
'sure as God made little green apples'. :=)
please excuse omission, as i did fail to mention this is with CentOS release 6.5 (Final).
i had same problem with with sl5.? when i stopped using it.
tho, it could be that it is fixed in fedora and not yet in rhel.
then again, being that your directories have no files and are top of path, it copies.
and again, being that it has been awhile that i found this problem, it may be just files, as my 'chemo brain' recalls, it happened when saving web pages and then coping them elsewhere. [to many web pages are written with oos] now, when i copy web pages that have spaces in their names, i either omit space or use '-' for space.
also, from habits of early unix days, i never create directory or file names with spaces.
Once upon a time, g geleem@bellsouth.net said:
i do not know what version of 'cp' you have, but i can tell you that "cp (GNU coreutils) 8.4" does not copy directories or files that have a space in their name.
That is not true. cp handles files with any characters just fine (just tested on an old RHEL 4 system with coreutils-5.2.1).
I would gues you have run into shell quoting issues, but that's the standard "fun" of using special characters in filenames and Unix shells. You can't just say:
$ cp File With Spaces.txt /tmp
you have to:
$ cp "File With Space.txt" /tmp
On May 29, 2014, at 5:31 AM, Timothy Murphy gayleard@eircom.net wrote:
Heinz Diehl wrote:
I'm planning on moving the Fedora-20 system on my laptop to a new hard disk (500GB instead of 80GB).
I've done that quite often, and it's no problem.
- Boot from an external medium, e.g. www.sysresccd.org
- Mount both disks
- Use "rsync -avxHSAX /source/ /target" to copy the partitions
- Install grub2 on the new disk:
- mount /dev/sdaX /mnt
- grub2-install --root-directory=/mnt /dev/sda
- grub2-mkconfig -o /mnt/boot/grub2./grub.cfg
Reboot, and you're done.
Don't you have to correct UUIDs in /etc/fstab on the new disk?
Yes. And good chance you'll need to run dracut to rebuild all initramfs's; for sure if it's being moved to new hardware. It might tolerate same hardware, different drive and fs volume UUID, but I know that the initramfs contains references to the volume UUID so you're better off rebuilding the initramfs's.
Chris Murphy