LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-06-2014, 06:18 AM   #1
saulgoode
Member
 
Registered: May 2007
Distribution: Slackware
Posts: 288

Rep: Reputation: 155Reputation: 155
btrfs device scan should be performed before fstab mounts


I have been playing with BTRFS on Slackware64 14.1 and encountered a situation that is apparently not addressed by the sysvinit scripts.

In short, my btrfs volumes do not get recognized until a 'btrfs device scan' is performed and since this is not performed by any of the /etc/rc.d init scripts, mounting of those volumes as specified in fstab fails. Adding the command to rc.S resolves the issue (I added it around line 50, directly after the UDEV initialization).

It is possible that this behavior occurs because my btrfs volumes were created directly on the devices (/dev/sdb and /dev/sdc) and not on partitions on the devices (e.g., /dev/sdb1). I have not explicitly tested this hypothesis but it seems earlier in my experimentation that things worked properly when btrfs volumes were mounted on partitions.

I have not checked on whether this issue arises in -current but I did check the sysvinit scripts and note that the scan command is not there; though it is possible that this issue has been addressed upstream.
 
Old 10-06-2014, 11:59 PM   #2
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-Current
Posts: 6,460
Blog Entries: 15

Rep: Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040
BtrFS is still labeled as experimental in Slackware, but yes, handling BtrFS devices rather than just partitions should be addressed. Can you provide a copy of the rc.S file you edited as an example, or at least a .diff style patch that could be used?
 
Old 10-07-2014, 12:35 AM   #3
saulgoode
Member
 
Registered: May 2007
Distribution: Slackware
Posts: 288

Original Poster
Rep: Reputation: 155Reputation: 155
The following patch was created with "diff -u5 rc.S rc.S.patched".

Code:
--- rc.S        2013-10-28 01:06:39.000000000 -0400
+++ rc.S.patched        2014-10-07 00:22:10.428005892 -0400
@@ -46,10 +46,13 @@
       /bin/sh /etc/rc.d/rc.udev start
     fi
   fi
 fi
 
+# Following is apparently needed by btrfs mounts appearing in /etc/fstab:
+btrfs device scan --all-devices
+
 # Mount Control Groups filesystem interface:
 if grep -wq cgroup /proc/filesystems ; then
   if [ -d /sys/fs/cgroup ]; then
     # See linux-*/Documentation/cgroups/cgroups.txt (section 1.6)
     # Check if we have some tools to autodetect the available cgroup controllers
I am not certain the scan is in the right location. I figured it should be after UDEV initialization in order to account for filesystems that might be on hotplugged external drives.
 
Old 10-07-2014, 02:30 AM   #4
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-Current
Posts: 6,460
Blog Entries: 15

Rep: Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040
If it works at that point it should be useful at scanning btrfs volumes and partitions. I may incorporate this into my system as well.
 
Old 10-07-2014, 05:43 AM   #5
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,201
Blog Entries: 1

Rep: Reputation: 4262Reputation: 4262Reputation: 4262Reputation: 4262Reputation: 4262Reputation: 4262Reputation: 4262Reputation: 4262Reputation: 4262Reputation: 4262Reputation: 4262
Sticking it next to the lvm scan would seem the logical place to me as they both do the same sort of job.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mounts ignoring /etc/fstab Tadaen Debian 3 05-11-2014 12:07 PM
adding mounts to /etc/fstab ted_chou12 Linux - Newbie 1 08-11-2012 09:09 PM
samba mounts in fstab Zurvan Linux - Networking 5 04-17-2005 11:13 AM
How to edit mounts - fstab problems... muzicman82 Linux - General 3 01-29-2004 11:06 PM
switching mounts in fstab elpresidente Linux - General 6 07-09-2002 08:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration