FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 03-19-2012, 12:57 AM
"Bruce Hill, Jr."
 
Default Initramfs or move /usr to /, oh my...

On March 18, 2012 at 2:52 PM "Canek Peláez Valdés" <caneko@gmail.com>
wrote:

> On Sun, Mar 18, 2012 at 11:44 AM, Tanstaafl <tanstaafl@libertytrek.org>
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" <caneko@gmail.com>
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
 
Old 03-19-2012, 01:38 AM
walt
 
Default Initramfs or move /usr to /, oh my...

On 03/18/2012 04:31 PM, Pandu Poluan wrote:
>
> On Mar 19, 2012 5:31 AM, "walt" <w41ter@gmail.com
> <mailto:w41ter@gmail.com>> wrote:
>>
>> On 03/18/2012 11:52 AM, walt wrote:
>>
>>> The other nifty hint was to add "panic=10" as a kernel parameter
>>> in grub.conf (menu.lst) so that your remote system will reboot in
>>> 10 seconds if the kernel panics during boot. That will let you
>>> test (remotely) if a kernel parameter like "noinitrd" breaks your
>>> machine.
>>
>> Heh. I learn a lot from reading my posts -- when I figure out why
>> my first reply was wrong
>>
>> Now that I've thought about it, I assume you have only ssh access
>> to your remote machine, so you can't see the grub boot prompt,
>> right?
>>
>> Maybe the remote machine doesn't even pause at the boot prompt
>> because no one is there to watch it? I'm curious how remote
>> servers work in real life because in my next life I wanna come back
>> as a sysadmin
>>
>
> When I started administering remote servers, Citrix's XenServer is
> Good Enoughâ„¢ to deploy in production, so now it's the first thing I
> install on a virgin box, even if said virgin box will host only one
> VM.
>
> This provides me with a usable Virtual Console through which I can
> watch the boot process.

Bless you Pandu, you just answered a question I didn't ask (yet

My workplace recently began providing us (peons) access to its Holy
Intranet even when we are (shamefully) not actually in the workplace.

When I use firefox to access their intranet I have no problems: I
see a small popup dialog box that announces that Citrix is allowing
me to see a window containing an instance of M$ Internet Explorer,
which is displaying the intranet web page I clicked on in firefox,
(which is running on my gentoo desktop, of course).

I can see that this whole process starts a java vm running in the
background, so I suppose that the Citrix app (whatever it is) is
a java applet started by my firefox browser.

But, when I try to access the same intranet web page with google
chrome, it hangs forever instead of starting the Citrix app.
(Other java-powered websites work normally with google chrome.)

Does any/all of this suggest that their web servers are running the
same Citrix XenServer you speak of?
 
Old 03-19-2012, 02:19 AM
Pandu Poluan
 
Default Initramfs or move /usr to /, oh my...

On Mar 19, 2012 9:41 AM, "walt" <w41ter@gmail.com> wrote:

>

> On 03/18/2012 04:31 PM, Pandu Poluan wrote:

> >

> > On Mar 19, 2012 5:31 AM, "walt" <w41ter@gmail.com

> > <mailto:w41ter@gmail.com>> wrote:

> >>

> >> On 03/18/2012 11:52 AM, walt wrote:

> >>

> >>> The other nifty hint was to add "panic=10" as a kernel parameter

> >>> in grub.conf (menu.lst) so that your remote system will reboot in

> >>> 10 seconds if the kernel panics during boot. Â*That will let you

> >>> test (remotely) if a kernel parameter like "noinitrd" breaks your

> >>> machine.

> >>

> >> Heh. Â*I learn a lot from reading my posts -- when I figure out why

> >> my first reply was wrong

> >>

> >> Now that I've thought about it, I assume you have only ssh access

> >> to your remote machine, so you can't see the grub boot prompt,

> >> right?

> >>

> >> Maybe the remote machine doesn't even pause at the boot prompt

> >> because no one is there to watch it? Â*I'm curious how remote

> >> servers work in real life because in my next life I wanna come back

> >> as a sysadmin

> >>

> >

> > When I started administering remote servers, Citrix's XenServer is

> > Good Enoughâ„¢ to deploy in production, so now it's the first thing I

> > install on a virgin box, even if said virgin box will host only one

> > VM.

> >

> > This provides me with a usable Virtual Console through which I can

> > watch the boot process.

>

> Bless you Pandu, you just answered a question I didn't ask (yet

>

> My workplace recently began providing us (peons) access to its Holy

> Intranet even when we are (shamefully) not actually in the workplace.

>

> When I use firefox to access their intranet I have no problems: I

> see a small popup dialog box that announces that Citrix is allowing

> me to see a window containing an instance of M$ Internet Explorer,

> which is displaying the intranet web page I clicked on in firefox,

> (which is running on my gentoo desktop, of course).

>

> I can see that this whole process starts a java vm running in the

> background, so I suppose that the Citrix app (whatever it is) is

> a java applet started by my firefox browser.

>

> But, when I try to access the same intranet web page with google

> chrome, it hangs forever instead of starting the Citrix app.

> (Other java-powered websites work normally with google chrome.)

>

> Does any/all of this suggest that their web servers are running the

> same Citrix XenServer you speak of?

>

>


That's XenApp in action, and despite having "Xen" in its name, it's not Xen. IOW, that's application virtualization not baremetal OS Virtualization.


You won't ever know if your server is running XenServer or not, unless you ask the SysAdmin team. Yes, it's that transparent.


XenApp is a love letter from hell, if you ask me. Here in my new employer, it's used extensively to access apps that actually live in the Windows Servers. The (quite sizable) dev team is currently feverishly trying to finish proper client/server apps to replace them. Reason for replacement? Well, your experience is but one of the teeth-gritting problems we're experiencing :-P



Rgds,
 
Old 03-19-2012, 01:10 PM
Neil Bothwick
 
Default 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.
 
Old 03-20-2012, 12:28 AM
Sebastian Pipping
 
Default 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 <root> (the one holding /))

(3. Enlarge file system sitting on partition/device <root>)

4. Make a new folder <root>/usr

5. Copy content from <usr>/ to <root>/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 <root>/etc/fstab

7. Reboot

8. Resolve partition <usr>

Good luck.

Best,



Sebastian
 
Old 03-20-2012, 07:43 AM
Neil Bothwick
 
Default 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)
 
Old 03-20-2012, 04:35 PM
Sebastian Pipping
 
Default 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
 
Old 03-21-2012, 01:02 AM
Joshua Murphy
 
Default Initramfs or move /usr to /, oh my...

On Mon, Mar 19, 2012 at 9:28 PM, Sebastian Pipping <sping@gentoo.org> wrote:
> On 03/18/2012 06:44 PM, Tanstaafl wrote:
<snip>
>> 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 <root> (the one holding /))
>
> (3. Enlarge file system sitting on partition/device <root>)
>
> *4. Make a new folder <root>/usr
>
> *5. Copy content from <usr>/ to <root>/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 <root>/etc/fstab
>
> *7. Reboot
>
> *8. Resolve partition <usr>
>
> 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...
<Before Copy>
# 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/sda8 15G 845M 14G 6% /var
/dev/sda7 20G 2.0G 18G 10% /usr
/dev/sda9 49G 3.2G 46G 7% /home
tmpfs 2.0G 4.0K 2.0G 1% /tmp

<After copy (extras trimmed)>
# df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 7.9G 2.1G 5.8G 27% /
/dev/sda7 20G 2.0G 18G 10% /usr

<After reboot>

# 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/sda8 15G 844M 14G 6% /var
/dev/sda9 49G 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 trick
would be, instead of unmounting those bind mounts, doing a umount -l
/usr then, as you're able, freeing references to the old mount,
syncing new changes from the old tree into the new one (if any, and if
appropriate), and then starting up whatever was killed to free it, if
appropriate. Due to the usual way /usr is used, however, it's entirely
likely that, after the lazy unmount, the process of simply updating
the system over time will eventually free up all old references,
releasing the old mount, and allowing everything to roll over to the
new arrangement gradually, much like the ability to update things like
sshd in place, restarting the service (as the , but leaving existing
connections uninterrupted... but, again, I'm not brave enough to test
it, let alone make guarantees.

--
Poison [BLX]
Joshua M. Murphy
 
Old 03-21-2012, 06:40 AM
Sebastian Pipping
 
Default 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
 
Old 03-21-2012, 08:08 AM
Neil Bothwick
 
Default 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?
 

Thread Tools




All times are GMT. The time now is 03:46 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org