LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   BtrFS on /(root) issue. (https://www.linuxquestions.org/questions/slackware-14/btrfs-on-root-issue-4175526504/)

ReaperX7 11-25-2014 06:01 PM

BtrFS on /(root) issue.
 
Okay, I'm not sure how this happened today, but I was installing Slackware onto a laptop system I acquired and decided to try BtrFS as an experiment.

I setup my GPT partition table as such:

/dev/sda1 - ext2 - 10MB - /boot
/dev/sda2 - EF02 - 35KB - gpt-bios
/dev/sda3 - swap - 8GB - swap
/dev/sda4 - btrfs - 66GB - /

Everything installed fine and was going along until I chrooted into Slackware and attempted to configure grub2 to boot the system. When I ran grub-mkconfig is spat out this error:

Code:

grub-probe: [error] Could not find /dev. Is /dev mounted?
I even tried using chroot to download grub-2.02~beta2 and use the SlackBuild from source to rebuild the package. It too failed.

After trying to even manually mount /dev, which only seemed to keep remounting itself again and again, I gave up and decided to go back to my normal usage of JFS.

Has anyone else had this same error when trying to use BtrFS on GPT?

This never happened when I used MBR actually.

Didier Spaier 11-25-2014 06:46 PM

Maybe you just forgot to bind mount /dev before chroot? I'd do this:
Code:

mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
chroot /mnt

Else the directories /dev, /proc and /sys will be empty after chroot.

ReaperX7 11-25-2014 07:39 PM

No I did those including devpts and tmpfs on /dev/shm to make sure I mounted all the virtual file systems. It still wouldn't allow detection of /dev regardless of what I did.

I even tried booting through the DVD as a recovery method and it failed too.

moisespedro 11-25-2014 07:57 PM

Isn't chrooting right after a install as simple as:

# chroot /mnt

?

Didier Spaier 11-26-2014 01:10 AM

Quote:

Originally Posted by moisespedro (Post 5275094)
Isn't chrooting right after a install as simple as:

# chroot /mnt

?

Please re-read my previous post, and even better; check yourself. Just type:
Code:

chroot /mnt
then check the content of /dev: it is exactly what's provided by installation of the package devs, as if /etc/rc.d/rc.udev hadn't be started.

But if you type instead
Code:

mount --bind /dev /mnt/dev
chroot /mnt

you'll see that the content of /dev is now what you get after /etc/rc.d/rc.udev has been started.

ReaperX7 11-26-2014 09:21 AM

Technically it's

chroot /mnt /bin/sh

But regardless all virtual filesystems were mounted

mount -v --bind /dev /mnt/dev
mount -vt devpts devpts /mnt/dev/pts -o gid=5,mode=620
mount -vt proc proc /mnt/proc
mount -vt sysfs sysfs /mnt/sys
mount -vt tmpfs tmpfs /mnt/dev/shm

Btw, if you use Didier's eudev that last line changes to

mount -vt tmpfs tmpfs /mnt/run

because /dev/shm becomes a symlink to /run/shm

Anyways, after retrying, it still fails to mount properly, so I went back to JFS and have no plans to retry this. On MBR partitioning it works, but on GPT, no. I'm not going to waste more time on this, especially with BtrFS. At least JFS works.

mlslk31 12-05-2014 08:35 PM

I could get btrfs going OK with kernel 3.18.0-rc7 whatever grub was in git. Before that, the last time I checked on btrfs on / with GRUB was kernel 3.12 or 3.13. Basically, whatever kernel line I had the grub config program output to /boot/grub/grub.cfg, that command line was copied and modified to include "root=/dev/sda6 rootfstype=btrfs". It was a matter of copying the menu entry to boot an already-existing XFS / partition and changing the root= and rootfstype= lines as well as the description and ID of the menu entry itself. Because the /boot partition here is JFS, I did not have grub load a btrfs module.

Anyway, I know you've moved on, just letting you know that it may be at least marginally possible next time under certain circumstances. Sadly, there aren't enough quiet spare drives here to test booting btrfs in RAID-0/1/5 configurations. Sorry I'm not so good with GRUB, starting by booting XFS / from a blank menu until I could figure out how to update the menu and therefore add a btrfs partition...


All times are GMT -5. The time now is 11:01 PM.