You are not logged in.

#1 2008-12-14 10:19:12

Aprz
Member
From: Newark
Registered: 2008-05-28
Posts: 277

[SOLVED]Booting w/ Separate Boot Partition GRUB

Okay, it turns out it will boot when /boot is maximized in cfdisk, but I am looking for an explanation on this now. There is no problem, or so it seems, to be solved, just a wanted explanation of why.

Argh, I am getting pretty frustrated with this so I am finally going to post my problem. I didn't want to, but I am getting mad.

We'll just say I have two partitions.. I have more, but it isn't important to mention here or so I feel.

/dev/sda1 /boot
/dev/sda2 /(root)

I installed GRUB to /dev/sda, the MBR. I made my /boot partition bootable in cfdisk.

Every time I boot, I just get

GRUB Loading stage1.5.

GRUB loading, please wait...

Which is where it hangs at and I start yelling at my computer and turn red.

I've Googled this and it appears that GRUB cannot find stage2.

[Archlinux :/]# mkdir /mnt/boot
[Archlinux :/]# mount -t jfs /dev/sda1 /mnt/boot/
[Archlinux :/]# cd /mnt/boot/grub/
[Archlinux :/]# ls
e2fs_stage1_5  ffs_stage1_5       jfs_stage1_5     minix_stage1_5     stage1  stage2_eltorito  vstafs_stage1_5
fat_stage1_5   iso9660_stage1_5   menu.lst         reiserfs_stage1_5  stage2  ufs2_stage1_5    xfs_stage1_5

Using a Archlinux LiveCD, I created a boot directory in /mnt/ and mount /dev/sda1, my boot partition, to it. Inside of it (/mnt/boot/grub), stage2 clearly exist, which contains menu.lst and in there also, it appears everything is correct. You'll notice that I installed the utilities for all filesystems when I am just using JFS. I installed all the packages except lilo incase this was interfering with it (it's never interfered when boot was merge with my root partition, but I did this just "incase" because I'e tried this several times before.

title  Archlinux
root   (hd0,0)
kernel /vmlinuz26 root=/dev/sda2 ro
initrd /kernel26.img

There is a second entry for fallback also, which I believe this is the important information (not the second entry), root saying where /boot is at ant and then the root on the kenel line saying were /sbin/init is at (/(root)), ro for being read-only. I'm aware that it this is relative to where /boot/ is at, which is why there is no /boot/ before the kernel and initrd line. This was also generated by /arch/setup.

It's bugging me, I need /boot to be in it's own partition. It's been ultra frustrating.

Anyhow, question is what am I do wrong to make it so GRUB cannot find stage2? What can I do to fix this so that I can boot my system with a /boot partition rather than having /(root and /boot merged as one like I used to have it? I'd like to fix this problem keeping /boot as a separate partition. Archlinux was installed on here before, but I wiped it completely off with cfdisk so it shouldn't be interfering at all. There is no other system except for the new Archlinux on here (as in the one replacing my old one).

EDIT: Well, I finally got it somewhat working, but not in the way that I would like. I read that the auto could make a boot partition so I did it like that and then I used cfdisk to do it again, but I didn't touch /boot. I noticed that it was flagged as "boot, nc" so Googling that now. I would much rather like to know how to do this without using some auto thing to do it for me. <_<

Edit: Well, I don't think the NC thing could be the fix. Just read about it.

http://www.ss64.com/bash/cfdisk.html wrote:

The format of the partition table in the partitions section is, from left to right: Name, Flags, Partition Type, Filesystem Type and Size. The name is the partition device name. The flags can be Boot, which designates a bootable partition or NC, which stands for "Not Compatible with DOS or OS/2". DOS, OS/2 and possibly other operating systems require the first sector of the first partition on the disk and all logical partitions to begin on the second head. This wastes the second through the last sector of the first track of the first head (the first sector is taken by the partition table itself). cfdisk allows you to recover these "lost" sectors with the maximize command (m). Note: fdisk(8) and some early versions of DOS create all partitions with the number of sectors already maximized. For more information, see the maximize command below. The partition type can be one of Primary or Logical. For unallocated space on the drive, the partition type can also be Pri/Log, or empty (if the space is unusable). The filesystem type section displays the name of the filesystem used on the partition, if known. If it is unknown, then Unknown and the hex value of the filesystem type are displayed. A special case occurs when there are sections of the disk drive that cannot be used (because all of the primary partitions are used). When this is detected, the filesystem type is displayed as Unusable. The size field displays the size of the partition in megabytes (by default). It can also display the size in sectors and cylinders (see the change units command below). If an asterisks (*) appears after the size, this means that the partition is not aligned on cylinder boundaries.

Anyhow, trying it out without autoing by maximizing /boot (hit m) and I'll get back. If this is the answer, I hate it for being that simple, but yet, not totally explainable to me at the moment. -.-

Edit: All that frustration over just having to maximize this. I don't remember reading this anywhere when making /boot separate.... <_< Now I am going to look more into maximizing since I don't fully understand it and I would hate to tell a noob how I did it and then if he asked me "Why?" and I wouldn't be able to explain. Will look into this right now before I make it completely solved.

I don't get it.

man cfdisk wrote:

Maximize disk usage of the current partition. This command will recover the the unused space between the partition table and the beginning of the partition, but at the cost of making the partition incompatible with DOS, OS/2 and possibly other operating systems. This option will toggle between maximal disk usage and DOS, OS/2, etc. compatible disk usage. The default when creating a partition is to create DOS, OS/2, etc. compatible partitions.

Why would this make it finally bootable?

Last edited by Aprz (2008-12-15 15:03:18)

Offline

#2 2008-12-14 17:06:22

broch
Banned
From: L.A. California
Registered: 2006-11-13
Posts: 975

Re: [SOLVED]Booting w/ Separate Boot Partition GRUB

I am not sure why you are trying to use journaled fs for (probably small) /boot partition
That is no clear. Not to mention that at least in past (which may not be the case anymore) GRUB on jfs had problems with booting

anyway this is a part of /etc/fstab related to /boot partition
/dev/sda1 /boot ext2 acl,noatime,noexec,noauto,user_xattr 0 1

as you can see this partition is not even mounted

Last edited by broch (2008-12-14 17:09:13)

Offline

#3 2008-12-15 11:59:55

Aprz
Member
From: Newark
Registered: 2008-05-28
Posts: 277

Re: [SOLVED]Booting w/ Separate Boot Partition GRUB

Way to go with answer my question. wink

I mount /boot because I commonly compile my kernel trying out different things that are not in the vanilla build, it's not necessarily for the journal support even though that is what JFS is mostly known for (and that is a plus if I ever need to recover /boot), but because of JFS's speed, specially when using the deadline I/O scheduler. Not very important for /boot since it is so small, but I actually consider using something such as reiserfs for it more dangerous even though more optimal for the small files within /boot. So that explains why I am using JFS rather than ext2/3 and why I am mounting /boot in the first place. If I wasn't even mounting it, I don't believe the choise of filesystem would even really matter.

Correct me if I am wrong, but I swear that GRUB was located in the MBR (/dev/sda), which it is told where /boot is located at, hence the line root (hd0,0), similar to /dev/sda1 (to GRUB), or you can say (hd0,0)/vmlinuz26 instead of using the root line. Then on the kernel line, where it says "kernel=", you specify where root (/) is at, not the same kind of root to GRUB, so that it may locate the init system, /sbin/init. So it goes from GRUB in the MBR -> /boot -> loads the kernel -> starts the init system. Where does this /etc/fstab even matter until after the kernel has loaded? A lot of people seem to keep telling me their /etc/fstab and stuff like that. Very annoying, maybe I missed the boat. Again. feel free to correct me if I am wrong. This was just my impression of how my computer booted.

Now, I am not sure if this was a problem at first with GRUB or not as I was not aware that it lacked support for JFS, but then again, I do not know the history of GRUB very well other than what the manual states. If you look at the online documentation for it, you'll see that GRUB does support JFS at the moment.

http://www.gnu.org/software/grub/manual/grub.html wrote:

Support multiple filesystem types
    Support multiple filesystem types transparently, plus a useful explicit blocklist notation. The currently supported filesystem types are BSD FFS, DOS FAT16 and FAT32, Minix fs, Linux ext2fs, ReiserFS, JFS, XFS, and VSTa fs. See Filesystem, for more information.

I've also been using JFS for /(root) when /boot was not separate, which then inherently it was JFS also, and that has been for awhile now. If I was using Reiser4 for /boot, me and you would be having a much different conversation here. Anyhow, clearly it seems to be working with JFS when I maximized the partition, which is what my question is about, why do I need to maximize the partition? Are you suggesting that it had something do with JFS? Perhaps it was the kernel that wasn't even loaded yet; somebody suggested that on IRC.

I am truly sorry if I sound like a prick right now. I know I am acting like one because the folks on the IRC did the same exact same thing, and then I had tell them what I just said above, and then they had a little war about what filesystems were better, how to tweak them, etc, and then in the end, my question was still not answered. Linux for me is a learning experience, and I look at this community as my teacher when the manual is just not enough, and then it just seems that the teacher is confused, goofing off, or not paying attention while trying to answer my question.

Last edited by Aprz (2008-12-15 12:06:37)

Offline

#4 2008-12-15 12:38:41

Zariel
Member
Registered: 2008-10-07
Posts: 446

Re: [SOLVED]Booting w/ Separate Boot Partition GRUB

can you post your partition layout and menu.lst please?

Offline

#5 2008-12-15 13:17:09

Aprz
Member
From: Newark
Registered: 2008-05-28
Posts: 277

Re: [SOLVED]Booting w/ Separate Boot Partition GRUB

Okay, here is my parition scheme (as displayed through df/fstab, which will show it exactly as is).

$ df -Th
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/sda2  reiser4     13G  133M   13G   2% /
none         tmpfs    755M     0  755M   0% /dev/shm
/dev/sda1      jfs     31M  8.4M   22M  28% /boot
/dev/sda5  reiser4    9.3G  696M  8.6G   8% /usr
/dev/sda6  reiser4    8.4G  580K  8.4G   1% /tmp
/dev/sda7  reiser4    8.4G  106M  8.3G   2% /var
/dev/sda8  reiser4     32G  4.1M   32G   1% /home

Here is /boot/grub/menu.lst.

$ cat /boot/grub/menu.lst
timeout   3
default   0
color light-blue/black light-cyan/blue

title  Andrew
root   (hd0,0)
kernel /vmlinuz-2.6.27-Aprz root=/dev/sda2 ro elevator=deadline vga=773
initrd /kernel-2.6.27-Aprz.img

title  Arch Linux
root   (hd0,0)
kernel /vmlinuz26 root=/dev/sda2 ro elevator=deadline vga=773
initrd /kernel26.img

title  Arch Linux Fallback
root   (hd0,0)
kernel /vmlinuz26 root=/dev/sda2 ro elevator=deadline vga=773
initrd /kernel26-fallback.img

Heh, haven't removed the old kernel yet and the custom kernel is already compiled to use the I/O scheduler deadline instead of CFQ by default (in fact, I didn't even compile Anticipatory or CFQ in there so they wouldn't work with the custom kernel, and since I am using Reiser4, my partitions wouldn't work with Arch's stock kernel yet) so the elevator lines are pretty useless now.

Now, the computer is working, everything is fine, but the question is why do I need to maximize /boot for my computer to be bootable?

Last edited by Aprz (2008-12-15 13:19:50)

Offline

#6 2008-12-15 13:29:55

Zariel
Member
Registered: 2008-10-07
Posts: 446

Re: [SOLVED]Booting w/ Separate Boot Partition GRUB

hm, i guess when you made /boot you mounted it and reinstalled grub to the mbr?

Offline

#7 2008-12-15 13:50:36

Aprz
Member
From: Newark
Registered: 2008-05-28
Posts: 277

Re: [SOLVED]Booting w/ Separate Boot Partition GRUB

No, this is a fresh install. This is a problem that happens right from the start, not on an existng system.

By the way, updated /boot/grub/menu.lst because the Arch stock kernel is no longer usable with the majority of my paritions for it's lack of support for Reiser4 and the elevator=deadline wasn't needed with vmlinuz-2.6.27-Aprz because I compiled it with only support for the Deadline I/O scheduler, nothing else, and it is set by default making elevator=deadline redundant.

$ cat /boot/grub/menu.lst
timeout   0
default   0
color light-blue/black light-cyan/blue

title  Andrew
root   (hd0,0)
kernel /vmlinuz-2.6.27-Aprz root=/dev/sda2 ro vga=773
initrd /kernel-2.6.27-Aprz.img

Hopefully I'll be able to minimize the kernel to where everything is inside of the kernel and there will be no use for the initrd.

Last edited by Aprz (2008-12-15 13:57:51)

Offline

#8 2008-12-15 13:58:01

Zariel
Member
Registered: 2008-10-07
Posts: 446

Re: [SOLVED]Booting w/ Separate Boot Partition GRUB

Hmm very strange, i use a 100mb /boot with ext2, can you try putting some other fs onto /boot and see if it boots. If so then its something to do with jfs which is beyond me.

Last edited by Zariel (2008-12-15 13:58:53)

Offline

#9 2008-12-15 14:35:41

Aprz
Member
From: Newark
Registered: 2008-05-28
Posts: 277

Re: [SOLVED]Booting w/ Separate Boot Partition GRUB

Hm, from what I can recall, the only reason JFS is usually not recommended is because you need to add ro (read only) on the kernel line so it can check it's log before it mounts as read write. I have to admit, out of all this frustration, I never did try another filesystem, but that's because it worked when it was merged into /(root) and I expected the same result when it was unmerged, but that wasn't the case. Also the only reason why I decided to maximize the partition is because I read that the auto partitioner in the Arch install CD creates a boot paritition also. I used the auto partitioner, took a look to see if there was any difference and if it worked, and it did, and the difference was that it was maximized and that it was ext2/3 (I forget which of the two). When I maximized it (it was my intention not to use ext2/3) with JFS, it worked. I will test tomorrow with out maximizing /boot just changing it to ext2 instead and I'll get back to you guys since it seems that most of you believe it is the choice of filesystem. I still disagree, but I will do it for the sake of it I guess. If I am wrong then damn...

Edit: Damn... you guys were right. I would like to apologize to everyone that was questioning the filesystem and me snapping back. This appears to only happen when /boot is separate from the root partition and is JFS. An explanation, I do not know. I will look further into why the JFS partition must be maximized because that still does not make sense to me. Really, using a JFS /boot partition that is maximized (hit "m" cfdisk) will do the trick to get a JFS /boot partition to work. It's funny because my /(root) paritition, when /boot is not separate, is usually JFS at first before I convert it to Reiser4, and well, it works just fine without me having to maximize it so this still does not make sense to me.

Last edited by Aprz (2008-12-15 15:09:05)

Offline

#10 2008-12-15 15:48:29

broch
Banned
From: L.A. California
Registered: 2006-11-13
Posts: 975

Re: [SOLVED]Booting w/ Separate Boot Partition GRUB

I mount /boot because I commonly compile my kernel trying out different things that are not in the vanilla build, it's not necessarily for the journal support even though that is what JFS is mostly known for (and that is a plus if I ever need to recover /boot), but because of JFS's speed, specially when using the deadline I/O scheduler. Not very important for /boot since it is so small, but I actually consider using something such as reiserfs for it more dangerous even though more optimal for the small files within /boot. So that explains why I am using JFS rather than ext2/3 and why I am mounting /boot in the first place. If I wasn't even mounting it, I don't believe the choise of filesystem would even really matter.

actually:
on small partitions, non journaled fs is simply way faster than whatever journaled fs you want to use. So your choice of jfs for small partition because of performance is really questionable.

In other words:
1) jfs, reiser, ext3 will be much slower than ext2 and will waste most of the space.
2) do not mount /boot which (aside from security stand point) will make boot time even shorter and obviously no problem with corrupted partition (if this would ever happen). jfs still is less reliable than ext3/4 .
3) You are confused about I/O. If you would use jfs + deadline sheduler (or better would be noop for single task) + database then you would see a gain from jfs. Otherwise this will not provide any gains. Not to mention that db benchmarks (2008) of ext3 an xfs are still better than jfs. Either way any of the above makes sense for small partition.
4) frequent compiling kernel is not an argument: I do it quite often (currently I have 2.6.28-rc7-git6-zen, 2.6.27.8-grsec, 2.6.28-rc8-git1, and 2.6.27.8).
how much time it would take to do
mount /boot

Last edited by broch (2008-12-15 15:50:23)

Offline

Board footer

Powered by FluxBB