You are not logged in.
Hello! This is my first time posting on the forums. Please bear with me as I am a newb to Linux in general.
I just installed Archlinux and I'm loving it! But I've run into a problem... When I rebooted my computer I noticed that Lubuntu was missing from the grub bootloader. I made sure to create new partitions beforehand and install Arch to said partitions, so I'm not sure where I went wrong. I've been searching the internet and found nothing so I decided ask here.
Here's the boot sections of /boot/grub/menu.lst
# (0) Arch Linux
title Arch Linux
root (hd0,2)
kernel /boot/vmlinuz-linux root=/dev/sda3 ro
initrd /boot/initramfs-linux.img
# (1) Arch Linux
title Arch Linux Fallback
root (hd0,2)
kernel /boot/vmlinuz-linux root=/dev/sda3 ro
initrd /boot/initramfs-linux-fallback.img
# (2) Windows
#title Windows
#rootnoverify (hd0,0)
#makeactive
#chainloader +1I dont have windows on this computer so I dont know why that last section is listed.
Thanks for any help given.
Last edited by SuperHackerDaru (2011-10-18 21:21:18)
Offline
I believe the grub package does not automatically add entries and that it only gives you a template to work with. You can easily copypaste one of them and fill in the correct root, kernel and initrd. Unfortunately I do not know the names of the kernel/initrd in Ubuntu but you can mount your Lubuntu partition and look it up.
Last edited by Cilph (2011-10-16 17:15:44)
Offline
I believe the grub package does not automatically add entries and that it only gives you a template to work with. You can easily copypaste one of them and fill in the correct root, kernel and initrd. Unfortunately I do not know the names of the kernel/initrd in Ubuntu but you can mount your Lubuntu partition and look it up.
Could you tell me how to do that? I tried mounting using the mount command and this is what I got:
[arch@ArchHost ~]$ mount /dev/sda1
mount: can't find /dev/sda1 in /etc/fstab or /etc/mtab
[arch@ArchHost ~]$ mount /dev/sda1 Here's the fdisk
[arch@ArchHost ~]$ sudo fdisk -l
Password:
Disk /dev/sda: 31.0 GB, 31016853504 bytes
255 heads, 63 sectors/track, 3770 cylinders, total 60579792 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000126c7
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 29109779 14553866 83 Linux
/dev/sda2 56403966 60577791 2086913 5 Extended
/dev/sda3 29109780 53994464 12442342+ 83 Linux
/dev/sda4 53994465 56388149 1196842+ 82 Linux swap / Solaris
/dev/sda5 56403968 60577791 2086912 82 Linux swap / Solaris
Partition table entries are not in disk orderOffline
We know you're a bit frustrated, just take your time. Look up commands that aren't yet familiar. Manpages, the Archwiki and Googling will help you learn.
Your mount command doesn't tell the kernel where to mount /dev/sda1. Try Googling "linux mount partition".
Offline
Arch has Grub legacy and Lubuntu has Grub2. You can use either of them to boot up the other, direct or indirect by chainloading.
If you want to use Grub legacy from Arch to directly boot up Lubuntu, you have to manually add Lubuntu's boot options in Arch's menu.lst. This you have to do every time Lubuntu gets a kernel update. You can find Lubuntu's boot options in /boot /grub/grub.cfg. That file is for Grub2 what menu.lst is for Grub legacy.
Or you can install Lubuntu's Grub2 in mbr. It will automatically find Arch when you run "update-grub". I'm not sure if it automatically finds the new kernel after an upgrade, I don't think so I think it only reads menu.lst and add those entries it finds there.
One third alternative is that you install Grub2 on Lubuntu's partition and use chainloading from Grub legacy. Then both distros will maintain their own bootloaders. I myself prefer this set up even though it is not as stable as the other. In case Lubuntu gets an update to Grub it can crash, because it then has to move one file that Grub can only find at one exact location. (I've had multiboot set up like this for 10 months and never had any crash because of this.)
Read about Grub and Grub2 and decide for yourself what to do.
Offline
Thank you everyone! I'm going to try to install Grub2 to mbr in just a bit. I'll post what happens here.
I have a question though, would this be a problem if I installed Arch alongside Windows instead of Lubuntu? Because I'm thinking of installing Arch on my other computer but I dont want to potentially lose access to my files.
Offline
Okay, here's what's going on: I've successfuly installed grub2 and ran:
sudo grub-mkconfig -o /boot/grub/grub.cfg(The update-grub command wouldn't work) but for some odd reason,it wont find Lubuntu's kernel or initrd files... I've mounted the partiton and double-checked that the Lubuntu initrd and vmlinuz file were indeed there.
Any Ideas?
Offline
How did you install Grub2? Did you use Lubuntu's liveCD? To reinstall grub in mbr to a distro that you can't boot up, it's important you do it from a distro that has the same version of grub. If you succed installing grub 2, "sudo update-grub" should work and give the same result as grub-mkconfig... (I have only used update-grub and it always works.)
Hm, I might be blind or just didn't look carefully enough, but I couldn't see the commands to reinstall grub2... Here's another link where you can read about it. And just to make you even more confused, there's a difference between grub 1.98 and 1.99 (both are called grub2)...
If you use these commands it works both for grub 1.98 and 1.99. (Change sda1 to your Lubuntu partition. Now I just assume you don't have a separate boot partition for Lubuntu. If you have, again it will be different...)
From Lubuntu's liveCD:
sudo mount /dev/sda1 /mnt
sudo grub-install --root-directory=/mnt /dev/sdaOffline
I've never had luck getting arch to automatically detect auto distros and windows. My solution has been to manually create entries. The grub2 wiki page explains how and it sounds like you know where lubuntu is installed so it shouldnt be a problem.
Offline
To have a way of autodetecting other distros installed, you might want to check this out:
http://aur.archlinux.org/packages.php?ID=35572
Youll have to do a little research here, as I dont use os-prober and manually manage my grub.cfg.
Alternatively, you can find out what partition Lubuntu is on by doing
fdisk -las root. Say Lubuntu is on /dev/sda1 (youll have to figure out what partition Lubuntu is on- you can usually tell by size and by noting which partitions are mounted). You could do the following:
sudo mount /dev/sda1 /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo chroot /mntAt this point, you are chroot'ed into the Lubuntu partition. Now, update grub (which uses the os-prober listed above which is automatically installed in most buntu variants) and install Lubuntu's grub to the mbr:
update-grub
grub-install /dev/sdaNow, exit the chroot and reboot the computer- your bootloader should now be Lubuntu's with Arch listed as well.
**EDIT** Looking at your fdisk output above, it appears /dev/sda1 and /dev/sda3 are the Arch and Ubuntu partitions. It appears that you have no separate /boot or /home partitions for either. I should let you know that it is completely unnecessary to have more than 1 swap partition- you can have 10 linux distros pointed to the same swap partition without issue. Im guessing that Lubuntu is on /dev/sda1 and that you (Arch) is/are on /dev/sda3, so my above instructions should work.
Last edited by GSF1200S (2011-10-18 05:53:46)
Offline
Os-prober did the trick for me with grub2 while quad-booting (why 4, now that I think about it?) Windows 7, Gentoo, Arch and Crunchbang. You may have to edit the grub.cfg a bit to prevent all sorts of memchecks and whatever from appearing in the grub boot menu, but it finds them nonetheless.
I played around with os-prober a litte to see how it is done and what's what and after a few times I could do it myself.
Offline
IT WORKS!! I followed GSF1200S's instructions and it worked perfectly. The only odd thing was that when I first rebooted my computer, it immedietly booted into Lubuntu without bringing me to the bootloader. But all I had to do was run update-grub again and bootloader ran again.
Thank you everyone! I'll go ahead and mark this thread [SOLVED].
Offline