Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to install a linux from sources inside my home directory(as oposed to creating a dedicated partition). The basic system(glibc, kernel and init) is installed at $HOME/lfs/root. I'm booting this system using grub installed inside my usb drive, here is the relevant part in grub.cfg(I have to change grub root to hd1 since hd0 is my usb stick):

menuentry "Custom linux HD" { set root='(hd1,1)' linux /home/thiago/lfs/root/boot/bzImage root=/dev/sda1/home/thiago/lfs/root ro }

It seems only devices are valid parameters for 'root='. Is there any way to work arround that? I don't want to mess with my current partitions.

share|improve this question
up vote 2 down vote accepted

I did not test it, but in theory (with a recent distribution and kernel) you can choose to use an initramfs or initrd. The kernel will first run with the initramfs as root, and run its boot script. The last thing the boot script does should be to call pivot_root on the mounted "real" root, and then run the real /sbin/init.

If you can get an initramfs or initrd working, maybe you can tweak the boot script do do the pivot_root in the subdirectory that you want ?

share|improve this answer
thats probably it, thanks. – Thiago de Arruda Aug 25 '10 at 14:25
Yup, that's the way to do it. – Laurent Parenteau Aug 25 '10 at 15:06

I don't think you can do that. But it's maybe time to see virtualization ? You will have a file for your disk and launch a virtual machine in this disk.

share|improve this answer
Actually, I want this kernel to see my real hardware :) – Thiago de Arruda Aug 25 '10 at 13:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.