Showing posts with label grub. Show all posts
Showing posts with label grub. Show all posts

Monday, March 26, 2012

Grub error 17 and 15 after installation Arch

I installed the March Archbang iso today on a old pc and all went very well regarding Archbang but there were two grub errors, first error 17.
I was replacing an older Arch installation that I hadn't updated in more then a year but functioned flawlessly. The grub error 17 was a result of a changed partition table.
How to fix that is clearly described here .
But after doing that my problems weren't over.

The only change was that error 17 was now replaced by error 15.

The renaming of the booting items issue led to numerous grub 15 questions on the Arch forums: Solution
Modify /boot/grub/menu.lst so vmlinuz26 is vmlinuz-linux, kernel26.img is initramfs-linux.img and kernel26-fallback.img is initramfs-linux-fallback.img
But his was also not the problem;
I changed two aspects of my /boot/grub/menu.lst.
The reason this sort of problems is difficult to solve is that there are so many scenarios people use regarding making a dedicated booting partition or not, how the root folder is designated in /etc/fstab.
Anyway in etc/fstab my root partition was designated by the UUid that you can find by typing in the terminal
blkid.
Changing
kernel /boot/vmlinuz-linux root=/dev/sda6 ro
to
kernel /boot/vmlinuz-linux root=/dev/disk/by-uuid/xxx6840d-8769-41f4-xxxxxx ro

was one part of the solution. If in the fstab /dev/sda6 was mentioned I would have had to change the menu.lst to sda6; what I conclude is that naming should be identical in fstab and menu.lst.

Second issue
Use an absolute path to vmlinuz and initramfs.img

The fact that I don't use a separate boot partition means I had to change the default

kernel /vmlinuz-linux root=/dev/disk/by-uuid/xxx ro
initrd /initramfs-linux.img

to
kernel /boot/vmlinuz-linux root=/dev/disk/by-uuid/xxx ro
initrd /boot/initramfs-linux.img
There are a lot more reasons why you can get the error 15; forgetting to add the "ro" at the back of the line for example, but maybe somebody can use this solution.

Thursday, January 19, 2012

Easy choice between WMs using grub and xinitrc

This seems a nice way to be able to choose at grub level which DE you want to load.

At startup

You can also have a choice of window managers and desktop environments at startup, using just ~/.xinitrc and GRUB and no display manager. The idea is to take advantage of the fact that Arch doesn't make any particular use of the runlevel system. The following ~/.xinitrc tests for the current runlevel and will start Openbox and GNOME on runlevels 5 and 4 respectively:

rl=$(runlevel | grep -o [0-6])  case $rl in     4) exec gnome-session;;     5) exec openbox-session;; esac

Choosing between different runlevels is simply a matter of cloning a GRUB entry and adding the desired runlevel to the kernel arguments. Inserting the runlevel at the end of the 'kernel' line indicates that the inittab default of runlevel 5 should be overridden and replaced with the desired runlevel, 4 in this instance:

title Arch Linux GNOME
root (hd0,2)
kernel /boot/vmlinuz-linux root=/dev/sda1 ro 4
initrd /boot/initramfs-linux.img

Finally, you will need to ensure that the ~/.xinitrc file is actually run at the chosen runlevel. Using the tip from Start X at boot#/etc/inittab, you can edit the inittab to simply run startx on the desired runlevel which will in turn use your ~/.xinitrc script:

x:45:once:/bin/su PREFERED_USER -l -c "/bin/bash --login -c startx >/dev/null 2>&1"

Notice that "45" means that this will happen on both runlevels 4 and 5. The final differentiation between 4 and 5 will then come in ~/.xinitrc as described above. This is preferable to attempt differentiating in the inittab file as we stick pretty close to using the various configuration files as they were intended.

source: https://wiki.archlinux.org/index.php/Xinitrc


first published here: http://bbs.archbang.org/viewtopic.php?pid=6507#p6507

Blog Archive