| Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
03-08-2011, 11:28 AM
|
#1
|
|
Member
Registered: Jul 2009
Posts: 487
Rep:
|
How do I copy /dev/* from filesystem to filesystem
If a partition only contains data files one can simply copy every file to another partition of another filing system and size.
But if the partition contains /dev/*, symbolic links and other special files, how do you copy everything to another partition of a different filing system and size?
|
|
|
|
03-08-2011, 11:39 AM
|
#2
|
|
Guru
Registered: Apr 2005
Location: /dev/null
Distribution: technixOS
Posts: 5,723
|
You can exclude the /dev/ and other "special" files. As far as the symbolic links, depending on what kind of file it is pointing to, you can copy the links over, but that's if the files that are being linked to are in within the backup.
|
|
|
|
03-08-2011, 11:40 AM
|
#3
|
|
Senior Member
Registered: Aug 2006
Location: C:\MSDOS\
Distribution: LFS 3.8.11 with OpenBox 3.5.0
Posts: 1,448
|
Why are you trying to copy /dev/?
|
|
|
|
03-08-2011, 12:14 PM
|
#4
|
|
Member
Registered: Jul 2009
Posts: 487
Original Poster
Rep:
|
Because I want to change filing system (xfs to ext3), resize, defrag and shrink (vmware concept) in one go.
|
|
|
|
03-08-2011, 12:17 PM
|
#5
|
|
Guru
Registered: Apr 2005
Location: /dev/null
Distribution: technixOS
Posts: 5,723
|
Quote:
Originally Posted by Ulysses_
Because I want to change filing system (xfs to ext3), resize, defrag and shrink (vmware concept) in one go.
|
You can't just do that. You need to set all of that up before you copy your files over.
|
|
|
|
03-08-2011, 12:22 PM
|
#6
|
|
Member
Registered: Jul 2009
Posts: 487
Original Poster
Rep:
|
Please answer the question in the title and do not diverge. Not possible to copy /dev/random and /dev/zero from XFS to a blank EXT3?
|
|
|
|
03-08-2011, 01:08 PM
|
#7
|
|
Member
Registered: Aug 2009
Location: Chicago
Distribution: CentOS
Posts: 114
Rep:
|
You can use rsync with the --links flag, which will copy simlinks, though your system is likely to be broken if you are trying to migrate filesystems by simply copying /dev.
Last edited by jcalzare; 03-08-2011 at 01:09 PM.
|
|
|
|
03-08-2011, 01:57 PM
|
#8
|
|
Moderator
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Slackware
Posts: 12,124
|
Quote:
Originally Posted by Ulysses_
Please answer the question in the title and do not diverge.
|
Quote:
|
How do I copy /dev/* from filesystem to filesystem
|
You don't. The files in /dev are created at boot.
Besides that, just copying your files from one system to another won't work. You have to keep this in mind:
1. If your system uses UUIDs you have to change them on the new system.
2. You have to reinstall the bootloader.
3. If you don't have a /boot-partition be aware that your bootloader must support XFS.
|
|
|
|
03-08-2011, 02:55 PM
|
#9
|
|
Member
Registered: Jul 2009
Posts: 487
Original Poster
Rep:
|
What if I install the same linux distro to a smaller EXT3 partition, delete everything but /dev in this, and then copy everything but /dev from the old XFS partition using cp? Bootloader supports XFS.
Last edited by Ulysses_; 03-08-2011 at 03:00 PM.
|
|
|
|
03-08-2011, 03:04 PM
|
#10
|
|
Moderator
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Slackware
Posts: 12,124
|
Sorry, I misread your post, I thought you want from ext3 to XFS, not from XFS to ext3.
But the problems are the same:
1. After the copy you have to reinstall the bootloader.
2. If you use UUIDs you have to change your fstab on the new system.
Copying over a new installed system will bring exactly nothing, the new files will be overwritten with the old and you have the same problems as mentioned above.
In reality adapting a copied system is a trivial task, just copy it with rsync to the new partition, and exclude /dev, /sys and /proc. Then create this directories with a simple mkdir on the new partition, adapt your /etc/fstab according to the new UUIDs, chroot into the new system and reinstall the bootloader.
If you search LQ or the web you should find plenty of HowTos regarding the cloning of a system with rsync.
|
|
|
|
03-08-2011, 03:27 PM
|
#11
|
|
Member
Registered: Jul 2009
Posts: 487
Original Poster
Rep:
|
Quote:
Originally Posted by TobiSGD
Sorry, I misread your post, I thought you want from ext3 to XFS, not from XFS to ext3.
But the problems are the same:
1. After the copy you have to reinstall the bootloader.
2. If you use UUIDs you have to change your fstab on the new system.
Copying over a new installed system will bring exactly nothing, the new files will be overwritten with the old and you have the same problems as mentioned above.
|
Aren't the problems above eliminated if /etc/fstab, /dev, /sys and /proc are kept as in the fresh install and everything else is copied with rsync or cp? The tasks you mention like installing a bootloader under chroot etc seem risky and definitely not trivial to my level.
|
|
|
|
03-08-2011, 03:42 PM
|
#12
|
|
Moderator
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Slackware
Posts: 12,124
|
Quote:
Originally Posted by Ulysses_
Aren't the problems above eliminated if /etc/fstab, /dev, /sys and /proc are kept as in the fresh install and everything else is copied with rsync or cp? The tasks you mention like installing a bootloader under chroot etc seem risky and definitely not trivial to my level.
|
It depends on your partitioning. If you use more than one partition, like a separate /home-partition, you have to give it to your new system also as /home-partition. Be sure to not format it accidentally at install time.
By the way, I don't think that copying a system to a newly installed one is more trivial than re-installing the bootloader.
|
|
|
|
03-09-2011, 09:53 PM
|
#13
|
|
Member
Registered: Jul 2009
Posts: 487
Original Poster
Rep:
|
Found a tool that seems to include /dev/* in its copies, it's rsync with the -avH options and it seems to have worked, except it does not copy the master boot record or the system partition's boot record.
How do you install the bootloader then, is there a liveCD for just this task?
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 10:49 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|