You are not logged in.

#1 2010-02-02 06:34:39

beatbreaker
Member
Registered: 2009-07-13
Posts: 46

is it possible to use /boot dir from Ubuntu?

Hi,

I'm having some issues getting a triple boot on a macbook happening,

the arch installer has failed at updating the MBR in the macbook properley, but i did an install of ubuntu sucessfully

it's installed grub 2 and from there i can boot into OSX, XP, or Ubuntu

i was using Ubuntu lastnight and i remembered how much i hated it though so would like to know:


since /boot and the MBR are set up so nicely form ubuntu can i keep the MBR as it is, scp the working /boot directory to somewhere else, and just install Arch with a live CD, exit the install at the grub install, then scp the /boot directory from another machine into the arch install (probably mounted in /mnt/ - reboot and it'll just work?

i'll then probably have to install grub2 with pacman as that's how it's already set up in Ubuntu, grub 2 will find it's files there already and just say it's all fine?

...is there a hope in hell that'll actually work?

Offline

#2 2010-02-02 12:35:11

troodux
Member
Registered: 2010-02-02
Posts: 3

Re: is it possible to use /boot dir from Ubuntu?

Hi, I don't know whith grub 2, but I do that (or something like that) with grub 0.97 on a sidux.
While installing, i just skip the bootloader step, and i did not make a partition for /boot. In my sidux, i added these lines in /boot/grub/menu.lst (as far as i can remember for i am now at work with a MSwin box):

title Arch linux
# my *sidux* /boot part ( grub's name ) 
root (hd0,0)
# I'm not sure about 'vmlinuz26', but it's something like that. sda5 is my arch / part
kernel /boot/vmlinuz26 root=/dev/sda5 ro
initrd /boot/kernel2.6.img
boot

tips:
1 typing 'e' on a grub menu entry allow you to edit it at boot time
2 in your ubuntu : cd /boot; sudo touch me;
  and at boot time, type 'c' to enter in command mode and try >>> find /boot/me
  to get the correct (hd x,x) of the "root" line

good luck ( if ever luck has something to do with your problem smile

Last edited by troodux (2010-02-02 12:37:36)

Offline

#3 2010-02-02 13:15:05

fabertawe
Member
From: Lloegr
Registered: 2009-11-24
Posts: 279

Re: is it possible to use /boot dir from Ubuntu?

I installed Grub2 when I was using Ubuntu because I didn't want a /boot partition (see http://bbs.archlinux.org/viewtopic.php?id=86376 for configuration from Ubuntu) and it works great for Arch.

Now I'm exclusively using Arch I installed Grub2 natively (without installing to MBR). This is my /boot/grub/grub.cfg

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
#if [ -s /boot/grub/grubenv ]; then
#  have_grubenv=true
#  load_env
#fi
set default="0"
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set 80db2d73-6dea-465c-a9a2-b14624badc57
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=1024x768x32
  set gfxpayload=1024x768x32
  insmod gfxterm
  insmod vbe
  if terminal_output gfxterm ; then true ; else
    # For backward compatibility with versions of terminal.mod that don't
    # understand terminal_output
    terminal gfxterm
  fi
fi
insmod png
background_image /boot/grub/grub2.png
if [ ${recordfail} = 1 ]; then
  set timeout=-1
else
  set timeout=5
fi

set menu_color_normal=light-gray/black
set menu_color_highlight=yellow/black

menuentry "Arch Linux (on /dev/sda5)" {
    set root=(hd0,5)
    linux /boot/vmlinuz26 root=/dev/disk/by-uuid/80db2d73-6dea-465c-a9a2-b14624badc57 ro
    initrd /boot/kernel26.img
}
menuentry "Arch Linux (fallback)" {
    set root=(hd0,5)
    linux /boot/vmlinuz26 root=/dev/disk/by-uuid/80db2d73-6dea-465c-a9a2-b14624badc57 ro
    initrd /boot/kernel26-fallback.img
}
menuentry "Windows XP" {
set root=(hd0,1)
chainloader +1
}

I've changed the resolution and added an image so you may just want to copy the menuentry parts, altering as required obviously.


Ryzen 9 5950X, X570S Aorus Pro AX, RX 6600, Arch x86_64

Offline

#4 2010-02-06 00:36:51

beatbreaker
Member
Registered: 2009-07-13
Posts: 46

Re: is it possible to use /boot dir from Ubuntu?

the menu.lst (or grub.conf - i don't remember) has been set up perfectly by the Ubuntu installer - that's why i'm finding it hard to give up

...so if i get stuff running - then the MBR will point to the Ubuntu grub2 menu.lst (or grub.conf) and i'll just edit that file to make it point to the arch kernel...

i'm worried because the new grub2 menu shouldn't be directly edited - can i stuff it up? i have a fair idea of how it should look to get arch booted, i'm just worried something (magical) will tell it not to boot from there because i edited that file manually and didn't use the new grub2 setup program

also IF i then get arch to boot, if i do a pacman -Sy grub2 (or whatever) will it then see that I've already got the files in /boot and just make stuff work from there? or will it eraze over them (and maybe put on it's own MBR) ?

hummm so many concerns!

thanks to everyone so far for the advice - i think i'll be able to get it going now for sure after i know a little bit more.

Offline

#5 2010-02-08 12:15:16

fabertawe
Member
From: Lloegr
Registered: 2009-11-24
Posts: 279

Re: is it possible to use /boot dir from Ubuntu?

beatbreaker wrote:

the menu.lst (or grub.conf - i don't remember) has been set up perfectly by the Ubuntu installer - that's why i'm finding it hard to give up

...so if i get stuff running - then the MBR will point to the Ubuntu grub2 menu.lst (or grub.conf) and i'll just edit that file to make it point to the arch kernel...

i'm worried because the new grub2 menu shouldn't be directly edited - can i stuff it up?

My bad... of course it's installed to MBR, my memory's not what it was hmm Have a look at the wiki article http://wiki.archlinux.org/index.php/GRUB2 for installing and boot loader installation. There is no update grub command with Arch so you have to edit grub.cfg by hand after generating it (as far as I'm aware).


Ryzen 9 5950X, X570S Aorus Pro AX, RX 6600, Arch x86_64

Offline

#6 2010-02-08 20:18:32

michy99
Member
Registered: 2010-01-23
Posts: 21

Re: is it possible to use /boot dir from Ubuntu?

If you run update-grub from within Ubuntu with grub2, it will find the arch installation and add it to the menu automatically. That is unless you have disabled os-prober. This works great if you are planning to keep both the Ubuntu and arch on your machine.

Offline

#7 2010-02-09 07:29:44

beatbreaker
Member
Registered: 2009-07-13
Posts: 46

Re: is it possible to use /boot dir from Ubuntu?

michy99 wrote:

If you run update-grub from within Ubuntu with grub2, it will find the arch installation and add it to the menu automatically. That is unless you have disabled os-prober. This works great if you are planning to keep both the Ubuntu and arch on your machine.

I'm not sire you understand, I'm not getting ubuntu on the MacBook, I put it there because
last time I installed arch it ruined my mbr.

How it looks now:
sda1 osx boot loader
sda2 osx
sda3 ubuntu
sda3 XP

How i want it to look
sda1 osx boot loader
sda2 osx
sda3 arch
sda3 XP

I just want arch using the setup ubuntu mbr and /boot and I don't want the arch installer writing over the mbr, it's my biggest concern

Offline

#8 2010-02-09 08:24:47

stryder
Member
Registered: 2009-02-28
Posts: 500

Re: is it possible to use /boot dir from Ubuntu?

I can't see why it won't work. After all the actual operating system comes into play after you have triggered the system you want to boot. So as  long as your mbr/boot is intact, surely it will work. I must confess though that I speak only from logic, not experience. big_smile However, I would just rename the present boot folder (make a copy elsewhere if you wish), delete the rest of ubuntu and then install arch without reformatting the partition (can't remember if this is possible). Skip the boot installer part of arch setup, then move the relevant files in archboot to the ubuntuboot folder after renaming it back to /boot. Then edit grub.cfg to point to the arch kernel and img files keeping the uuid, etc. intact. When you reboot into arch, use the fallback option. Then mkinitcpio again.

If it works and you want to complete your installation, you can pacman -S grub2 and then grub-install to mbr but keep a copy of your working grub.cfg somewhere to re-use. Otherwise just enjoy what you have.

Good luck! big_smile

Offline

#9 2010-02-09 17:50:27

fabertawe
Member
From: Lloegr
Registered: 2009-11-24
Posts: 279

Re: is it possible to use /boot dir from Ubuntu?

michy99 wrote:

If you run update-grub from within Ubuntu with grub2, it will find the arch installation and add it to the menu automatically. That is unless you have disabled os-prober. This works great if you are planning to keep both the Ubuntu and arch on your machine.

It didn't work great for me, Arch would never boot until I disabled os_prober and put the right configuration in Ubuntu's /etc/grub.d/40_custom.


Ryzen 9 5950X, X570S Aorus Pro AX, RX 6600, Arch x86_64

Offline

#10 2010-02-21 01:31:18

beatbreaker
Member
Registered: 2009-07-13
Posts: 46

Re: is it possible to use /boot dir from Ubuntu?

Ok i'm close,

Unfortunately i need to have grub2 set up for this to work i think

so what i did was scp my working ubuntu /boot/ over to anohter machine

then i installed arch on sda3 but didn't install grub

i then backed up the arch /boot and scp the old working grub2 /boot

i then copied over the arch vmlinuz26 and kernel26.img files to the new /boot

i did some editing of grub.cfg but i don't think i got it right, first all the uuids are wrong for my machine, i think i have to set them up manually, and also i don't have any of the grub2 files i /etc (I forgot all about them)

where can I get the /etc/grub.d files??

I'm concerned if i try to install grub2 while in the live cd it'll ruin my mbr again..

here's my grub.cfg

http://paste.pocoo.org/show/180658/

Offline

#11 2010-02-22 03:44:56

stryder
Member
Registered: 2009-02-28
Posts: 500

Re: is it possible to use /boot dir from Ubuntu?

If you have reformatted your partition, the uuid changes. Simplest would be to find out by booting your livecd. Use the blkid command.

I would hazard a guess that you can find your grub2 config files in your ubuntu livecd /etc when you boot it up.

Replace the uuid for sda3 in the 2 sections they are used. Make sure you have backed up a copy of your grub.cfg.

Your arch entry should resemble the ubuntu entry, except for the kernel reference and the initrd line.

This is my entry (using label instead of uuid) if you want to try a different format:

# (0) Arch64
menuentry "Arch64" {
search --no-floppy --label arch64 --set root
linux /boot/vmlinuz26 root=/dev/disk/by-label/arch64 ro
initrd /boot/kernel26.img
}

If you have problems when booting into your arch, try the fallback image. Then rebuild the images.

Offline

#12 2010-02-22 06:58:45

beatbreaker
Member
Registered: 2009-07-13
Posts: 46

Re: is it possible to use /boot dir from Ubuntu?

Yeah actually I got it working yesterday I didn't need the /etc/grub.d files, I dunno why. I had a feeling it was uuids so I looked in /dev/diskbyuuid or something and fixed it in knoppix.

I'll post up my grub.cfg for closure and mark it solved when I get home.

Offline

#13 2010-02-22 10:57:57

stryder
Member
Registered: 2009-02-28
Posts: 500

Re: is it possible to use /boot dir from Ubuntu?

/etc/grub.d files are for you to generate the grub.cfg, AFAIK. You don't need them to boot.

Offline

Board footer

Powered by FluxBB