Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
BTRFS and lilo
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
jenkler
Tux's lil' helper
Tux's lil' helper


Joined: 28 Apr 2003
Posts: 135
Location: Sweden - Stockholm

PostPosted: Sat Jan 28, 2012 1:15 pm    Post subject: BTRFS and lilo Reply with quote

EDIT - GOOD TO KNOW:
-------
Enable CONFIG_BOOT_DELAY=y
Then append boot_delay=200 at lilo boot
-------

Hello everyone!

Just want to know is anyone has got it to work with lilo and btrfs

I want to boot af a 2 disk system in btrfs mirror mode from lilo native. No boot partition or initrd.

please share any findings ;-)
_________________
Get great fashion advice here: Fashion forum, what have you got to lose?
All clothing and fashion collected online in one place!

/Jenkler


Last edited by jenkler on Fri Mar 16, 2012 4:01 pm; edited 1 time in total
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2557
Location: Slovenia

PostPosted: Sat Jan 28, 2012 2:07 pm    Post subject: Reply with quote

I know it's a stupid question, but I have to ask anyway, and you for sure have predicted that it will be asked. So here we go: Why?

Follow-up question: Have you considered syslinux?
Back to top
View user's profile Send private message
Ant P.
Veteran
Veteran


Joined: 18 Apr 2009
Posts: 1920
Location: UK

PostPosted: Sat Jan 28, 2012 10:17 pm    Post subject: Reply with quote

You have four options:
  • Use an initrd.
  • Use a separate /boot partition.
  • Use a Btrfs-compatible bootloader.
  • Fix LILO yourself.

What you're asking is not currently possible.
Back to top
View user's profile Send private message
jenkler
Tux's lil' helper
Tux's lil' helper


Joined: 28 Apr 2003
Posts: 135
Location: Sweden - Stockholm

PostPosted: Sun Jan 29, 2012 2:04 pm    Post subject: yeah Reply with quote

I relly want lilo :-D but i don't have the knowlage to patch it :-(, in other wrods i need to wait
_________________
Get great fashion advice here: Fashion forum, what have you got to lose?
All clothing and fashion collected online in one place!

/Jenkler
Back to top
View user's profile Send private message
Etal
Veteran
Veteran


Joined: 15 Jul 2005
Posts: 1633

PostPosted: Sun Jan 29, 2012 3:06 pm    Post subject: Re: yeah Reply with quote

jenkler wrote:
I relly want lilo :-D


What is it about LILO that you want? ;)
_________________
“And even in authoritarian countries, information networks are helping people discover new facts and making governments more accountable.”– Hillary Clinton, Jan. 21, 2010
Back to top
View user's profile Send private message
jenkler
Tux's lil' helper
Tux's lil' helper


Joined: 28 Apr 2003
Posts: 135
Location: Sweden - Stockholm

PostPosted: Fri Mar 16, 2012 8:17 am    Post subject: Re: yeah Reply with quote

Etal wrote:
jenkler wrote:
I relly want lilo :-D


What is it about LILO that you want? ;)


I love the Simpleness of lilo. but it seams that i can't get it to work ;-(
_________________
Get great fashion advice here: Fashion forum, what have you got to lose?
All clothing and fashion collected online in one place!

/Jenkler
Back to top
View user's profile Send private message
XavierMiller
Moderator
Moderator


Joined: 23 Jul 2004
Posts: 4614
Location: ~Brussels - Belgique

PostPosted: Fri Mar 16, 2012 8:41 am    Post subject: Reply with quote

Hello,

Syslinux (extlinux) is compatible with BTRFS, as I see in their websites. This could be an alternative to LILO.

(BTW I switched from GRUB to SYSLINUX because of GRUB2 mess)
_________________
Xavier Miller
(FR) Merci de respecter les règles du forum.
http://www.xaviermiller.be
Back to top
View user's profile Send private message
jenkler
Tux's lil' helper
Tux's lil' helper


Joined: 28 Apr 2003
Posts: 135
Location: Sweden - Stockholm

PostPosted: Fri Mar 16, 2012 9:41 am    Post subject: I now have an setup... Reply with quote

Raid 1:

mkfs.btrfs -m raid1 -d raid1 /dev/sda /dev/sdb

boot on usb stick (lilo in mbr) /dev/sdc

mkfs.ext4 /dev/sdc


i have /dev/sda and /dev/sdb in raid1 setup without any partitions, msdos or GPT tables, just plain discs

i boot from /dev/sdc with lilo and tried to append this but it does not work.

append = "root=/dev/sda rootfstype=btrfs rootflags=device=/dev/sda,device=/dev/sdb"

I get this: http://imagebin.org/203685

if i do this only

append = "root=/dev/sda" or use root = /dev/sda

I get this: http://imagebin.org/203687
it finds btrfs but is unable to setup the array
_________________
Get great fashion advice here: Fashion forum, what have you got to lose?
All clothing and fashion collected online in one place!

/Jenkler
Back to top
View user's profile Send private message
kingfame_147
Apprentice
Apprentice


Joined: 11 Oct 2008
Posts: 167

PostPosted: Fri Mar 16, 2012 10:19 am    Post subject: Reply with quote

Hi,

let's start with the second cmdline:

This is intend to happen :) You have a multi disk btrfs and don't do a "btrfs device scan". Therefore btrfs tries to mount a multi disk fs with only one known device with has to fail. append "rootflags=degraded" to your second cmdline and it will work. However, you will only use one device. In you case I would test this one time to see if your filesystem is ok.

First cmdline:

Unfortunately I never used lilo nor have any idea how to use it.



What I would do: Grab a live cd and play around a little bit. Do something like "mount -o degraded /dev/sda /mnt", then "mount -o device=/dev/sda,/dev/sdb /dev/sda /mnt" and see if it works. If this works there is something wrong the way you tell lilo to mount your root device. If this doesn't work there is something wrong with your filesystem.
Back to top
View user's profile Send private message
jenkler
Tux's lil' helper
Tux's lil' helper


Joined: 28 Apr 2003
Posts: 135
Location: Sweden - Stockholm

PostPosted: Fri Mar 16, 2012 11:03 am    Post subject: Thanks Reply with quote

kingfame_147 wrote:
The @root is just the name of a subvolume. What you normally do with btrfs:

Create a filesystem and then add subvolumes like @root, @etc, @var... Then you mount @root to /, @etc to /etc, @var to /var... Then you can snapshot and rollback the single subvolumes independently


But i only use mkfs.btrfs -m raid1 -d raid1 /dev/sda /dev/sdb no subvolumes at all, are you sure that i don't need the subvol= for rootflags?
Is it possible that the rootflags is broken? i will test the degraded stuff when i home


My test is append="root=/dev/sda rootflags=degraded" <-- if that is not working the the rootflags is broken right?

as you kan see here http://imagebin.org/203681 the kernel commad line is correct or is it ? does it matter if i use grub, syslinux or lilo when iam at this stage?


mount -o degraded /dev/sda /mnt/gentoo <-- works great on live cd

but then

root@sysresccd /root % mount -o device=/dev/sda,/dev/sdb /dev/sda /mnt/gentoo
mount: /dev/sda already mounted or /mnt/gentoo busy
mount: according to mtab, /dev/sda is already mounted on /mnt/gentoo

Don't, another but


mount -o remount,rw,device=/dev/sda,device=/dev/sdb -t btrfs /dev/sda /mnt/gentoo <-- works, seams to be correct

mount prints:
/dev/sda on /mnt/gentoo type btrfs (rw,device=/dev/sda,device=/dev/sdb)


root@sysresccd /root % btrfs filesystem show
Label: 'dust' uuid: c7e98b6b-3bb5-462a-a190-290d12575634
Total devices 2 FS bytes used 1.76GB
devid 2 size 465.76GB used 3.27GB path /dev/sdb
devid 1 size 465.76GB used 3.27GB path /dev/sda








I also have:
/dev/sda / btrfs device=/dev/sda,device=/dev/sdb 0 0

in fstab
_________________
Get great fashion advice here: Fashion forum, what have you got to lose?
All clothing and fashion collected online in one place!

/Jenkler
Back to top
View user's profile Send private message
kingfame_147
Apprentice
Apprentice


Joined: 11 Oct 2008
Posts: 167

PostPosted: Fri Mar 16, 2012 12:04 pm    Post subject: Reply with quote

You don't need the subvol= part if you don't use subvolumes. btrfs creates a default subvolume which is mounted if no subvol= is used.

I actually don't know if the rootflags is broken, because I don't know how lilo handles those :( In image it looks like there is a = missing, like "rootflags device=/dev.." instead of "rootflags=/dev/...". But this could be because of the picture.

Syslinux isn't a bootloader, isn't it? It doesn't matter if you use grub or lilo, you just have to use the right syntax.


Live CD:

Ok, that's a good sign :) Your filesystem works. But don't use the degraded option as a workaround. It is only a test. Normally you use this option in a raid if one device is broken and you want to replace it.

The second test is failing because you have to umount the device first "umount /mnt/gentoo", then try the command again. If it works: There is something wrong with your lilo configuration. Somebody who know how to use lilo has to help you out then.



Btw: Why don't you just use dracut as an initramfs? It is very easy to setup and will really help you with btrfs.
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2557
Location: Slovenia

PostPosted: Fri Mar 16, 2012 12:17 pm    Post subject: Reply with quote

kingfame_147 wrote:
Syslinux isn't a bootloader, isn't it?

LOL. Of course it is. A damn fine one. As simple as it gets and yet fully functional (well, except on my netbook, but I blame the netbook :)).


Last edited by Gusar on Fri Mar 16, 2012 12:20 pm; edited 1 time in total
Back to top
View user's profile Send private message
jenkler
Tux's lil' helper
Tux's lil' helper


Joined: 28 Apr 2003
Posts: 135
Location: Sweden - Stockholm

PostPosted: Fri Mar 16, 2012 12:19 pm    Post subject: Reply with quote

mount -o degraded /dev/sda /mnt/gentoo
then
mount -o remount,rw,device=/dev/sda,device=/dev/sdb -t btrfs /dev/sda /mnt/gentoo

works and seams to be correct

mount prints:
/dev/sda on /mnt/gentoo type btrfs (rw,device=/dev/sda,device=/dev/sdb)


but a workaround would be the degraded stuff + a remount from fstab or something. I dont want any intird and i want to use lilo, thats why this case is so hard to break

lilo does not support btrfs so i have the usbstick workaround and it works. I hope that this degraded tuff is not the only solution for me ...


I hate initrd, grub, genkernel and modules, it so fucking blooted. Sorry

append="rootfstype=btrfs root=/dev/sda rootflags=device=/dev/sdb"
_________________
Get great fashion advice here: Fashion forum, what have you got to lose?
All clothing and fashion collected online in one place!

/Jenkler


Last edited by jenkler on Fri Mar 16, 2012 1:53 pm; edited 2 times in total
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2557
Location: Slovenia

PostPosted: Fri Mar 16, 2012 12:24 pm    Post subject: Reply with quote

jenkler, don't you think it'd be much simpler to just use another bootloader, instead of futzing around with usb sticks and such? You can't have that big of a loyalty to a bootloader. I'd get it if it was a userspace app that's exactly what you want. But bootloader? As much as I like syslinux, I immediately went to grub on my netbook. Because it simply works better on that crazy machine.
Back to top
View user's profile Send private message
jenkler
Tux's lil' helper
Tux's lil' helper


Joined: 28 Apr 2003
Posts: 135
Location: Sweden - Stockholm

PostPosted: Fri Mar 16, 2012 12:33 pm    Post subject: Reply with quote

Gusar: I love lilo because its simple and does not put alot of crap in the system + it silly but i have a boot logo that i like in lilo ;-D

I hate to giveup if its a small chance its possible to do this. There is allways gurus out there that know how to do it
_________________
Get great fashion advice here: Fashion forum, what have you got to lose?
All clothing and fashion collected online in one place!

/Jenkler
Back to top
View user's profile Send private message
jenkler
Tux's lil' helper
Tux's lil' helper


Joined: 28 Apr 2003
Posts: 135
Location: Sweden - Stockholm

PostPosted: Fri Mar 16, 2012 2:52 pm    Post subject: Question! Reply with quote

How do I create device files at boot time without an initrd , anyone?

Do i need to patch something ?
_________________
Get great fashion advice here: Fashion forum, what have you got to lose?
All clothing and fashion collected online in one place!

/Jenkler
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2557
Location: Slovenia

PostPosted: Fri Mar 16, 2012 3:02 pm    Post subject: Reply with quote

There's devtmpfs. If you need anything beyond that, not possible without an initramfs.
Back to top
View user's profile Send private message
jenkler
Tux's lil' helper
Tux's lil' helper


Joined: 28 Apr 2003
Posts: 135
Location: Sweden - Stockholm

PostPosted: Fri Mar 16, 2012 3:31 pm    Post subject: Reply with quote

Gusar wrote:
There's devtmpfs. If you need anything beyond that, not possible without an initramfs.


Cool ;-D

Ok, i only need to map /dev/sda and /dev/sdb at boot time, is the possible?

CONFIG_DEVTMPFS <-- hmm sounds cool
_________________
Get great fashion advice here: Fashion forum, what have you got to lose?
All clothing and fashion collected online in one place!

/Jenkler
Back to top
View user's profile Send private message
AngelKnight
Tux's lil' helper
Tux's lil' helper


Joined: 14 Jan 2003
Posts: 110

PostPosted: Fri Mar 16, 2012 10:42 pm    Post subject: Re: Question! Reply with quote

jenkler wrote:
How do I create device files at boot time without an initrd, anyone?

Do i need to patch something ?


To answer the question above: sufficiently-recent kernels have "devtmpfs" support.

But to the topic of this thread: BTRFS-on-/ without an initrd is probably not going to happen at this time if the / filesystem is a multi-disk BTRFS.

The primary problem is that the btrfs fs code will not reliably mount the disk at kernel start-time if something hasn't done "btrfs device scan" first.

As far as I know, at this time you can either hack up the kernel to start a tasklet that simulates all the userspace things "btrfs device scan" does (not likely easy without knowing which major/minor devices to open in advance), or give up and use an initrd.


Last edited by AngelKnight on Sat Mar 24, 2012 10:42 am; edited 1 time in total
Back to top
View user's profile Send private message
kingfame_147
Apprentice
Apprentice


Joined: 11 Oct 2008
Posts: 167

PostPosted: Mon Mar 19, 2012 9:54 am    Post subject: Reply with quote

@AngelKnight

As I mentioned before btrfs doesn't need the btrfs device can. You can simply mount any multi device btrfs with via

Code:
mount -o device=/dev/sda,/dev/sdb /dev/sda /mnt


This works with grub and should work with lilo.


@T

I don't understand why devtmpfs would help you with your problem. What about asking the lilo devs for help regarding your problems with the mount options. You tried

Code:
mount -o remount,rw,device=/dev/sda,device=/dev/sdb -t btrfs /dev/sda /mnt/gentoo


and it worked. Therefore using this options should work at boot time, too. If not there is something going wrong which is not related to btrfs.
Back to top
View user's profile Send private message
AngelKnight
Tux's lil' helper
Tux's lil' helper


Joined: 14 Jan 2003
Posts: 110

PostPosted: Sat Mar 24, 2012 10:46 am    Post subject: Reply with quote

[quote="kingfame_147"]@AngelKnight

As I mentioned before btrfs doesn't need the btrfs device can. You can simply mount any multi device btrfs with via

Code:
mount -o device=/dev/sda,/dev/sdb /dev/sda /mnt


If the disk layout changes (think BTRFS RAID1-data RAID1-metadata), the bootloader will reference non-existent devices for /. This isn't a good idea if one wants a / that survives the loss of one disk.
Back to top
View user's profile Send private message
kingfame_147
Apprentice
Apprentice


Joined: 11 Oct 2008
Posts: 167

PostPosted: Sat Mar 24, 2012 10:51 am    Post subject: Reply with quote

?! A loss of one disk isnt a problem at all. Just add the "degraded" option to the rootflags, replace the disk with a new one and remove the "degraded" option.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum