Hi Rsync-ers I'm simply using rsync to do an exact copy of my root (and home) partition by using the -aHv options. When the copy is complete, I modify fstab so my root and home mount points are pointing to the newly copied partitions. When I boot (into the new partitions), init and all the services start okay; however, when I get to "mgetty" and it passes control to "login" I get the following login error (logging in as root): login: no shell: Permission denied. which seems very peculiar given that: (a) I'm logging in as root and I'm getting a "Permission denied"(!); and, (b) the boot process works without a hitch; and, (c) rsync is doing an exact copy. Just to be sure it was rsync, I completed deleted my original root and home partitions (it's okay, it was a new installation) and then copied everything back (again using the -aHv options). However, I ended up with exactly the same problem. I can only conclude, therefore, that rsync does not make an _exact_ copy of the root partition as I first thought it would. It also just seems very strange that it would fail at the point it has. I've searched the web for that error message, but have been unable to find anything in regards to using rsync. If anyone could please shed any light on what is happening here it would be most appreciated. Thanks in advance, Martin -- _______________________________________________ Check out the latest SMS services @ http://www.linuxmail.org This allows you to send and receive SMS through your mailbox. Powered by Outblaze
On Mon 29 May 2006, martin aa wrote:> Hi Rsync-ers > > I'm simply using rsync to do an exact copy of my root (and home) partition by using the -aHv options. > > When the copy is complete, I modify fstab so my root and home mount points are pointing to the newly copied partitions.Do you also actually boot with the new root filesystem? Modifying only the fstab can lead to very confusing situations. Don't forget that the kernel has to mount the root filesystem before it can read the fstab; look at what is passed at boot time in the root= parameter.> Just to be sure it was rsync, I completed deleted my original root and home partitions (it's okay, it was a new installation) and then copied everything back (again using the -aHv options). However, I ended up with exactly the same problem.I've just been busy with a new system, and I've been copying over the root filesystem multiple times with rsync, without any such problems whatsoever, so at least for me rsync works just fine for that task. Paul Slootman
> On Mon 29 May 2006, martin aa wrote: > > Hi Rsync-ers > > > > I'm simply using rsync to do an exact copy of my root (and home) > > partition by using the -aHv options. > > > > When the copy is complete, I modify fstab so my root and home > > mount points are pointing to the newly copied partitions. > > Do you also actually boot with the new root filesystem? Modifying only > the fstab can lead to very confusing situations. Don't forget that the > kernel has to mount the root filesystem before it can read the fstab; > look at what is passed at boot time in the root= parameter.Hi Paul - thanks very much for your reply. Yes, I'm sorry, but I should have mentioned that I also modified the boot parameters to the kernel (in /boot/grub/grub.conf) to access the correct partition for the root mount point. So, I'm definitely confident that the new root filesystem is being booted. (Note also that even if that were not the case, when I copied the file system back to the original partition it would work again - which, as I said in my original post, it doesn't.)> > Just to be sure it was rsync, I completed deleted my original > > root and home partitions (it's okay, it was a new installation) > > and then copied everything back (again using the -aHv options). > > However, I ended up with exactly the same problem. > > I've just been busy with a new system, and I've been copying over the > root filesystem multiple times with rsync, without any such problems > whatsoever, so at least for me rsync works just fine for that task.Well, that is interesting. I'm using FC5 and, by the looks of your domain name, you're using a debian-based distro. So, I really can't work out what is happening here. As I said in my original post, I can't see how it could be anything other than rsync doing this, but I just can't see how. My understanding is that by using -aH you preserve absolutely everything. Is there some type of file that rsync just can't accurately copy? Anyway, again, thanks for providing this info. It will be interesting to see if anyone else has had this problem with FC5 or any other distro. But why should the distro matter?? - all very strange! I'm looking forward to getting to the bottom of this one. Regards, Martin -- _______________________________________________ Check out the latest SMS services @ http://www.linuxmail.org This allows you to send and receive SMS through your mailbox. Powered by Outblaze
> ----- Original Message ----- > From: "Matt McCutchen" <hashproduct+rsync@gmail.com> > To: "martin aa" <martinaa@linuxmail.org> > Subject: Re: Rsync - does it really do an *exact* copy? > Date: Mon, 29 May 2006 15:50:35 -0400 > > > On Mon, 2006-05-29 at 17:55 +0200, Paul Slootman wrote: > > On Mon 29 May 2006, martin aa wrote: > > > > > > I've just been busy with a new system, and I've been copying over the > > > > root filesystem multiple times with rsync, without any such problems > > > > whatsoever, so at least for me rsync works just fine for that task. > > > > Well, that is interesting. I'm using FC5 and, by the looks > > of your domain name, you're using a debian-based distro. So, I > > really can't work out what is happening here. As I said in my > > original post, I can't see how it could be anything other than > > rsync doing this, but I just can't see how. My understanding is > > that by using -aH you preserve absolutely everything. Is there > > some type of file that rsync just can't accurately copy? > > > > Perhaps extended attributes, if they're used in FC5? If so, I'd expect > > the FC5 version of rsync to support those (although maybe you need an > > extra option for that?) Alternatively, some SE-Linux complications? > > In other words, something's probably involved that's not "old school" > > unix. > > If SE-Linux is enabled, there's a very good chance that it is causing > the problem. SE-Linux expects each file on the system to carry a > security context in the extended attribute "security.selinux". The > kernel assigns contexts to newly created files automatically based on > the system's policy. If a file carries the wrong context, the kernel > may prevent users, even root, from accessing it. > > I'm guessing that, when you ran rsync, the system was running on the old > partitions and had the new ones mounted somewhere in /mnt or /media. If > you did not ask rsync to preserve extended attributes (-X or --xattrs), > the files created on the mounted partitions probably got generic "file > on removable device" contexts, not the contexts that they would need for > a system to run on them. > > Boot your system once with SE-Linux disabled by passing the argument > "selinux=0" to the kernel. If you use Grub, just press the appropriate > key to "edit the kernel arguments before booting". If the system then > lets you log in, SE-Linux was the problem, and you should either disable > it permanently by putting "selinux=0" in your grub.conf or fix all the > file contexts by running "restorecon -r /". > > MattFixed! Thanks very much Paul and Matt - very good advice! It was SE-Linux that was the culprit as you suggested. And you were right Matt that the extended attributes were not copied across. I don't think I would have had this problem if the man page was correct. With the FC5 distro, the man page for rsync doesn't match the version (which is 2.6.6). That is, if I 'man rsync' there is no information at all in regards to the -X (--xattrs) option. (Nor does the man page say anything about the -A (--acls) option.) However, the usage information (running rsync --help) shows both these options. A lot of time would have been saved if that inconsistancy hadn't existed - oh well, as they say: "rsync comes with ABSOLUTELY NO WARRANTY" (!) Also, the man page (and usage info) says for the -a option: -a, --archive archive mode; equivalent to -rlptgoD (no -H) which, IMHO, I think should actually say: -a, --archive archive mode; equivalent to -rlptgoD (no -H, -X, -A) Thanks again for your insightful advice. Regards, Martin Ps. What about a supercharged archive option (like -aa) which does -rlptgoDHXA ?? -- _______________________________________________ Check out the latest SMS services @ http://www.linuxmail.org This allows you to send and receive SMS through your mailbox. Powered by Outblaze
On Wed, May 31, 2006 at 11:18:03PM +1000, martin aa wrote:> which, IMHO, I think should actually say: > -a, --archive archive mode; equivalent to -rlptgoD (no -H, -X, -A)This is a good idea. I updated the acls.diff and xattrs.diff patches in CVS so that they update this summary line. ..wayne..