Re: [gentoo-user] Initramfs or move /usr to /, oh my...
On Tue, 20 Mar 2012 22:02:31 -0400, Joshua Murphy wrote: > 1) make backups and... 1.a) verify backups... consider this my > disclaimer... 2) mkdir /mnt/root-bind/ /mnt/usr-bind/ > 3) mount --bind / /mnt/root-bind/ > 4) mount --bind /usr/ /mnt/usr-bind/ 4a) mount /usr -o remount,ro Makes sure nothing changes on /usr between starting the sync and rebooting. > 5) rsync --archive --hard-links --sparse --progress /mnt/usr-bind/ > /mnt/root-bind/usr/ > 6) edit fstab ... > 7) cross fingers and reboot ... > 8) rm -r /mnt/root-bind/ /mnt/usr-bind/ Create the temporary mounts points in /tmp and you save this step - since I added one, it is only fair to remove one to not increase the workload :) -- Neil Bothwick When companies ship Styrofoam, what do they pack it in? signature.asc Description: PGP signature
Re: [gentoo-user] Initramfs or move /usr to /, oh my...
On 03/21/2012 03:02 AM, Joshua Murphy wrote: > 1) make backups and... 1.a) verify backups... consider this my disclaimer... > 2) mkdir /mnt/root-bind/ /mnt/usr-bind/ > 3) mount --bind / /mnt/root-bind/ > 4) mount --bind /usr/ /mnt/usr-bind/ > 5) rsync --archive --hard-links --sparse --progress /mnt/usr-bind/ > /mnt/root-bind/usr/ At first it looked like you were copying things onto themselves. Then I noticed I was wrongly assuming --rbind mount operation rather than the actual plain --bind that you use. Nice approach! Best, Sebastian
Re: [gentoo-user] Initramfs or move /usr to /, oh my...
On Mon, Mar 19, 2012 at 9:28 PM, Sebastian Pipping wrote: > On 03/18/2012 06:44 PM, Tanstaafl wrote: >> On that note - is it possible, and if so, does anyone have any decent >> detailed How-to's on how I might be able to convert a separate /user to >> one on directly on / on a running system? > > From my current understanding (please double-check, no warrenties): > > 0. Make backups > > 1. Boot some sort of live/rescue CD > (so you can fiddle with /usr without shooting your foot) > > (2. Enlarge space on partition/device (the one holding /)) > > (3. Enlarge file system sitting on partition/device ) > > 4. Make a new folder /usr > > 5. Copy content from / to /usr/ > > - Watch out for use of Xattr (extended file attributes) > > - Watch out for use of POSIX ACLs > > - Use something like --archive with cp/rsync to maintain attributes > > 6. Update /etc/fstab > > 7. Reboot > > 8. Resolve partition > > Good luck. > > Best, > > > > Sebastian > That would work, and is among the safer routes, but it also means taking the system down for a fair while. If your root has enough free space to hold all of /usr already, without any resizing, you actually can do everything with only a single reboot along the way (and while that, too, *can* be avoided with a lazy unmount in place of the reboot [see notes at the bottom if you're feeling adventurous], I don't dare test it when a reboot's far from likely to hurt me), as long as you can resist making changes to files in /usr between starting and your reboot. The difficulty you run into is that you can't copy from /usr/* (the data on the usr partition) directly into /usr (a folder acting as a mount point on the root partition). What you *can* do, however, is bind mount your root partition somewhere else, and your usr partition too if you like, make the copy (using tar, rsync, or cp with the appropriate flags to preserve all the important details), adjust fstab, and then reboot into the adjusted system, after which, you can go about pondering what to do with your old /usr partition. Incidentally, this general method also works fairly well for taking snapshots of a live root partition (accepting that the contents of anything prone to change mid-copy could be anything, like /tmp, most of /var, bits of /etc), catching the static files hidden by mounting done at boot time, like the base set of device nodes in /dev too... As root, obviously, and you may include --acls or --xattrs on the rsync call, if they suit your system's needs (I have quite a bit turned off on the machine I'm testing this on as I write it up): 1) make backups and... 1.a) verify backups... consider this my disclaimer... 2) mkdir /mnt/root-bind/ /mnt/usr-bind/ 3) mount --bind / /mnt/root-bind/ 4) mount --bind /usr/ /mnt/usr-bind/ 5) rsync --archive --hard-links --sparse --progress /mnt/usr-bind/ /mnt/root-bind/usr/ 6) edit fstab ... 7) cross fingers and reboot ... 8) rm -r /mnt/root-bind/ /mnt/usr-bind/ While 9 can be done before the reboot, this way doesn't depend on fighting with unmounting outside of the reboot itself. And some background on my test system... # df -h Filesystem Size Used Avail Use% Mounted on rootfs 7.9G 128M 7.7G 2% / /dev/root 7.9G 128M 7.7G 2% / rc-svcdir 1.0M 56K 968K 6% /lib64/rc/init.d udev 10M 176K 9.9M 2% /dev shm 2.0G 0 2.0G 0% /dev/shm /dev/sda1 505M 15M 465M 3% /boot /dev/sda815G 845M 14G 6% /var /dev/sda720G 2.0G 18G 10% /usr /dev/sda949G 3.2G 46G 7% /home tmpfs 2.0G 4.0K 2.0G 1% /tmp # df -h Filesystem Size Used Avail Use% Mounted on rootfs 7.9G 2.1G 5.8G 27% / /dev/sda720G 2.0G 18G 10% /usr # df -h Filesystem Size Used Avail Use% Mounted on rootfs 7.9G 2.0G 5.9G 26% / /dev/root 7.9G 2.0G 5.9G 26% / rc-svcdir 1.0M 56K 968K 6% /lib64/rc/init.d udev 10M 176K 9.9M 2% /dev shm 2.0G 0 2.0G 0% /dev/shm /dev/sda1 505M 15M 465M 3% /boot /dev/sda815G 844M 14G 6% /var /dev/sda949G 3.2G 46G 7% /home /dev/sda10 141G 7.9G 133G 6% /data tmpfs 2.0G 0 2.0G 0% /tmp And... at least for my own, copied, rebooted, and working as though nothing's changed (aside from a presently unused 20G partition sitting around on the drive). I do admit, my 8G existing root partition is a bit on the large size.. this system transitioned from a desktop to a 'server', losing X as well as a number of hefty things that were in /opt ... leaving me with both a lot of free space on / and a much more slim /usr so it's a rare thing to be able to so easily drop things in place. It did manage a downtime of all of about a minute, though, rather than booting a secondary OS to do all of that. [notes regarding a potentially bad idea follow] Lastly, on the topic of avoiding the reboot altogether, the
Re: [gentoo-user] Initramfs or move /usr to /, oh my...
On 03/20/2012 09:43 AM, Neil Bothwick wrote: > If you keep a separate directory for your initramfs files, this is true. > But if your initramfs config is a list of files to include, the current > versions of everything will always be included. Fair point. Best, Sebastian
Re: [gentoo-user] Initramfs or move /usr to /, oh my...
On Tue, 20 Mar 2012 02:28:20 +0100, Sebastian Pipping wrote: > A manual initramfs is not that easy, no. And it becomes outdated more > easily than an initramfs-creator-based approach. If you keep a separate directory for your initramfs files, this is true. But if your initramfs config is a list of files to include, the current versions of everything will always be included. -- Neil Bothwick "If you can't explain it simply, you don't understand it well enough." (Albert Einstein) signature.asc Description: PGP signature
Re: [gentoo-user] Initramfs or move /usr to /, oh my...
On 03/18/2012 06:44 PM, Tanstaafl wrote: > Ok, I have never used genkernel, and have no desire to... > > I have no idea what dracut is or how to use it... While genkernel also can generate kernel configs for you, both dracut and genkernel are initramfs creators: they take repeated creation (after each kernel update) of a potentially complex initramfs off your shoulders. > I have a remote system that has /usr on a separate partition. > > So... > > How do I find out if I am actually *using* an initramfs right now (I > know it is built into the kernel) Afaik the in-kernel one is a dummy, only. If you don't remember anything about genkernel or dracut from the past you do not have an initramfs in your Gentoo installation(s). >, and > > If I am not, how do I do this without using genkernel? Is dracut the > *only* other option? Is it easy/trivial to set one up manually? A manual initramfs is not that easy, no. And it becomes outdated more easily than an initramfs-creator-based approach. > On that note - is it possible, and if so, does anyone have any decent > detailed How-to's on how I might be able to convert a separate /user to > one on directly on / on a running system? >From my current understanding (please double-check, no warrenties): 0. Make backups 1. Boot some sort of live/rescue CD (so you can fiddle with /usr without shooting your foot) (2. Enlarge space on partition/device (the one holding /)) (3. Enlarge file system sitting on partition/device ) 4. Make a new folder /usr 5. Copy content from / to /usr/ - Watch out for use of Xattr (extended file attributes) - Watch out for use of POSIX ACLs - Use something like --archive with cp/rsync to maintain attributes 6. Update /etc/fstab 7. Reboot 8. Resolve partition Good luck. Best, Sebastian
Re: [gentoo-user] Initramfs or move /usr to /, oh my...
On Sun, 18 Mar 2012 21:57:39 -0400 (EDT), Bruce Hill, Jr. wrote: > > > How do I find out if I am actually *using* an initramfs right now > > > (I know it > > > is built into the kernel), and > > ls -l /boot/ will tell you. No it won't, as the initramfs can be built into the kernel image. > There is a difference between an initrd (initial RAM disk) image > (simple) and an initramfs (initial RAM filesystem) (complicated). I think you have that the wrong way round. An initramfs is simpler in that you don't have to worry about creating a filesystem or even creating the image file, just give the kernel compilation process a file containing a list of what should be in it. -- Neil Bothwick Middle-age - because your age starts to show at your middle. signature.asc Description: PGP signature
Re: [gentoo-user] Initramfs or move /usr to /, oh my...
On March 18, 2012 at 2:52 PM "Canek Peláez Valdés" wrote: > On Sun, Mar 18, 2012 at 11:44 AM, Tanstaafl wrote: > > [snip] > > > Ok, I have never used genkernel, and have no desire to... > > > > I have no idea what dracut is or how to use it... > > > > I have a remote system that has /usr on a separate partition. > > > > So... > > > > How do I find out if I am actually *using* an initramfs right now (I know it > > is built into the kernel), and ls -l /boot/ will tell you. There is a difference between an initrd (initial RAM disk) image (simple) and an initramfs (initial RAM filesystem) (complicated). Gentoo used to have a script called mkinitrd. It was removed before I migrated to Gentoo, but I should look in attic to see if it's still there. To date I've found no one in Gentoo who will even discuss it. Slackware has used mkinitrd for ions, and it still works very efficiently there. Of course, Eric Hameleers understands the script, and Slackware's init scripts, and maintains mkinitrd. Maybe in Gentoo somebody "upstream" scared people with initramfs, like they're doing with this horrible systemd idea, and whoever maintained mkinitrd just cowered in the corner and dropped the ball. Who knows? The bottom line is that "officially" Gentoo has abandoned initrd for initramfs. You can write a script to make an initrd, as people do all the time. But don't look for official Gentoo support for it. It seems to me after a year around Gentoo that things get so complicated, and upstream gets to "force" things on Gentoo (such as systemd), because there are just too many different developers. All are human with different opinions, so you wind up with people going off in different directions with no cohesive ability to stand against upstream. IOW, we're too forked within Gentoo. For instance, the maintainer of ConsoleKit in Gentoo (Gnome herd guy) says he doesn't care about systemd, he's maintaining ConsoleKit and it's not going anywhere. (We'll see...) Anyway ... for more on Gentoo's initramfs read http://en.gentoo-wiki.com/wiki/Initramfs > > If I am not, how do I do this without using genkernel? Is dracut the *only* > > other option? Is it easy/trivial to set one up manually? > > On March 18, 2012 at 2:52 PM "Canek Peláez Valdés" prattled: > > udev is going to be unmasked, not stabilized. By the time udev gets > into x86/amd64, hopefully the documentation necessary will be ready. That's you telling the world what an asinine idea this drastic change is ... when it's the stable version, which most of the unsuspecting Gentoo userbase will emerge, "hopefully the documentation necessary will be ready." Par for the Poettering course. > You can suscribe to bug 407959 > (https://bugs.gentoo.org/show_bug.cgi?id=407959), which tracks the > documentation changes necessary. Right now the only blocker is 408691 > (https://bugs.gentoo.org/show_bug.cgi?id=408691), but I'm sure it will > be joined by more bugs in the near future. > > Devs are already working on the documentation. If you have a test > spare machine, you can help them, and the whole Gentoo comunity. > > Regards. > -- > Canek Peláez Valdés udev is already unmasked, and stabilized at 171-r5 now... You need to explain what you mean ... you're probably talking about udev-181 Please don't encourage people who don't understand what's happening to test nefarious software ideas. There is nothing about this that's going to "help the whole Gentoo community." -- Happy Penguin Computers>`) 126 Fenco Drive( \ Tupelo, MS 38801^^ 662-269-2706; 662-491-8613 support at happypenguincomputers dot com http://www.happypenguincomputers.com
Re: [gentoo-user] Initramfs or move /usr to /, oh my...
Tanstaafl wrote: > Creating a new thread for this questions since mine got lost in all of > the follow-ups... > > I would really appreciate a meaningful response to this question (maybe > I should go ask this on -dev?) - this has the potential to lose me > forever as a gentoo user (I'm sure none of you are crying over that, but > *I* am), and I've seen other similar comments... I'm thinking of FreeBSD > too (and PCBSD for my desktop)... > > Anyway... > > On 2012-03-17 12:11 AM, Bruce Hill, Jr. > wrote: >> An initramfs which does this is created by >>> =sys-kernel/genkernel-3.4.25.1 or >>> =sys-kernel/dracut-017-r1. If you do not want to use these tools, be >> sure any initramfs you create pre-mounts /usr. > > Ok, I have never used genkernel, and have no desire to... > > I have no idea what dracut is or how to use it... > > I have a remote system that has /usr on a separate partition. > > So... > > How do I find out if I am actually *using* an initramfs right now (I > know it is built into the kernel), and > > If I am not, how do I do this without using genkernel? Is dracut the > *only* other option? Is it easy/trivial to set one up manually? > > I cannot imagine that gentoo is just going to throw me to the wolves > like this without providing *in-depth* instructions on how to make sure > my system will boot after this update, like they did with the > baselayout-2 update... > > Personally, I have no problem with not having a separate /usr any more, > except that I have 3 remote systems that I manage right now that already > *have* a separate /usr... > > On that note - is it possible, and if so, does anyone have any decent > detailed How-to's on how I might be able to convert a separate /user to > one on directly on / on a running system? > > I'm going to add this. I have been using a init thingy that I used dracut to build. When I boot using the init thingy, my system doesn't work right. I am able to reproduce this too. Right now, if I use the init thingy, I can't use part of my system that for me is vital. I can't switch from user to root in anything, not even a console. So right now, I'm having to boot without the init thingy and still want to migrate /usr to LVM. That is certainly not going to happen right now. My advice, mask udev to what works for you until all this mess get sorted out. The first time someone tries to ssh in as a user, then su to root, they are going to have a bad day if they run into the issue I am having. Remember, most admins set remote systems not to allow root to login directly as a security feature. That's what I have read anyway. Just keep it so you can use it until you know the bugs are sorted out. I'm still trying to figure mine out. Dale :-) :-) -- I am only responsible for what I said ... Not for what you understood or how you interpreted my words! Miss the compile output? Hint: EMERGE_DEFAULT_OPTS="--quiet-build=n"
Re: [gentoo-user] Initramfs or move /usr to /, oh my...
On Sun, Mar 18, 2012 at 11:44 AM, Tanstaafl wrote: [snip] > Ok, I have never used genkernel, and have no desire to... > > I have no idea what dracut is or how to use it... > > I have a remote system that has /usr on a separate partition. > > So... > > How do I find out if I am actually *using* an initramfs right now (I know it > is built into the kernel), and > > If I am not, how do I do this without using genkernel? Is dracut the *only* > other option? Is it easy/trivial to set one up manually? udev is going to be unmasked, not stabilized. By the time udev gets into x86/amd64, hopefully the documentation necessary will be ready. You can suscribe to bug 407959 (https://bugs.gentoo.org/show_bug.cgi?id=407959), which tracks the documentation changes necessary. Right now the only blocker is 408691 (https://bugs.gentoo.org/show_bug.cgi?id=408691), but I'm sure it will be joined by more bugs in the near future. Devs are already working on the documentation. If you have a test spare machine, you can help them, and the whole Gentoo comunity. Regards. -- Canek Peláez Valdés Posgrado en Ciencia e Ingeniería de la Computación Universidad Nacional Autónoma de México
Re: [gentoo-user] Initramfs or move /usr to /, oh my...
Tanstaafl writes: > On 2012-03-17 12:11 AM, Bruce Hill, Jr. > wrote: > > An initramfs which does this is created by > >> =sys-kernel/genkernel-3.4.25.1 or > >> =sys-kernel/dracut-017-r1. If you do not want to use these tools, be > > sure any initramfs you create pre-mounts /usr. > > Ok, I have never used genkernel, and have no desire to... I started using it when I encrypted my whole hard drive, so I needed an initramfs. It worked just fine. I had to set MENUICONFIG="yes" and CLEAN="no" in genkernel.conf, if not I think genkernel generates a new .config which is not what I wanted. genkernel --install --lvm --luks all was all that is needed then. Yes, I read that you don't want to use it, but I thought I'd mention it just in case. > I have no idea what dracut is or how to use it... I also did not use that yet. > I have a remote system that has /usr on a separate partition. > > So... > > How do I find out if I am actually *using* an initramfs right now (I > know it is built into the kernel), and I'd say if there is no "initrd" line in you grub.conf, and no corresponding file in /boot, you don't use one. And you're using Gentoo, where there is no automatic setup of initramfs stuff, so it is highly unlikely you are using one without knowing. > If I am not, how do I do this without using genkernel? Is dracut the > *only* other option? No, but probably the easiest. > Is it easy/trivial to set one up manually? Hmm, not really. I did some experiments, but it was too much work for me, and I decided to use one of the tools (genkernel) that are available. You'd have to create a gzipped cpio archive containing all the needed stuff, binaries, libraries, kernel modules, and an init script which handles everything that needs be done, like mounting /usr. > I cannot imagine that gentoo is just going to throw me to the wolves > like this without providing *in-depth* instructions on how to make sure > my system will boot after this update, like they did with the > baselayout-2 update... I'm also wondering. > Personally, I have no problem with not having a separate /usr any more, > except that I have 3 remote systems that I manage right now that > already *have* a separate /usr... > > On that note - is it possible, and if so, does anyone have any decent > detailed How-to's on how I might be able to convert a separate /user to > one on directly on / on a running system? Is your root partition large enough? Then just copy the stuff over: mount -o bind / /mnt # makes / available in /mnt, without other # partitions like /usr showing up there cp -a /usr /mnt/ And remove /usr from /etc/fstab before rebooting. If there's not enough space, you need to enlarge the partition. Very easy with LVM, but if you were using it on your root file system, you'd already be using an initramfs. If not, you need to take the machine down anyway and use gparted or something from a live-cd to adjust your partitions. Wonko
Re: [gentoo-user] Initramfs or move /usr to /, oh my...
On 18-Mar-12 18:44, Tanstaafl wrote: How do I find out if I am actually *using* an initramfs right now (I know it is built into the kernel), Just guessing: If you do not know, then you are probably not using it... Jarry -- ___ This mailbox accepts e-mails only from selected mailing-lists! Everything else is considered to be spam and therefore deleted.
Re: [gentoo-user] Initramfs or move /usr to /, oh my...
On Sun, Mar 18, 2012 at 01:44:07PM -0400, Tanstaafl wrote: > Creating a new thread for this questions since mine got lost in all of > the follow-ups... > > I would really appreciate a meaningful response to this question (maybe > I should go ask this on -dev?) - this has the potential to lose me > forever as a gentoo user (I'm sure none of you are crying over that, but > *I* am), and I've seen other similar comments... I'm thinking of FreeBSD > too (and PCBSD for my desktop)... I wonder what to do also. Part of me wonders why in the hell anyone thinks they need to make such a change, seemingly just for the sake of change. Having /root, /boot, and /bin et all distinct from the user mode /usr, /home, and everything else always seemed to me one of the genuinely clever bits of Unix. I understand that things get more complex, and the idea of a very simple base system are long gone, but why does that require doing away with the separate partitions? Maybe I'm just a retro grouch in that respect. But there are other concerns. I had thought of just copying /boot et all into /usr, adding a grub entry to boot off that partition, and easing into the brave new world. But I can't do that. My /usr is an LVM partition, and making that bootable is apparently as big as hassle, perhaps more so, than using dracut or some simpler initramfs. I began computing back before there were integrated circuits and 8 bit computers, let alone cell phones with more computing power than the $10M monsters. I look forward to the day when my pocket computer automatically links to the display and keyboard at my desk when I sit down, or projects its display on the wall and watches my fingers on a bare desk for keys and I don't have to worry about synching my various computers or worrying about patent wars. The days have long passed when I enjoyed seeing how many instructions I could get on one 80 column punched card (hint: overlap them) or how few instructions it took to figure out the days in a month (hint: use parity) or spending days optimizing for a drum computer ... or messing with configuration issues because some self-proclaimed efficiency export decided that /usr was needed at boot. My attitude right now is to wait and see. Maybe this will all blow over, maybe the self-proclaimed experts will find other things to do, maybe other self-proclaimed experts will find nifty tools to make migration easier. In the meantime, I have other work to do, and I will just freeze parts of my system for the time being. I don't see migrating to other systems as being worth any more than an up-yours. Any other linux system will no doubt do the same. Any other unix but not linux system will have an entirely different hassle. I am past the days when dinking for the sake of dinking involved boot issues and disk configurations. There are much more interesting bigger issues to dink with now. -- ... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._. Felix Finch: scarecrow repairman & rocket surgeon / fe...@crowfix.com GPG = E987 4493 C860 246C 3B1E 6477 7838 76E9 182E 8151 ITAR license #4933 I've found a solution to Fermat's Last Theorem but I see I've run out of room o
[gentoo-user] Initramfs or move /usr to /, oh my...
Creating a new thread for this questions since mine got lost in all of the follow-ups... I would really appreciate a meaningful response to this question (maybe I should go ask this on -dev?) - this has the potential to lose me forever as a gentoo user (I'm sure none of you are crying over that, but *I* am), and I've seen other similar comments... I'm thinking of FreeBSD too (and PCBSD for my desktop)... Anyway... On 2012-03-17 12:11 AM, Bruce Hill, Jr. wrote: > An initramfs which does this is created by >> =sys-kernel/genkernel-3.4.25.1 or >> =sys-kernel/dracut-017-r1. If you do not want to use these tools, be > sure any initramfs you create pre-mounts /usr. Ok, I have never used genkernel, and have no desire to... I have no idea what dracut is or how to use it... I have a remote system that has /usr on a separate partition. So... How do I find out if I am actually *using* an initramfs right now (I know it is built into the kernel), and If I am not, how do I do this without using genkernel? Is dracut the *only* other option? Is it easy/trivial to set one up manually? I cannot imagine that gentoo is just going to throw me to the wolves like this without providing *in-depth* instructions on how to make sure my system will boot after this update, like they did with the baselayout-2 update... Personally, I have no problem with not having a separate /usr any more, except that I have 3 remote systems that I manage right now that already *have* a separate /usr... On that note - is it possible, and if so, does anyone have any decent detailed How-to's on how I might be able to convert a separate /user to one on directly on / on a running system?