Re: [gentoo-user] Installing BTRFS on MBR with OpenRC
On Saturday 15 August 2015 12:03:32 I wrote: It looks as though Neil has hit the nail on the head. It turns out that the kernel command line has to specify either the label or the UUID of the root partition. I prefer the more legible label, thus: menuentry 'Gentoo Linux 4.0.5' { linux /boot/kernel-x86_64-4.0.5-gentoo root=LABEL=GENTOO net.ifnames=0 } The label came from mkfs.btrfs -m raid1 -d raid1 --label=GENTOO /dev/sda4 /dev/sdb4 when I was creating the file-system. -- Rgds Peter
Re: [gentoo-user] Installing BTRFS on MBR with OpenRC
On 15 August 2015 8:54:56 AM AEST, Peter Humphrey pe...@prh.myzen.co.uk wrote: # cat /boot/grub/grub.cfg root (hd0,1) timeout 10 Menuentry 'Gentoo Linux 4.0.5, no X { linux /boot/kernel-x86_64-4.0.5-gentoo root=/dev/sda4 softlevel=nox net.ifnames-0 I presume the -0 is a typo. Should be =0 ? Not that its likely to be related initrd /boot/initramfs-4.0.5-gentoo.img } # grep initrd /var/log/dracut.log I: *** Creating initrd image file '/boot/initramfs-4.0.5-gentoo.img' done *** ---8 # ls -l /boot ---8 -rw--- 1 root root 6.7M Aug 14 23:22 initramfs-4.0.5-gentoo.img -rw-r--r-- 1 root root 3.9M Aug 14 23:12 kernel-x86_64-4.0.5-gentoo ---8 # grep btr /etc/fstab LABEL=GENTOO / btrfs defaults0 0 Have you tried putting /dev/sda4 in place of LABEL=GENTOO? Probably wont help, but worth a try. All that seems right to me. The label came from mkfs.btrfs -m raid1 -d raid1 --label=GENTOO /dev/sda4 /dev/sdb4 Adding rootdelay=30 made no difference either. In fact I didn't see such a pause. It does smell like a timing issue, but I'm out of ideas, I'm afraid. -- :b
Re: [gentoo-user] Installing BTRFS on MBR with OpenRC
On Saturday 15 August 2015 20:46:32 Bruce Schultz wrote: On 15 August 2015 8:54:56 AM AEST, Peter Humphrey pe...@prh.myzen.co.uk wrote: # cat /boot/grub/grub.cfg root (hd0,1) timeout 10 Menuentry 'Gentoo Linux 4.0.5, no X { linux /boot/kernel-x86_64-4.0.5-gentoo root=/dev/sda4 softlevel=nox net.ifnames-0 I presume the -0 is a typo. Should be =0 ? Not that its likely to be related initrd /boot/initramfs-4.0.5-gentoo.img Yes, you're right; it's a typo. The selection and paste buffers are distinctly rocky into and out of VirtualBox, so I had the two windows adjacent and typed what I read (almost!). ---8 # grep btr /etc/fstab LABEL=GENTOO / btrfs defaults0 0 Have you tried putting /dev/sda4 in place of LABEL=GENTOO? Probably wont help, but worth a try. Yes, tried that. It does smell like a timing issue, but I'm out of ideas, I'm afraid. It looks as though Neil has hit the nail on the head. -- Rgds Peter
Re: [gentoo-user] Installing BTRFS on MBR with OpenRC
On Saturday 15 August 2015 04:15:37 Neil Bothwick wrote: On Fri, 14 Aug 2015 23:54:56 +0100, Peter Humphrey wrote: # cat /boot/grub/grub.cfg root (hd0,1) timeout 10 Menuentry 'Gentoo Linux 4.0.5, no X { linux /boot/kernel-x86_64-4.0.5-gentoo root=/dev/sda4 softlevel=nox net.ifnames-0 initrd /boot/initramfs-4.0.5-gentoo.img } Is this what dracut --print-cmdline recommended? This is one long series of humbl^W learning experiences. -- Rgds Peter
Re: [gentoo-user] Installing BTRFS on MBR with OpenRC
On Friday 14 August 2015 09:54:33 I wrote: On Friday 07 August 2015 09:49:24 I wrote: I'll let you know when I've finished building the VM and tried to boot it. Thanks for your help. I have now followed Rich's procedure to build the VM, and it does boot - once! After that, on every boot it complains failed to read the system array and I'm dropped into a dracut repair shell. Then btrfs device scan exit allows the boot to finish. Actually, it turns out that the device scan isn't needed: just an exit or control-d is enough. So I ran dracut again with add_dracutmodules+=”btrfs” and add_drivers+=”btrfs” but that didn't help. Specifying device=/dev/sda4,device=/dev/sdb4 on the kernel command line didn't help either. -- Rgds Peter
Re: [gentoo-user] Installing BTRFS on MBR with OpenRC
On Friday 07 August 2015 08:18:40 Rich Freeman wrote: On Fri, Aug 7, 2015 at 7:39 AM, Peter Humphrey pe...@prh.myzen.co.uk wrote: Yes, I remember about your rescue ISO. I may do the same once I work out how to incorporate my own customisations into it. Maybe that should be the first thing to do. I have a USB stick like that, but it refuses to boot any more. ---8 So, if you have a USB stick that won't boot, consider that the problem may actually lie in your BIOS... I should have been clearer. What actually happens is that the stick does boot, but I have no keyboard or mouse. I use a USB KVM switch and it's likely that it's being uncooperative. -- Rgds Peter
Re: [gentoo-user] Installing BTRFS on MBR with OpenRC
On Friday 07 August 2015 09:49:24 I wrote: I'll let you know when I've finished building the VM and tried to boot it. Thanks for your help. I have now followed Rich's procedure to build the VM, and it does boot - once! After that, on every boot it complains failed to read the system array and I'm dropped into a dracut repair shell. Then btrfs device scan exit allows the boot to finish. So I ran dracut again with add_dracutmodules+=”btrfs” and add_drivers+=”btrfs” but that didn't help. Specifying device=/dev/sda4,device=/dev/sdb4 on the kernel command line didn't help either. -- Rgds Peter
Re: [gentoo-user] Installing BTRFS on MBR with OpenRC
On Fri, 14 Aug 2015, Peter Humphrey wrote: I have now followed Rich's procedure to build the VM, and it does boot - once! After that, on every boot it complains failed to read the system array and Any idea what you did between the first boot and the second one? An internet search shows that this can happen if the btrfs module doesnt get modprobed correctly. So I ran dracut again with add_dracutmodules+=”btrfs” and add_drivers+=”btrfs” but that didn't help. Specifying device=/dev/sda4,device=/dev/sdb4 on the kernel command line didn't help either. Forget the device thing added to the kernel cmdline, that doesn't work. Can you verify that all pieces of btrfs are present in the initramfs? `lsinitrd initramfs.img | grep btrfs` should tell you if that's the case. Is btrfs built into the kernel or a module? Actually, it turns out that the device scan isn't needed: just an exit or control-d is enough. Check that the kernel cmdline is correct. You need to check the one that you provide and the one that is hardcoded into the dracut image. What does dracut.log say?
Re: [gentoo-user] Installing BTRFS on MBR with OpenRC
On Friday 14 August 2015 17:01:11 Jeremi Piotrowski wrote: On Fri, 14 Aug 2015, Peter Humphrey wrote: I have now followed Rich's procedure to build the VM, and it does boot - once! After that, on every boot it complains failed to read the system array and Any idea what you did between the first boot and the second one? An internet search shows that this can happen if the btrfs module doesnt get modprobed correctly. Nothing. Just rebooted. It's repeatable. Well, it was for a while but now I get the repair shell every time. So I ran dracut again with add_dracutmodules+=”btrfs” and add_drivers+=”btrfs” but that didn't help. Specifying device=/dev/sda4,device=/dev/sdb4 on the kernel command line didn't help either. Forget the device thing added to the kernel cmdline, that doesn't work. Yes, I only tried it as a long shot. Can you verify that all pieces of btrfs are present in the initramfs? `lsinitrd initramfs.img | grep btrfs` should tell you if that's the case. Is btrfs built into the kernel or a module? Built-in, naturally. Actually, it turns out that the device scan isn't needed: just an exit or control-d is enough. Check that the kernel cmdline is correct. You need to check the one that you provide and the one that is hardcoded into the dracut image. What does dracut.log say? # cat /boot/grub/grub.cfg root (hd0,1) timeout 10 Menuentry 'Gentoo Linux 4.0.5, no X { linux /boot/kernel-x86_64-4.0.5-gentoo root=/dev/sda4 softlevel=nox net.ifnames-0 initrd /boot/initramfs-4.0.5-gentoo.img } # grep initrd /var/log/dracut.log I: *** Creating initrd image file '/boot/initramfs-4.0.5-gentoo.img' done *** ---8 # ls -l /boot ---8 -rw--- 1 root root 6.7M Aug 14 23:22 initramfs-4.0.5-gentoo.img -rw-r--r-- 1 root root 3.9M Aug 14 23:12 kernel-x86_64-4.0.5-gentoo ---8 # grep btr /etc/fstab LABEL=GENTOO/ btrfs defaults0 0 All that seems right to me. The label came from mkfs.btrfs -m raid1 -d raid1 --label=GENTOO /dev/sda4 /dev/sdb4 Adding rootdelay=30 made no difference either. In fact I didn't see such a pause. -- Rgds Peter
Re: [gentoo-user] Installing BTRFS on MBR with OpenRC
On Fri, 14 Aug 2015 23:54:56 +0100, Peter Humphrey wrote: # cat /boot/grub/grub.cfg root (hd0,1) timeout 10 Menuentry 'Gentoo Linux 4.0.5, no X { linux /boot/kernel-x86_64-4.0.5-gentoo root=/dev/sda4 softlevel=nox net.ifnames-0 initrd /boot/initramfs-4.0.5-gentoo.img } Is this what dracut --print-cmdline recommended? -- Neil Bothwick I am sitting on the toilet with your article before me. Soon it will be behind me. pgptgO8vGKo69.pgp Description: OpenPGP digital signature
Re: [gentoo-user] Installing BTRFS on MBR with OpenRC
On Fri, 7 Aug 2015 09:29:32 -0400, Rich Freeman wrote: Now you know why I boot directly from the ISO in /boot ;-) That is obviously a convenience, but my main use case for a rescue CD is when there is something messed up with my bootloader/disks/etc. So, I'd prefer to have it on a USB stick that I verify boots and then set aside for when it is needed. No harm in ALSO having it in your bootloader as an option. I keep a stick around too, but the main advantage of having it in /boot is that it is much easier to find when I need it :-O -- Neil Bothwick Experience is directly proportional to the value of equipment destroyed. pgpgNAP3S4nEV.pgp Description: OpenPGP digital signature
Re: [gentoo-user] Installing BTRFS on MBR with OpenRC
On Fri, 7 Aug 2015 08:18:40 -0400, Rich Freeman wrote: So, if you have a USB stick that won't boot, consider that the problem may actually lie in your BIOS... Now you know why I boot directly from the ISO in /boot ;-) -- Neil Bothwick Roses are red, violets are blue; I'm schizophrenic and so am I. pgpAJ0A1fi_hg.pgp Description: OpenPGP digital signature
Re: [gentoo-user] Installing BTRFS on MBR with OpenRC
On Fri, Aug 7, 2015 at 9:13 AM, Neil Bothwick n...@digimed.co.uk wrote: On Fri, 7 Aug 2015 08:18:40 -0400, Rich Freeman wrote: So, if you have a USB stick that won't boot, consider that the problem may actually lie in your BIOS... Now you know why I boot directly from the ISO in /boot ;-) That is obviously a convenience, but my main use case for a rescue CD is when there is something messed up with my bootloader/disks/etc. So, I'd prefer to have it on a USB stick that I verify boots and then set aside for when it is needed. No harm in ALSO having it in your bootloader as an option. -- Rich
Re: [gentoo-user] Installing BTRFS on MBR with OpenRC
On Thursday 06 August 2015 12:09:20 Jeremi Piotrowski wrote: On Thu, 6 Aug 2015, Peter Humphrey wrote: First, btrfs balance. I had no idea that was needed, so of course I didn't include it in my attempts. Could that be why, on booting, the kernel couldn't mount the file system? I don't think that balancing an empty btrfs filesystem is necessary. It should have no effect at this point and would not affect the kernel's ability to mount the btrfs volume. I'm part-way through a VM installation, and when I ran btrfs balance it told me it had moved 6 out of 6 chunks so I guess it does have an effect. ---8 Finally, can I assume that your procedure would work just as well installing into, say, /dev/sd[ab]4? Yep, but as stated by Rich there isn't much to a btrfs raid 1 install aside from mkfs.btrfs, building btrfs support into the kernel, the slightly different fstab entry, and using an initramfs (dracut makes it easy). The arrangement I have in mind is sd[ab]1 raid-1 /boot, sd[ab]2 swap, sd[ab]3 rescue system, sd[ab]4 btrfs gentoo. Maybe I could get away without swap since this box has 16GB RAM, but I'm not ready to do without my rescue system. I do recommend that you try it in a virtual machine first. With an initramfs it worked out of the box for me but I wasn't able to get it to work with just the kernel command line. I'll let you know when I've finished building the VM and tried to boot it. Thanks for your help. -- Rgds Peter
Re: [gentoo-user] Installing BTRFS on MBR with OpenRC
On Fri, 07 Aug 2015 09:49:24 +0100, Peter Humphrey wrote: Yep, but as stated by Rich there isn't much to a btrfs raid 1 install aside from mkfs.btrfs, building btrfs support into the kernel, the slightly different fstab entry, and using an initramfs (dracut makes it easy). The arrangement I have in mind is sd[ab]1 raid-1 /boot, sd[ab]2 swap, sd[ab]3 rescue system, sd[ab]4 btrfs gentoo. Maybe I could get away without swap since this box has 16GB RAM, but I'm not ready to do without my rescue system. that's pretty much what I have on my desktop except it has three drives in the RAID and no rescue system (I have a System Rescue Cd ISO in /boot). AFAIR it just worked first time. -- Neil Bothwick If a turtle doesn't have a shell, is he homeless or naked? pgp_GWmxiX25z.pgp Description: OpenPGP digital signature
Re: [gentoo-user] Installing BTRFS on MBR with OpenRC
On Friday 07 August 2015 10:48:02 Neil Bothwick wrote: On Fri, 07 Aug 2015 09:49:24 +0100, Peter Humphrey wrote: Yep, but as stated by Rich there isn't much to a btrfs raid 1 install aside from mkfs.btrfs, building btrfs support into the kernel, the slightly different fstab entry, and using an initramfs (dracut makes it easy). The arrangement I have in mind is sd[ab]1 raid-1 /boot, sd[ab]2 swap, sd[ab]3 rescue system, sd[ab]4 btrfs gentoo. Maybe I could get away without swap since this box has 16GB RAM, but I'm not ready to do without my rescue system. that's pretty much what I have on my desktop except it has three drives in the RAID and no rescue system (I have a System Rescue Cd ISO in /boot). AFAIR it just worked first time. Yes, I remember about your rescue ISO. I may do the same once I work out how to incorporate my own customisations into it. Maybe that should be the first thing to do. I have a USB stick like that, but it refuses to boot any more. (The reason I'm taking so long to build the VM is that VirtualBox won't install the guest additions ISO, so I have no paste or selection buffer and no folder sharing, so I have to do everything the long way.) -- Rgds Peter
Re: [gentoo-user] Installing BTRFS on MBR with OpenRC
On Fri, Aug 7, 2015 at 7:39 AM, Peter Humphrey pe...@prh.myzen.co.uk wrote: Yes, I remember about your rescue ISO. I may do the same once I work out how to incorporate my own customisations into it. Maybe that should be the first thing to do. I have a USB stick like that, but it refuses to boot any more. I've been running systemrescuecd on a USB stick, but for one of my systems I had to format the device with Windows and then just copy the files and run syslinux on it from a linux box. Running the full systemrescuecd installer results in a USB stick that boots on some of my systems, but not all of them. I'm sure that is a matter of a brain-dead BIOS that isn't following the spec. (All a BIOS is supposed to do is check for a magic number on the first block, and if present load it into RAM and jump into it at a set offset. I suspect this motherboard is trying to do more than that, perhaps as part of a firmware loader function/etc which would require more knowledge of FAT.) So, if you have a USB stick that won't boot, consider that the problem may actually lie in your BIOS... -- Rich
Re: [gentoo-user] Installing BTRFS on MBR with OpenRC
Am 2015-08-06 um 13:18 schrieb Rich Freeman: It isn't necessarily essential, but btrfs fi df /mnt/gentoo will show you that before the balance there are still some chunks in single mode - it seems like mkfs creates the first device and adds the second one, leaving some residual non-RAID chunks (that hopefully will never have data written to them). The balance of an empty filesystem is really fast and completely converts it to raid1, so I figured it would be cleaner to do it this way. I have no idea what happens if those single chunks remain and you degrade the array. This reminded me of doing a balance-run on the 2-hdd btrfs-RAID1 in my desktop machine. Runs now. The machine runs and boots on btrfs only (as well as my 2 thinkpads), I know that btrfs still isn't as well tested as extX or XFS, for example ... but I am quite happy so far (doing backups is essential for everyone, right?) - Regarding the topic of this thread ... I am off-topic here ;-) sorry - GPT on a single SSD (containing / and the OS, the hdds hold data), and systemd ... I run 2 systems (desktop and one laptop) with 2 distros installed in parallel, Fedora and Gentoo, and btrfs helps to share storage nicely here. It even works to share the EFI-boot-partition etc ... the only issue is that having multiple kernels for each distro frequently leads to manually remove one older kernel to be able to add another - Yes, that partition was sized too small and isn't so easy to grow right now. No big problem. As I mentioned in another btrfs-related thread here a few months ago I really appreciate the move from partitions/LVM/RAID/filesystems to this new concept where all these layers are somehow integrated and interacting. Sorry for OT-ing here, regards, Stefan
Re: [gentoo-user] Installing BTRFS on MBR with OpenRC
On Thu, 6 Aug 2015, Peter Humphrey wrote: First, btrfs balance. I had no idea that was needed, so of course I didn't include it in my attempts. Could that be why, on booting, the kernel couldn't mount the file system? I don't think that balancing an empty btrfs filesystem is necessary. It should have no effect at this point and would not affect the kernel's ability to mount the btrfs volume. Second, --xattrs on the tarball extraction. I haven't seen this recommended before, and I wonder what extra attributes are needed for btrfs. This is part of the normal installation procedure and is not specific to btrfs. See [1]. For all I know this has always been part of the installation. Third, why do you do your kernel compiling in /var/tmp/linux? It seems like extra work and I can't see a reason for it. The kernel developers recommend to __never__ compile the kernel as root. You never know when something like `rm -rf /` might creep into the Makefile ;) The portage unpacked kernel sources belong to root:root so Rich's method compiles them in /var/tmp/linux which can be done as the local user. Finally, can I assume that your procedure would work just as well installing into, say, /dev/sd[ab]4? Yep, but as stated by Rich there isn't much to a btrfs raid 1 install aside from mkfs.btrfs, building btrfs support into the kernel, the slightly different fstab entry, and using an initramfs (dracut makes it easy). I do recommend that you try it in a virtual machine first. With an initramfs it worked out of the box for me but I wasn't able to get it to work with just the kernel command line. [1]: https://wiki.gentoo.org/wiki/Handbook:AMD64/Full/Installation#Unpacking_the_stage_tarball
[gentoo-user] Installing BTRFS on MBR with OpenRC
I've started a new thread rather than hijacking the other one. I've made several attempts at installing a btrfs system on what may be a too-old machine, and Grant Edwards and I asked Rich for help. On Wednesday 05 August 2015 13:55:09 Rich Freeman wrote: On Wed, Aug 5, 2015 at 11:26 AM, Peter Humphrey pe...@prh.myzen.co.uk wrote: On Wednesday 05 August 2015 10:43:28 Rich Freeman wrote: Just to humor you I'll include an OpenRC version of my raid1 btrfs install walkthrough. :) It has been a while since I've done one of those... Me too please, Rich. I still haven't got this six-year-old MBR box to boot raid1 btrfs. FWIW, my notes are at: https://docs.google.com/document/d/1VJlJyYLTZScta9a81xgKOIBjYsG3_VfxxmUSxG23 Uxg/edit?usp=sharing Impressive, Rich - thanks. You've given me several things to think about already. First, btrfs balance. I had no idea that was needed, so of course I didn't include it in my attempts. Could that be why, on booting, the kernel couldn't mount the file system? Second, --xattrs on the tarball extraction. I haven't seen this recommended before, and I wonder what extra attributes are needed for btrfs. Third, why do you do your kernel compiling in /var/tmp/linux? It seems like extra work and I can't see a reason for it. Finally, can I assume that your procedure would work just as well installing into, say, /dev/sd[ab]4? -- Rgds Peter
Re: [gentoo-user] Installing BTRFS on MBR with OpenRC
On Thursday 06 August 2015 12:09:20 Jeremi Piotrowski wrote: On Thu, 6 Aug 2015, Peter Humphrey wrote: First, btrfs balance. I had no idea that was needed, so of course I didn't include it in my attempts. Could that be why, on booting, the kernel couldn't mount the file system? I don't think that balancing an empty btrfs filesystem is necessary. It should have no effect at this point and would not affect the kernel's ability to mount the btrfs volume. So that won't have been my problem then. Second, --xattrs on the tarball extraction. I haven't seen this recommended before, and I wonder what extra attributes are needed for btrfs. This is part of the normal installation procedure and is not specific to btrfs. See [1]. For all I know this has always been part of the installation. Well, as I said, I've never seen it before. Third, why do you do your kernel compiling in /var/tmp/linux? It seems like extra work and I can't see a reason for it. The kernel developers recommend to __never__ compile the kernel as root. You never know when something like `rm -rf /` might creep into the Makefile ;) Is that a real fear, or paranoia gone to extremes? :-) Finally, can I assume that your procedure would work just as well installing into, say, /dev/sd[ab]4? Yep, but as stated by Rich there isn't much to a btrfs raid 1 install aside from mkfs.btrfs, building btrfs support into the kernel, the slightly different fstab entry, and using an initramfs (dracut makes it easy). I've done all those things several times in the past week or two and come up against a kernel panic every time. I do recommend that you try it in a virtual machine first. Good idea. I'll do that. Restoring the original system has been a nuisance each time, what with md raid 1, lvm2 and so on. Creating a 500GB md device seems to take for ever. -- Rgds Peter
Re: [gentoo-user] Installing BTRFS on MBR with OpenRC
I'll skip the bits that were already dealt with. On Thu, Aug 6, 2015 at 5:19 AM, Peter Humphrey pe...@prh.myzen.co.uk wrote: First, btrfs balance. I had no idea that was needed, so of course I didn't include it in my attempts. Could that be why, on booting, the kernel couldn't mount the file system? It isn't necessarily essential, but btrfs fi df /mnt/gentoo will show you that before the balance there are still some chunks in single mode - it seems like mkfs creates the first device and adds the second one, leaving some residual non-RAID chunks (that hopefully will never have data written to them). The balance of an empty filesystem is really fast and completely converts it to raid1, so I figured it would be cleaner to do it this way. I have no idea what happens if those single chunks remain and you degrade the array. Third, why do you do your kernel compiling in /var/tmp/linux? It seems like extra work and I can't see a reason for it. I usually still do my compiling as root (though this isn't an ideal practice). I build in /var/tmp for a few reasons: 1. It keeps my sources clean. All the output goes in /var/tmp. Every build is pristine, etc. 2. /var/tmp is a tmpfs - so the build goes MUCH faster (only reads from my raid1 btrfs /usr/src, all writes go to tmpfs). Only the final built stuff has to be installed back (a fraction of total bytes written), and then you're reading from tmpfs and only writing to disk. Anytime you can avoid simultaneous read/writes from a disk things go much faster. Btrfs isn't exactly known for its speed at this point, especially for writes, so I try to avoid dumping junk on it. 3. If you're using gentoo-sources they'll actually cleanly uninstall since they aren't messed with. (Thanks to all for the comments so far. They offer opportunities for testing/experimentation, and also indicate where more explanation will be helpful when I turn this into an article. And, hopefully, a few will already benefit in getting their btrfs systems working with these notes.) (My article should also have a warning at the top - btrfs is experimental so don't come to me if it eats your data and you didn't have backups. raid1 is fairly mature at this point but I tend to stick with mature but recent longterm kernels (indeed, I should probably use a 3.18 series kernel explicitly in the install, and not let it go with 4.0 though that at least is starting to mature).) -- Rich