How do I copy /dev/* from filesystem to filesystem
Linux - DesktopThis 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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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.
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.
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.
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.
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.
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.
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.