Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a btrfs filesystem RAIDed across several disks. The machine is connected via USB to an external hard-drive bay where three disks live.

In my fstab I have a mount entry for one of the disks and the path (/dev/sdb). However, during boots Ubuntu mounts all of the disks /dev/sdc and /dev/sdd. I'd like to stop Ubuntu from mounting the other disks during boot. Is there anyway to disable auto-mounting of attached disks on boot with the exception of the ones explicitly in /etc/fstab?

Here are the contents of fstab

proc            /proc           proc    nodev,noexec,nosuid 0       0
# / was on /dev/sda1 during installation
UUID=eb80bbb0-7b27-4b7c-b041-639cbcae1c77 /           ext4    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=0e0c01be-7545-449c-86a8-60309d016534 none        swap    sw              0       0
/dev/sdb /media/xbmc    btrfs   defaults  0 1

When the machine boots I find something like this:

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       294G   35G  245G  13% /
udev            2.0G  4.0K  2.0G   1% /dev
tmpfs           791M  892K  790M   1% /run
none            5.0M     0  5.0M   0% /run/lock
none            2.0G  1.6M  2.0G   1% /run/shm
/dev/sdc        4.6T  1.3T  2.6T  34% /media/0868831f-d234-4172-aeab-640e580190d0
/dev/sdd        4.6T  1.3T  2.6T  34% /media/0956647d-a558-2218-febt-559a647221r5
/dev/sdb        4.6T  1.3T  2.6T  34% /media/xbmc
share|improve this question
    
Do the required lines in your fstab have the noauto option? –  jippie Jun 3 '12 at 14:41
    
@jippie I want everything in fstab to mount. Ubuntu is mounting disks that aren't in fstab, which is the problem. –  Marco Ceppi Jun 3 '12 at 14:53
    
Is the ARRAY line for this BTRFS array still present in /etc/mdadm/mdadm.conf? –  Samik Jun 3 '12 at 17:04
    
@Samik It's not using mdadm, it's using BTRFS's filesystem array. It's just a bunch of disks attached to the machine connected together by btrfs –  Marco Ceppi Jun 3 '12 at 17:24
    
Sorry if I didn't get it clearly. To be clarified, is /dev/sdb mentioned in /etc/fstab a part of the multi-disk-spanning BTRFS array? And is Ubuntu mounting all the disks even if they are not in the BTRFS array or /etc/fstab? –  Samik Jun 3 '12 at 18:26
show 3 more comments

1 Answer 1

up vote 1 down vote accepted

The noauto option for mount lets the user to mount the device/partition concerned only explicitely, not with mount -a or not on boot if mentioned in /etc/fstab's option column for the concerned device. If you can add /dev/sdc and /dev/sdd(or their UUIDs) in /etc/fstab and provide the noauto option in option(4th) column they won't be mounted automatically.

(see the man page for mount or this)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.