You are not logged in.

#1 2009-12-29 16:18:41

TheJoe
Member
Registered: 2009-12-20
Posts: 12

[SOLVED] I need some guidance - /boot is another OS

I moved from Debian to Arch. To keep GRUB and whatnot, I made Debian my /boot partition. As such my kernel is /boot/vmlinuz26 and my GRUB directory is actually /boot/boot/grub if that helps illustrate the situation here.

I'm now ready to get rid of Debian; Arch is just much nicer in almost every way (although I keep typing apt-get when I go to install packages!).

So here's the situation, and I'm not quite sure just how to work this out in a proper, clean way. Debian needs to go and /boot should preferably be moved to Arch. I have backed up my GRUB directory, kernel and initrd image on an external drive.

My Arch installation is nicely set up now, and I don't particularly want to start the whole process again so I'm just looking for some guidance is performing the /boot move. I'd probably end up breaking something.

Thanks in advance.

Last edited by TheJoe (2009-12-30 01:07:37)

Offline

#2 2009-12-29 18:57:50

beroal
Member
From: Ukraine
Registered: 2009-06-07
Posts: 325
Website

Re: [SOLVED] I need some guidance - /boot is another OS

As such my kernel is /boot/vmlinuz26 and my GRUB directory is actually /boot/boot/grub if that helps illustrate the situation here.

This says nothing unless you show your "/etc/fstab". You should think of partitions, not directories. And GRUB and Linux have different naming conventions for partitions. You did not tell, do you want a separate boot partition, about your partitions, so I can not give a concrete advice.

In general, to move data that is needed on boot you need to keep in mind these things:
* setup GRUB such that it can find the directory with *stage* files;
* edit GRUB's "menu.lst" such that it points to the kernel, initrd and a partition with OS files;
* edit "/etc/fstab" to mount /boot directory with the kernel, initrd.
You can just copy kernel and such to the new place (though OS directories need a special care). Prepare a live CD for repairing if you'd make a mistake. Check that it can write to file systems you use (e.g. an old live CD can not write to ext4) before you change anything.

Last edited by beroal (2009-12-29 19:01:59)


we are not condemned to write ugly code

Offline

#3 2009-12-29 19:41:41

Oxyd
Member
From: Czech Republic
Registered: 2008-01-17
Posts: 167

Re: [SOLVED] I need some guidance - /boot is another OS

In addition to your /etc/fstab it would be nice to see your menu.lst.

I think this should be a relatively easy matter of simply cp'ing a few files, editing menu.lst and then wiping the Debian partition and putting it to use for other purposes. smile  But without knowing the details of your setup, it's difficult to tell exactly.

Offline

#4 2009-12-29 21:19:15

TheJoe
Member
Registered: 2009-12-20
Posts: 12

Re: [SOLVED] I need some guidance - /boot is another OS

Ok sorry, here's some more info:

/etc/fstab:

#
# /etc/fstab: static file system information
#
# <file system>        <dir>         <type>    <options>          <dump> <pass>
none                   /dev/pts      devpts    defaults            0      0
none                   /dev/shm      tmpfs     defaults            0      0

#/dev/cdrom             /media/cd   auto    ro,user,noauto,unhide   0      0
#/dev/dvd               /media/dvd  auto    ro,user,noauto,unhide   0      0
#/dev/fd0               /media/fl   auto    user,noauto             0      0

/dev/sda2 /boot ext3 defaults 0 1 #Note: this is Debian
/dev/sda4 / ext4 defaults 0 1
/dev/sda5 swap swap defaults 0 0

# Stupid automounts
/dev/sda1       /media/extra    ntfs-3g defaults 0      0
/dev/sdc1       /media/megadisk ntfs-3g defaults 0      0 #TODO: Actually make this work

And here's my menu.lst (I've only included the boot section, if you actually need the rest tell me and I will provide)

title           Arch Linux
root            (hd0,1)
kernel          /vmlinuz26 root=/dev/sda4 ro quiet vga=791
initrd          /kernel26.img

title          Microsoft Windows 7 Ultimate x64
root           (hd1,1)
savedefault
makeactive
map            (hd0) (hd1)
map            (hd1) (hd0)
chainloader    +1

title           ----------------------------------------------------
root

title           Weird Shit
root

title           Debian GNU/Linux, kernel 2.6.26-2-686
root            (hd0,1)
kernel          /boot/vmlinuz-2.6.26-2-686 root=/dev/sda2 ro quiet vga=791
initrd          /boot/initrd.img-2.6.26-2-686

title           Debian GNU/Linux, kernel 2.6.26-2-686 (single-user mode)
root            (hd0,1)
kernel          /boot/vmlinuz-2.6.26-2-686 root=/dev/sda2 ro single
initrd          /boot/initrd.img-2.6.26-2-686

Offline

#5 2009-12-29 21:59:52

Oxyd
Member
From: Czech Republic
Registered: 2008-01-17
Posts: 167

Re: [SOLVED] I need some guidance - /boot is another OS

Okay, looks good.  Now what is your /dev/sda2 partition?  Is it just the /boot partition of Debian or the whole root partition of the system?  How big is it?  If it contains the whole Debian, I guess you would want to split it up into two partitions -- one small for your Arch /boot, and the other one, bigger, to use for some data -- right?

Offline

#6 2009-12-29 22:17:47

beroal
Member
From: Ukraine
Registered: 2009-06-07
Posts: 325
Website

Re: [SOLVED] I need some guidance - /boot is another OS

If you want OS and kernel in a single partition:
* copy kernel, initrd to /boot of sda4;
* setup GRUB to /boot/grub of sda4;
* "menu.lst":

title           Arch Linux
root            (hd0,3)
kernel          /boot/vmlinuz26 root=/dev/sda4 ro quiet vga=791
initrd          /boot/kernel26.img

we are not condemned to write ugly code

Offline

#7 2009-12-29 23:56:00

TheJoe
Member
Registered: 2009-12-20
Posts: 12

Re: [SOLVED] I need some guidance - /boot is another OS

Oxyd wrote:

Okay, looks good.  Now what is your /dev/sda2 partition?  Is it just the /boot partition of Debian or the whole root partition of the system?  How big is it?  If it contains the whole Debian, I guess you would want to split it up into two partitions -- one small for your Arch /boot, and the other one, bigger, to use for some data -- right?

/dev/sda2 is both /boot AND Debian. It's the entire system. It's 46GB in total.

beroal: That's wonderful, thank you. I'll give it a go and hope for the best.
Then there's just the fun of giving that 46GB back to Arch. I might just finish reading this book tonight ^_^

If it does fail, I'll just see it as an excuse to clean my PC up a little. cool

Edit:
The move was successful, and increasing the partition's size was much snappier than I expected.

Thanks guys!

Last edited by TheJoe (2009-12-30 01:07:22)

Offline

#8 2009-12-30 13:48:46

beroal
Member
From: Ukraine
Registered: 2009-06-07
Posts: 325
Website

Re: [SOLVED] I need some guidance - /boot is another OS

TheJoe wrote:

The move was successful, and increasing the partition's size was much snappier than I expected.

You are lucky, I increased and moved NTFS partition for ~8 hours (SATA2 HDD). smile


we are not condemned to write ugly code

Offline

Board footer

Powered by FluxBB