Welcome to CRUX bug tracking.
FS#830 - prepare /etc/rc for btrfs
Attached to Project:
CRUX
Opened by Fredrik Rinnestam (rehabdoll) - Saturday, 02 June 2012, 17:04 GMT+2
Last edited by Thomas Penteker (teK) - Wednesday, 26 September 2012, 11:27 GMT+2
Opened by Fredrik Rinnestam (rehabdoll) - Saturday, 02 June 2012, 17:04 GMT+2
Last edited by Thomas Penteker (teK) - Wednesday, 26 September 2012, 11:27 GMT+2
|
DetailsWe should probably probe for btrfs on boot.
This allows mounting by UUID and LABEL, etc. It's not *REQUIRED* for btrfs operations but it does simplify things such as multi-device mounts. Without the scan, users are required to pass multiple "device=/dev/sdX" in the mount options in fstab for all disks connected to the filesystem. I suspect it's also needed for mounting subvolumes, but i've yet to play with that feature. --- /etc/rc.old 2010-09-05 22:28:39.375911196 +0200 +++ /etc/rc.new 2012-06-02 16:55:31.309376903 +0200 @@ -19,6 +19,11 @@ if [ -x /sbin/lvm ]; then /sbin/vgchange --ignorelockingfailure -a y fi +# Detect btrfs volumes to simplify fstab entries +if [ -x /sbin/btrfs ]; then + /sbin/btrfs dev scan +fi + # Mount root read-only /bin/mount -n -o remount,ro / |
This task depends upon
Closed by Thomas Penteker (teK)
Wednesday, 26 September 2012, 11:27 GMT+2
Reason for closing: Implemented
Additional comments about closing: Thanks :)
Wednesday, 26 September 2012, 11:27 GMT+2
Reason for closing: Implemented
Additional comments about closing: Thanks :)
< teK_> i.e.
< teK_> /sbin/btrfs dev scan 1>/dev/null
< teK_> failed to read /dev/sr0
< frinnst> i'll look into it a bit more tomorrow, maybe ask the #btrfs people if they have a best practice for it
< frinnst> teK_: looking at the btrfs source, the error we see with /dev/sr0 is the only type of error it can throw
< frinnst> correction, 2 errors
< frinnst> still, it's only a cosmetic and temporary error (will be more intelligent in future versions)
< teK_> so we'll stick to the current proposal and wait what the future brings
conclusion: +1 for including the patch
--- rc.old 2012-06-25 18:47:56.882519785 +0200
+++ rc.new 2012-06-25 18:48:53.998451914 +0200
@@ -19,6 +19,11 @@ if [ -x /sbin/lvm ]; then
/sbin/vgchange --ignorelockingfailure -a y
fi
+# Scan for btrfs volumes to simplify fstab entries
+if [ -r /sys/fs/btrfs ]; then
+ /sbin/btrfs dev scan
+fi
+
# Mount root read-only
/bin/mount -n -o remount,ro /