Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
04-15-2009, 03:44 AM
|
#1
|
|
Member
Registered: Apr 2009
Posts: 42
Rep:
|
Booting a custom kernel with a new root filesystem
Hi everybody !
I am using OpenSuSE 11.0 . I have built a custom kernel(2.6.25.5-1.1) and I have to boot it with a new root file system.I have created a separate partition (in this case /dev/sda4) and made ext2 filesystem and mounted it on a mount point(/mnt/point1 in this case). I also have populated the new file system with necessary directories like /dev,/bin,/proc etc...
But the major problem is how to boot the custom kernel with newly created file system as root? (i.e. When the kernel boots, "/" should not be root,instead, the root should be located in /mnt/point1/(new root???))
|
|
|
|
04-15-2009, 04:06 AM
|
#2
|
|
Member
Registered: May 2006
Location: BE
Distribution: Debian/Gentoo
Posts: 412
Rep:
|
I can't imagine that would work!
What are you trying to do?
If you want to test a new kernel, you can do that without losing the previous version. Have a look at your grub/lilo man page depending on your boot loader.
If you are trying to test a new environment, you could simply chroot into it.
Code:
# chroot /bin/bash /mnt/point1
We need more info to be able to help you.
|
|
|
|
04-15-2009, 04:10 AM
|
#3
|
|
Moderator
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.4 OpenSuSE 12.2
Posts: 9,896
|
You can try to add root= to the kernel options in /boot/grub/menu.lst. Opensuse uses the device name as listed in /dev/disk/by-id. You have to identify which id belongs to the new partition and use that in the kernel boot line. Also add the proper line in /etc/fstab to automatically mount the partition at boot.
An example from my system:
Code:
# In /etc/fstab:
/dev/disk/by-id/ata-FUJITSU_MHV2160BT_NU06T6527J10-part8 / ext3 acl,user_xattr 1 1
# In /boot/grub/menu.lst:
title openSUSE 11.1 - 2.6.27.21-0.1
root (hd0,6)
kernel /vmlinuz-2.6.27.21-0.1-pae root=/dev/disk/by-id/ata-FUJITSU_MHV2160BT_NU06T6527J10-part8 resume=/dev/disk/by-id/ata-FUJITSU_MHV2160BT_NU06T6527J10-part6 splash=silent showopts vga=0x317
initrd /initrd-2.6.27.21-0.1-pae
Hope this helps!
|
|
|
|
04-15-2009, 04:46 AM
|
#4
|
|
Member
Registered: Apr 2009
Posts: 42
Original Poster
Rep:
|
Quote:
Originally Posted by eco
I can't imagine that would work!
What are you trying to do?
If you want to test a new kernel, you can do that without losing the previous version. Have a look at your grub/lilo man page depending on your boot loader.
If you are trying to test a new environment, you could simply chroot into it.
Code:
# chroot /bin/bash /mnt/point1
We need more info to be able to help you.
|
Hi ! I have already tested the new kernel and it is working fine. All I need is to boot this kernel with new root file system.
Can I just change the boot flag by using fdisk on /dev/sda4? Or are there some other steps involved?
|
|
|
|
04-15-2009, 04:56 AM
|
#5
|
|
Member
Registered: Apr 2009
Posts: 42
Original Poster
Rep:
|
Quote:
Originally Posted by colucix
You can try to add root= to the kernel options in /boot/grub/menu.lst. Opensuse uses the device name as listed in /dev/disk/by-id. You have to identify which id belongs to the new partition and use that in the kernel boot line. Also add the proper line in /etc/fstab to automatically mount the partition at boot.
An example from my system:
Code:
# In /etc/fstab:
/dev/disk/by-id/ata-FUJITSU_MHV2160BT_NU06T6527J10-part8 / ext3 acl,user_xattr 1 1
# In /boot/grub/menu.lst:
title openSUSE 11.1 - 2.6.27.21-0.1
root (hd0,6)
kernel /vmlinuz-2.6.27.21-0.1-pae root=/dev/disk/by-id/ata-FUJITSU_MHV2160BT_NU06T6527J10-part8 resume=/dev/disk/by-id/ata-FUJITSU_MHV2160BT_NU06T6527J10-part6 splash=silent showopts vga=0x317
initrd /initrd-2.6.27.21-0.1-pae
Hope this helps!
|
Hi ! As suggested by you,I gave root= the device id(too long to write here). I had already modified fstab to mount the new partition. When I rebooted, all I got was a blank screen.No error,no warning,no display...simply nothing.
I had not mentioned anything about initrd because I don't have any initrd image associated with my new kernel.Is there need of initrd image? It should be noted that I booted successfully this new kernel earlier simply by mentioning root (hd0,1) and kernel=/boot/bzImage in grub.
|
|
|
|
04-15-2009, 06:30 AM
|
#6
|
|
Gentoo support team
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 3,965
|
Quote:
Originally Posted by LinuxNewman
Hi ! I have already tested the new kernel and it is working fine. All I need is to boot this kernel with new root file system.
Can I just change the boot flag by using fdisk on /dev/sda4? Or are there some other steps involved?
|
The kernel will use as its root whatever you tell it with the root= boot parameter, as has already been said. You usually set these in your bootloader config.
Another different question is whether that fs you created has all the necessary means to boot. Without a proper init system all you are going to get is a nice kernel panic "no init found, try passing init=... to kernel".
PS. Our posts crossed, I was a bit late 
Last edited by i92guboj; 04-15-2009 at 06:37 AM.
|
|
|
|
04-15-2009, 06:34 AM
|
#7
|
|
Gentoo support team
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 3,965
|
Quote:
Originally Posted by LinuxNewman
Hi ! As suggested by you,I gave root= the device id(too long to write here). I had already modified fstab to mount the new partition. When I rebooted, all I got was a blank screen.No error,no warning,no display...simply nothing.
|
Fstab? what fstab??' the fstab of your old system? I hope not, since you are not going to be using that file system with your new kernel.
Quote:
|
I had not mentioned anything about initrd because I don't have any initrd image associated with my new kernel.Is there need of initrd image? It should be noted that I booted successfully this new kernel earlier simply by mentioning root (hd0,1) and kernel=/boot/bzImage in grub.
|
You don't need an initrd as long as all the modules you need to boot are compiled statically inside your kernel. You will need at least the hd controller driver and the fs driver for whatever fs you used to format your root partition.
If you are really going to do anything serious with this I suggest you to pick either Gentoo or LFS and learn how to install a linux os from scratch. You seem to be lacking the essential knowledge that you will need to do so successfully.
|
|
|
|
04-16-2009, 12:00 AM
|
#8
|
|
Member
Registered: Apr 2009
Posts: 42
Original Poster
Rep:
|
I mentioned root=(the device id of new partition) in grub. then while booting it showed error 15 file not found.
|
|
|
|
04-16-2009, 03:02 AM
|
#9
|
|
Gentoo support team
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 3,965
|
According to the grub info page:
Code:
15 : File not found
This error is returned if the specified file name cannot be found,
but everything else (like the disk/partition info) is OK.
So, check again that the kernel file name is correct and exists inside the partition where /boot resides.
|
|
|
|
04-18-2009, 02:25 PM
|
#10
|
|
Member
Registered: May 2006
Location: Mt Umunhum, CA, USA
Distribution: Debian/ Fedora
Posts: 408
Rep:
|
Quote:
Originally Posted by LinuxNewman
Hi everybody !
I am using OpenSuSE 11.0 . I have built a custom kernel(2.6.25.5-1.1) and I have to boot it with a new root file system.I have created a separate partition (in this case /dev/sda4) and made ext2 filesystem and mounted it on a mount point(/mnt/point1 in this case). I also have populated the new file system with necessary directories like /dev,/bin,/proc etc...
But the major problem is how to boot the custom kernel with newly created file system as root? (i.e. When the kernel boots, "/" should not be root,instead, the root should be located in /mnt/point1/(new root???))
|
I would suggest using the 'root=LABEL=' kernel parm. you will need to change three things: - on the new file system, e2label /dev/xxx New
- in grub.conf on the kernel line root=LABEL=New
- in /etc/fstab on the new file system, LABEL=New / default blah
In this example I used 'New', you can use whatever you wish, check the e2label man page for limitations.
|
|
|
|
04-19-2009, 10:53 PM
|
#11
|
|
Member
Registered: Apr 2009
Posts: 42
Original Poster
Rep:
|
o.k friends I will try all this and report back here the result.Thanks :-)
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 09:55 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|