partitions/making room for LFS
I know I am missing something basic here. I have a single hard drive.
On the first part of the hard drive I have M$ Win2k Pro. On the second half I have linux installed (Mandrake 10.0). I shrank the windows partition by 5GB to make room for the LFS project. Then I run 'cfdisk' to partition it off. This renumbers my linux partitions. So I change my /etc/fstab to reflect the changes, but not adding the new 5GB portion, since it is not formatted yet. Then I changed the boot loader GRUB to look at the correct partition. When I reboot to make sure things are still good. I get an error message saying it can't find init on /dev/hda5. However with the modifications the unformatted partition I just made for LFS is now /dev/hda5. The changes I made to grub and my /etc/fstab say look at /dev/hda6. So I remove the partition without changing anything else and linux boots up fine. That includes the numbers in GRUB and my /etc/fstab. I am confused as to why this is. I know I am missing something really basic here. Output of fisk -l: omitting empty partition (5) Disk /dev/hda: 40.0 GB, 40020664320 bytes 16 heads, 63 sectors/track, 77545 cylinders Units = cylinders of 1008 * 512 = 516096 bytes Device Boot Start End Blocks Id System /dev/hda1 * 1 30786 15516112+ 7 HPFS/NTFS /dev/hda2 30787 77545 23566536 5 Extended /dev/hda5 40945 53133 6143224+ 83 Linux /dev/hda6 53134 54148 511528+ 82 Linux swap /dev/hda7 54149 77545 11792056+ 83 Linux Output of cat < /etc/fstab: none /dev/pts devpts mode=0620 0 0 /dev/hda5 / ext2 defaults 1 1 /dev/hda6/ swap swap defaults 0 0 /dev/hda7 /home ext2 defaults 1 2 /dev/hdc /mnt/cdrom auto umask=0,user,iocharset=iso8859-1,codepage=850,noauto,ro,exec 0 0 none /mnt/floppy supermount dev=/dev/fd0,fs=ext2:vfat,--,umask=0,iocharset=iso8859-1,sync,codepage=850 0 0 /dev/hda1 /mnt/windows ntfs umask=0,nls=iso8859-1,ro 0 0 none /proc proc defaults 0 0 |
Hi silverback011,
You need to do 2 changes in grub when you change the partition: Code:
kernel (hd0,4)/boot/vmlinuz ro root=/dev/hda5 |
It's me again!
I remembered one more trick. If you use "initrd", it will always mount "/dev/hda5" even if you make all the changes in grub. In this case you need to create another initrd containing the proper device and script to boot when the partition number changes. I would suggest you the following steps before the boot trial: - uncompress the initrd to a temp file, mount it and cd to it: Code:
gunzip -c /boot/initrd-XXX >/tmp/initrd.tmp - Edit the file "linuxrc", changing all partition references from "hda5" to "hda6". - copy the "hda6" device to this image or create it: Code:
cp -a /dev/hda6 /mnt/tmpinitrd/dev Code:
cd Code:
gzip -c /tmp/initrd.tmp >/boot/inirtd-hda6.img |
I thank you for the help. Everything you said makes sense to me except when I look at the 'linuxrc' file.
Output of cat < linuxrc: #!/bin/nash echo "Loading jbd.ko module" insmod /lib/jbd.ko echo "Loading ext3.ko module" insmod /lib/ext3.ko echo Mounting /proc filesystem mount -t proc /proc /proc echo Creating device files mkdevices /dev echo Mounting sysfs mount -t sysfs none /sys echo Creating root device mkrootdev /dev/root umount /sys echo 0x0100 > /proc/sys/kernel/real-root-dev echo Mounting root filesystem mount -o defaults --ro -t ext3 /dev/root /sysroot pivot_root /sysroot /sysroot/initrd echo Remounting devfs at correct place if necessary handledevfs umount /initrd/proc I don't see anywhere where it refers to /dev/hda#. I guess Mandrake cutomizes things quite a lot. |
HI silverback011,
I'm doing some research since I received your post. Basically, your script does a lot of work to determine which is your root file system. Quote:
Good luck! |
Once again thanks for you help. I will do some reading. I'll let you know how it comes out.
|
I am able to boot up now with the added partition.
I installed the Lilo boot loader. Then I added: image=/boot/vmlinuz label="Primary" root=/dev/hda6 initrd=/boot/initrd.img append="root=/dev/hda6" #tells initrd to use this instead of old vga=788 read-only In addition to this I editied my /etc/fstab to change the partition numbers to the correct ones. I have already learned a bit doing this project. Discovered I have been running for awhile without any swap. Hasn't been mounting on boot up. Thanks a lot osvaldomarques for pointing me in the correct direction. |
All times are GMT -5. The time now is 11:21 AM. |