[gentoo-user] Merging separate /usr back into / - one last time...
Hi all, This was discussed within a couple of threads in the last few months, but I wanted to ask for final clarification before I go ahead with this (yeah, I know, 'paranoia will destroy ya')... I'm not afraid of an initramfs any more, but I've decided that I still just really don't want one, so I'm looking for the safest simplest way to merge my separate /usr back into /. The only thing I'm really unsure of is the optimal method and exact syntax (ie, trailing slashes? arguments?) for the actual copy of /usr. Is rsync -a enough for my relatively simple system setup, or would using any or all of the other options suggested in those threads be safer/better? Specifically: -a, or -axAHX, or -apogXx, or -PvasHAX or should I go with a combined -apogsvxAHPX ? So, here's the plan, please check me... 1. Boot off of the latest gentoo LiveDVD 2. Mount / and create new /usr directory mount /dev/sda3 /mnt/gentoo/ mkdir /mnt/gentoo/usr 3. Mount old /usr to be moved/merged vgscan vgchange -a y mount /dev/vg/usr /mnt/gentoo/oldusr 4. Copy /oldusr to /usr rsync -a? /mnt/gentoo/oldusr/ /mnt/gentoo/usr/ Are the trailing slashes required/important/necessary? Which arguments should I use? 5. Edit /etc/fstab and comment/remove the /usr line nano -wc /mnt/gentoo/etc/fstab #/dev/vg/usr /usrreiserfsnoatime 0 0 6. Unmount mounted filesystems umount /mnt/gentoo/oldusr umount /mnt/gentoo 7. Reboot into new system Done? I'm pretty sure that: 1. There is no need to chroot into the real system during this process, and 2. I only need to mount / and the old /usr, no need to mount anything else (/proc, /sys, /var, /home, activating swap, etc) Correct? Thanks
Re: [gentoo-user] Merging separate /usr back into / - one last time...
On Mon, Dec 02 2013, tansta...@libertytrek.org wrote: Is rsync -a enough for my relatively simple system setup, or would using any or all of the other options suggested in those threads be safer/better? Specifically: -a, or -axAHX, or -apogXx, or -PvasHAX I am not an expert but here goes. -x would not hurt but should not be needed since i believe that your current /dev/vg/usr is just one partition. I didn't need -X -A because I don't have acls or extended attributes or should I go with a combined -apogsvxAHPX ? So, here's the plan, please check me... 1. Boot off of the latest gentoo LiveDVD 2. Mount / and create new /usr directory I am missing something. I would have thought your old / (dev/sda3) already has an empty /usr directory where you previously mounted /dev/vg/usr mount /dev/sda3 /mnt/gentoo/ mkdir /mnt/gentoo/usr 3. Mount old /usr to be moved/merged vgscan vgchange -a y mount /dev/vg/usr /mnt/gentoo/oldusr 4. Copy /oldusr to /usr This suggests that your current root (dev/sda3) is big enough to include the previous /usr (dev/vg/usr). That is indeed a simple case. Many of us had to move partitions around to get a big enough partition for / + /usr. rsync -a? /mnt/gentoo/oldusr/ /mnt/gentoo/usr/ Are the trailing slashes required/important/necessary? The first trailing slash (oldusr/) is important. Without it, you would be creating the directory /mnt/gentoo/usr/oldusr. With it (as you wrote) just the contents of /oldusr are copied not the directory itself. So yes you want that slash. I don't believe the 2nd trailing / (usr/) is needed, but doesn't hurt. The rsync man page shows both uses and I don't see any words saying anything about the difference. I must say I never noticed the two different uses in the man page can't remember what I used. But again, I believe the results are the same. Which arguments should I use? Discussed above 5. Edit /etc/fstab and comment/remove the /usr line nano -wc /mnt/gentoo/etc/fstab #/dev/vg/usr /usrreiserfsnoatime 0 0 6. Unmount mounted filesystems umount /mnt/gentoo/oldusr umount /mnt/gentoo 7. Reboot into new system Done? I'm pretty sure that: 1. There is no need to chroot into the real system during this process, and 2. I only need to mount / and the old /usr, no need to mount anything else (/proc, /sys, /var, /home, activating swap, etc) Correct? Both of these seem correct to me. Good luck! allan
Re: [gentoo-user] Merging separate /usr back into / - one last time...
On 2013-12-02 11:26 AM, gottl...@nyu.edu gottl...@nyu.edu wrote: On Mon, Dec 02 2013, tansta...@libertytrek.org wrote: So, here's the plan, please check me... 1. Boot off of the latest gentoo LiveDVD 2. Mount / and create new /usr directory I am missing something. I would have thought your old / (dev/sda3) already has an empty /usr directory where you previously mounted /dev/vg/usr Hmmm... I guess you're right, although I guess I'd have realized that as soon as I mounted / to /mnt/gentoo and did an ls... 4. Copy /oldusr to /usr This suggests that your current root (dev/sda3) is big enough to include the previous /usr (dev/vg/usr). Yep, plenty of room... Are you saying you went through this too? Hopefully a few others will chime in with more on the exact rsync arguments I should use... Thanks Allan... :)
[gentoo-user] Help to upgrade perl?
Hey, all -- I have two systems, one of which got perl 5.16.1, somehow. My other system is still at perl 5.12... and I'm having a heck of a time trying to upgrade that system to 5.16.1. Is there some trick that I should recall? This is what I tried: USE=-build emerge -v =dev-lang/perl-5.16.1 And this is what I got: (dev-lang/perl-5.12.4-r1::gentoo, installed) pulled in by ~dev-lang/perl-5.12.4 required by (virtual/perl-i18n-langtags-0.35::gentoo, installed) (dev-lang/perl-5.16.1::gentoo, ebuild scheduled for merge) pulled in by =dev-lang/perl-5.16.1 =dev-lang/perl-5.16 required by (dev-perl/IO-Socket-SSL-1.840.0::gentoo, installed) =dev-lang/perl-5.16* required by (virtual/perl-digest-base-1.170.0-r1::gentoo, installed) (and 144 more with the same problems) 144 more with the same problem? There must be some incantation that handles all that, no? Thanks for any pointers, foax! Cheers, - Michael Higgins
Re: [gentoo-user] Merging separate /usr back into / - one last time...
on 12/02/2013 04:02 PM Tanstaafl wrote the following: So, here's the plan, please check me... 1. Boot off of the latest gentoo LiveDVD If you boot a different system to do the rsync, or, if you do it over ssh, add the option --numeric-ids I usually do rsync -aHvxW --numeric-ids --delete sourcedit/ targetdir/
Re: [gentoo-user] Merging separate /usr back into / - one last time...
On 2013-12-02 1:47 PM, Thanasis thana...@asyr.hopto.org wrote: on 12/02/2013 04:02 PM Tanstaafl wrote the following: So, here's the plan, please check me... 1. Boot off of the latest gentoo LiveDVD If you boot a different system to do the rsync, or, if you do it over ssh, add the option --numeric-ids Thanks, but no, like I said, I'll just boot that system to a LiveDVD and do it from there... So, I guess my main question is... Would it hurt anything to use all of the args: ie... -apogsvxAHPX I guess I may be overthinking this (again)...
[gentoo-user] Tinkerforge Software
has anyone maybe already written ebuilds for brickd and brickv for accessing tinkerforge hardware? http://www.tinkerforge.com/en/doc/index.html#software I managed to get brickd running here but so far no success with brickv. Planning to run that with Nagios ... Greets, Stefan
Re: [gentoo-user] Merging separate /usr back into / - one last time...
An alternative to booting to external media, etc, would be a bind mount of / and /usr on separate temporary mount points, then dumping the data between them, leaving the existing system chugging along. A re-mount of the current /usr in -o ro mode might not be a terrible idea in that case. I had a good bit of luck going that route. A simple cp -a did the trick on the one system I've bothered with it on so far. I have a couple laptops that're rushing headlong into unsupported land right now though, so I'll be revisiting this soon enough. As for specifics: # Make the temporary working areas mkdir /tmp/a; mkdir /tmp/b # Make sure nothing changes in /usr while the copy is done mount -o remount,ro /usr # Mount a mirror of the source and destination filesystems mount --bind /usr/ /tmp/a mount --bind / /tmp/b # And now, copy. cd /tmp/a cp -a ./ /tmp/b/usr/ The one big point of what not to do would be mount --rbind. Very important (recursive bind would have the current /usr still visible in /tmp/b/usr/). After all that, comment out /usr in fstab and reboot. You *could* even just drop to a minimal runlevel that doesn't require /usr, unmount the old one and then jump back to your standard runlevel, but due to the reasons this is required now, I'm not entirely sure that option exists anymore (i.e. too much is dependent on /usr). That said, if you are booting to a LiveDVD -- On Mon, Dec 2, 2013 at 1:58 PM, Tanstaafl tansta...@libertytrek.org wrote: On 2013-12-02 1:47 PM, Thanasis thana...@asyr.hopto.org wrote: on 12/02/2013 04:02 PM Tanstaafl wrote the following: So, here's the plan, please check me... 1. Boot off of the latest gentoo LiveDVD If you boot a different system to do the rsync, or, if you do it over ssh, add the option --numeric-ids Thanks, but no, like I said, I'll just boot that system to a LiveDVD and do it from there... That actually does fall under boot a different system since the users won't line up between a LiveDVD and your actual system. -- Poison [BLX] Joshua M. Murphy
Re: [gentoo-user] Merging separate /usr back into / - one last time...
On 2013-12-02 2:25 PM, Poison BL. poiso...@gmail.com wrote: An alternative to booting to external media, etc, would be a bind mount of / and /usr on separate temporary mount points, then dumping the data between them, leaving the existing system chugging along. A re-mount of the current /usr in -o ro mode might not be a terrible idea in that case. snip Not comfortable doing that on a productions server at all... but thanks anyway... :) That said, if you are booting to a LiveDVD -- On Mon, Dec 2, 2013 at 1:58 PM, Tanstaafl tansta...@libertytrek.org wrote: Thanks, but no, like I said, I'll just boot that system to a LiveDVD and do it from there... That actually does fall under boot a different system since the users won't line up between a LiveDVD and your actual system. Hmmm, ok, but if I chroot'd into the system (ie, like I might do if I had an interrupted install, and wanted to pick it back up), that would solve that? Or, I could just figure out the right rsync arguments to use... ;) I just asked on the rsync list too, maybe someone there will chime in with a little more confidence...
Re: [gentoo-user] Merging separate /usr back into / - one last time...
on 12/02/2013 08:58 PM Tanstaafl wrote the following: On 2013-12-02 1:47 PM, Thanasis thana...@asyr.hopto.org wrote: on 12/02/2013 04:02 PM Tanstaafl wrote the following: So, here's the plan, please check me... 1. Boot off of the latest gentoo LiveDVD If you boot a different system to do the rsync, or, if you do it over ssh, add the option --numeric-ids Thanks, but no, like I said, I'll just boot that system to a LiveDVD and do it from there... Are you sure the user IDs of the LiveDVD are the same as the other system's users' IDs? That is why I recommend using the option --numeric-ids. And using it would not hurt anyway.
Re: [gentoo-user] Help to upgrade perl?
On 02/12/2013 19:41, Michael Higgins wrote: Hey, all -- I have two systems, one of which got perl 5.16.1, somehow. My other system is still at perl 5.12... and I'm having a heck of a time trying to upgrade that system to 5.16.1. Is there some trick that I should recall? This is what I tried: USE=-build emerge -v =dev-lang/perl-5.16.1 And this is what I got: (dev-lang/perl-5.12.4-r1::gentoo, installed) pulled in by ~dev-lang/perl-5.12.4 required by (virtual/perl-i18n-langtags-0.35::gentoo, installed) (dev-lang/perl-5.16.1::gentoo, ebuild scheduled for merge) pulled in by =dev-lang/perl-5.16.1 =dev-lang/perl-5.16 required by (dev-perl/IO-Socket-SSL-1.840.0::gentoo, installed) =dev-lang/perl-5.16* required by (virtual/perl-digest-base-1.170.0-r1::gentoo, installed) (and 144 more with the same problems) 144 more with the same problem? There must be some incantation that handles all that, no? Thanks for any pointers, foax! Cheers, - Michael Higgins emerge -avuND world Why 5.16.1? that is the lowest version that is ~arch; your next sync and update is going to want to upgrade it anyway. Lots of things have been moving around in perl land, modules moving into core etc etc. A proper world update takes care of all the necessary blockers. Or, seeing as you are going to remerge everything perl related anyway, you might as well just undelete everything perl-related (keeping an accurate list), and then merge the whole lot back -- Alan McKinnon alan.mckin...@gmail.com
Re: [gentoo-user] Merging separate /usr back into / - one last time...
On 2013-12-02 2:41 PM, Thanasis thana...@asyr.hopto.org wrote: on 12/02/2013 08:58 PM Tanstaafl wrote the following: On 2013-12-02 1:47 PM, Thanasis thana...@asyr.hopto.org wrote: on 12/02/2013 04:02 PM Tanstaafl wrote the following: So, here's the plan, please check me... 1. Boot off of the latest gentoo LiveDVD If you boot a different system to do the rsync, or, if you do it over ssh, add the option --numeric-ids Thanks, but no, like I said, I'll just boot that system to a LiveDVD and do it from there... Are you sure the user IDs of the LiveDVD are the same as the other system's users' IDs? That is why I recommend using the option --numeric-ids. And using it would not hurt anyway. Right... poison pointed this out... This is why I asked for help about the arguments. I honestly don't care about superflous/unnecessary arguments, I just want to make sure I use at least the ones needed for this to work. Thanks...
Re: [gentoo-user] Help to upgrade perl? [SOLVED]
On Mon, 02 Dec 2013 22:24:35 +0200 Alan McKinnon alan.mckin...@gmail.com wrote: emerge -avuND world /me slaps forehead. Of course. :( Why 5.16.1? that is the lowest version that is ~arch; your next sync and update is going to want to upgrade it anyway. Ah, well, I'm not running ~arch anywhere and so not sure why my public server got 5.16.1 to begin. So, I'm just updating the development machine to match. Lots of things have been moving around in perl land, modules moving into core etc etc. A proper world update takes care of all the necessary blockers. Yes. Perl surely is a PITA for the distro to maintain. Or, seeing as you are going to remerge everything perl related anyway, you might as well just undelete everything perl-related (keeping an accurate list), and then merge the whole lot back This kind of on-the-side bookkeeping is exactly what I'm trying to avoid. But I do get your point. ;-) Looks like I'm good to go, as perl is updating and perl-cleaner --all after the fact should be fine, I'm guessing. And if not, I know what I'm in for, mostly. Thanks! Cheers, - Michael
Re: [gentoo-user] Merging separate /usr back into / - one last time...
On Monday 02 Dec 2013 20:40:28 Tanstaafl wrote: On 2013-12-02 2:41 PM, Thanasis thana...@asyr.hopto.org wrote: That is why I recommend using the option --numeric-ids. And using it would not hurt anyway. Right... poison pointed this out... This is why I asked for help about the arguments. I honestly don't care about superflous/unnecessary arguments, I just want to make sure I use at least the ones needed for this to work. Thanks... The comment about --numeric-ids that Thanasis made is valid. I messed up some fs of mine last time I used rsync, when I wasn't paying much attention! I made a mental note to always use it in the future. On the other hand, if you're not that comfortable with it, a quick trial run with a test filesystem will offer some assurance that your chosen command and options will work as you intended. BTW, you do not *have* to use rsync: cp -a will do the same. su - cd /old_usr tar --one-file-system -cf . | (cd /new_usr ; tar -xvpf - ) will also do the same. Finally, star -copy is my favourite faster alternative to copying directories, inc. respecting any acl's and the like if you specify it in the options: su - star -copy options -C /old_usr . /new_usr Then you can also add -diff to see if any file was not copied correctly (use star diffopts=!option to exclude things like ctime, or you'll drown in the noise of the output). Speaking from experience I suggest that you do not blast your old /usr away until you have booted with /usr mounted in the new location and have verified that ownership and access rights are as you expected. -- Regards, Mick signature.asc Description: This is a digitally signed message part.
Re: [gentoo-user] Merging separate /usr back into / - one last time...
You are looking far too deep just rsync -avP to /newusr reboot to livecd rsync again with --delete to update ... takes a only few seconds this time - minimal downtime :) mv /usr /oldusr mv /newusr /usr reboot The --numeric-ids is a good idea but I've made my systems consistent with the standard gentoo id's so that's no longer a problem. Ive done this many times over the years, and to the system I am writing this on many times (moving to lvm2, restoring from backups after disk failures, restoring from backups after user failure - rm -rf /usr !) If you need to practice, run up a vm and test/destroy :) You have got the disk space, so if you have a backup its reversible so don't be a wimp :) BillK On 03/12/13 05:36, Mick wrote: On Monday 02 Dec 2013 20:40:28 Tanstaafl wrote: On 2013-12-02 2:41 PM, Thanasis thana...@asyr.hopto.org wrote: That is why I recommend using the option --numeric-ids. And using it would not hurt anyway. Right... poison pointed this out... This is why I asked for help about the arguments. I honestly don't care about superflous/unnecessary arguments, I just want to make sure I use at least the ones needed for this to work. Thanks... The comment about --numeric-ids that Thanasis made is valid. I messed up some fs of mine last time I used rsync, when I wasn't paying much attention! I made a mental note to always use it in the future. On the other hand, if you're not that comfortable with it, a quick trial run with a test filesystem will offer some assurance that your chosen command and options will work as you intended. BTW, you do not *have* to use rsync: cp -a will do the same. su - cd /old_usr tar --one-file-system -cf . | (cd /new_usr ; tar -xvpf - ) will also do the same. Finally, star -copy is my favourite faster alternative to copying directories, inc. respecting any acl's and the like if you specify it in the options: su - star -copy options -C /old_usr . /new_usr Then you can also add -diff to see if any file was not copied correctly (use star diffopts=!option to exclude things like ctime, or you'll drown in the noise of the output). Speaking from experience I suggest that you do not blast your old /usr away until you have booted with /usr mounted in the new location and have verified that ownership and access rights are as you expected.
Re: [gentoo-user] Merging separate /usr back into / - one last time...
On Mon, Dec 02 2013, tansta...@libertytrek.org wrote: On 2013-12-02 11:26 AM, gottl...@nyu.edu gottl...@nyu.edu wrote: On Mon, Dec 02 2013, tansta...@libertytrek.org wrote: So, here's the plan, please check me... 1. Boot off of the latest gentoo LiveDVD 2. Mount / and create new /usr directory I am missing something. I would have thought your old / (dev/sda3) already has an empty /usr directory where you previously mounted /dev/vg/usr Hmmm... I guess you're right, although I guess I'd have realized that as soon as I mounted / to /mnt/gentoo and did an ls... 4. Copy /oldusr to /usr This suggests that your current root (dev/sda3) is big enough to include the previous /usr (dev/vg/usr). Yep, plenty of room... Are you saying you went through this too? Yes I did, but did not have the room to simply stick /usr into /. Like you I had lvm. Hopefully a few others will chime in with more on the exact rsync arguments I should use... Thanks Allan... :) My pleasure. allan
Re: [gentoo-user] Merging separate /usr back into / - one last time...
On Tue, 03 Dec 2013 06:24:43 +0800, William Kenworthy wrote: You have got the disk space, so if you have a backup its reversible so don't be a wimp :) It's reversible even if there is no backup, because data it copied from /usr to /, not moved. If the new /usr doesn't work for any reason, just mount the old one on it. -- Neil Bothwick Unthinking respect for authority is the greatest enemy of truth. (Albert Einstein) signature.asc Description: PGP signature
Re: [gentoo-user] Merging separate /usr back into / - one last time...
2013/12/2 William Kenworthy bi...@iinet.net.au You are looking far too deep just rsync -avP to /newusr +1 I have done this more or less the same way reboot to livecd rsync again with --delete to update ... takes a only few seconds this time - minimal downtime :) mv /usr /oldusr mv /newusr /usr reboot Let's make this thread more interesting, would it be possible to do this without a reboot? ie: going single user mode, kill anything that might still be running from usr, umount /usr, mount it to /mnt, rsync -avP to usr, going again into runlevel 3 or 5. Obviously not possible if running systemd. The --numeric-ids is a good idea but I've made my systems consistent with the standard gentoo id's so that's no longer a problem. Ive done this many times over the years, and to the system I am writing this on many times (moving to lvm2, restoring from backups after disk failures, restoring from backups after user failure - rm -rf /usr !) If you need to practice, run up a vm and test/destroy :) You have got the disk space, so if you have a backup its reversible so don't be a wimp :) BillK On 03/12/13 05:36, Mick wrote: On Monday 02 Dec 2013 20:40:28 Tanstaafl wrote: On 2013-12-02 2:41 PM, Thanasis thana...@asyr.hopto.org wrote: That is why I recommend using the option --numeric-ids. And using it would not hurt anyway. Right... poison pointed this out... This is why I asked for help about the arguments. I honestly don't care about superflous/unnecessary arguments, I just want to make sure I use at least the ones needed for this to work. Thanks... The comment about --numeric-ids that Thanasis made is valid. I messed up some fs of mine last time I used rsync, when I wasn't paying much attention! I made a mental note to always use it in the future. On the other hand, if you're not that comfortable with it, a quick trial run with a test filesystem will offer some assurance that your chosen command and options will work as you intended. BTW, you do not *have* to use rsync: cp -a will do the same. su - cd /old_usr tar --one-file-system -cf . | (cd /new_usr ; tar -xvpf - ) will also do the same. Finally, star -copy is my favourite faster alternative to copying directories, inc. respecting any acl's and the like if you specify it in the options: su - star -copy options -C /old_usr . /new_usr Then you can also add -diff to see if any file was not copied correctly (use star diffopts=!option to exclude things like ctime, or you'll drown in the noise of the output). Speaking from experience I suggest that you do not blast your old /usr away until you have booted with /usr mounted in the new location and have verified that ownership and access rights are as you expected. PD: sorry if my english is not so good
Re: [gentoo-user] Merging separate /usr back into / - one last time...
On 03/12/13 12:34, Jc García wrote: 2013/12/2 William Kenworthy bi...@iinet.net.au You are looking far too deep just rsync -avP to /newusr +1 I have done this more or less the same way reboot to livecd rsync again with --delete to update ... takes a only few seconds this time - minimal downtime :) mv /usr /oldusr mv /newusr /usr reboot Let's make this thread more interesting, would it be possible to do this without a reboot? ie: going single user mode, kill anything that might still be running from usr, umount /usr, mount it to /mnt, rsync -avP to usr, going again into runlevel 3 or 5. Obviously not possible if running systemd. I did try it single user mode - it works but I rebooted when the pressure came off just in case. Wanted minimal downtime. BillK
Re: [gentoo-user] Merging separate /usr back into / - one last time...
On Mon, Dec 2, 2013 at 10:34 PM, Jc García jyo.gar...@gmail.com wrote: 2013/12/2 William Kenworthy bi...@iinet.net.au You are looking far too deep just rsync -avP to /newusr +1 I have done this more or less the same way reboot to livecd rsync again with --delete to update ... takes a only few seconds this time - minimal downtime :) mv /usr /oldusr mv /newusr /usr reboot Let's make this thread more interesting, would it be possible to do this without a reboot? ie: going single user mode, kill anything that might still be running from usr, umount /usr, mount it to /mnt, rsync -avP to usr, going again into runlevel 3 or 5. Obviously not possible if running systemd. I'm not so sure it's not possible. Perhaps it's even easier. If you do systemctl isolate emergency.target then remount / read/write, do the move, and then again isolate multi-user.target or graphical.target, I think is possible. I will try on a virtual machine; is an interesting question. You would need to use absolute pathnames when actually performing the move, but I think is possible. Regards. -- Canek Peláez Valdés Posgrado en Ciencia e Ingeniería de la Computación Universidad Nacional Autónoma de México