Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
i used rsync before to copy files and folders for backup, it does retain permission settings.
But i haven't try rsync to a new system, let's say if I have a group "Sales", "QC", "Deliveries" and each group has members.
Do i need to copy the /etc/config/group in the old system and copy to the new system?
Basically, the one is empty. So, if i used rsync even though it will retain permissions but it won't match anything on the new system since no users or groups has been created.
I think one question would be: how to copy users and group permissions to the new system?
--preserve[=ATTR_LIST]
preserve the specified attributes (default: mode,ownership,timestamps),
if possible additional attributes: context, links, xattr, all
Yes. If you cp -p or rsync -a files from the old system to the new system, they will retain the UIDs and GIDs of the old system. If those are unused on the new system, ls will display the IDs instead of a username.
If you create a user on the new system with one of those IDs, the files will then belong to that user.
What I've done in the past is selectively copy those /etc/passwd (and related /etc/shadow) and /etc/group entries to support the user files I've copied over. Not a good idea to copy over every user/group in those files, as the new system may have different assignments for system users than the old system did.
Example: To copy the user scasey who has a group scasey, I'd take these lines:
Code:
from /etc/passwd
scasey:x:1000:1000:Sean Casey:/home/scasey:/bin/bash
from /etc/shadow
scasey:$OL7jPFOTg598KpTXg::0:99999:7:::
from /etc/group
scasey:x:1000:scasey
(the password field in /etc/shadow posted here is not real)
Actually for /etc/group I'd do something like
Code:
grep scasey /etc/group > scaseygrp.txt
to capture all groups of which scasey is a member
That would preserve and transfer the users to the new system.
I have previously taken the disk out of an old "retired" computer, and put it in the new one. 99% of things just worked. As I remember, the last time I did that, I believe that the only thing that didn't work was sound, which was easily fixed.
I have previously taken the disk out of an old "retired" computer, and put it in the new one. 99% of things just worked. As I remember, the last time I did that, I believe that the only thing that didn't work was sound, which was easily fixed.
This would be good if you are not upgrading the size of your hard drive or the hard drive is quite new.
But if hard drive size is increased or the hard drive is showing some issue then I guess this method is not ideal.
When migrating from one machine to other, historically, I have relied on backups (tar or at times commercial products which under the hood runs tar).
Tar does preserve permissions, but mostly I restore from backups because that is also one way I can test that my backups are working correctly.
This would be good if you are not upgrading the size of your hard drive or the hard drive is quite new.
But if hard drive size is increased or the hard drive is showing some issue then I guess this method is not ideal.
In that situation, I MIGHT copy the partition over with gParted, and then tinker with fstab to amend the UUIDs. It depends how much software I would need to install on a fresh install, I suppose.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.