[SOLVED] Prevent racy mounting when booting

Hey there!
When booting I mount an external (encrypted) drive by the means of fstab (and crypttab) under a directory which is only accessible by root.  In order to allow read-only access for users, I remount the the device under another directory which allows reading for ordinary users by the means of bindfs.
The relevant part of my /etc/fstab goes like this:
/dev/mapper/backup /mnt/root/backup ext4 defaults 0 2
bindfs#/mnt/root/backup /mnt/backup fuse perms=a-w 0 0
However, after booting up the contents of /mnt/root/backup do not show up under /mnt/backup. Remounting /mnt/backup manually makes the files appear.  I suspect that this is because the bindfs mounting is done before mounting /mnt/root/backup has finished; also the order of the two mounts shown when issuing the mount command is inverted to the order in fstab.
How do I have to cope with this situation?
Shall I add noauto to the bindfs instruction and write a custom service file for systemd in order to mount the read-only ressource at a later time? (I am asking this because I am fairly unexperienced when in comes to systemd and I don't want to head for the wrong track...)
Last edited by ball (2014-01-22 18:36:25)

See this topic regarding how to write bindfs fstab entries: https://bbs.archlinux.org/viewtopic.php?id=175230

Similar Messages

  • Prevent volume mounting after booting

    Is there a way to prevent a particular volume to mount after booting? I boot from one volume but have other volumes-disks that I may want to mount at a specific moment, but I not want the Mac to mount automatically after each booting (a waste of energy, disk usage, noise, and so on). Of course I can manually mount each volume-disk after booting, but what I want is something that prevents them from mounting in the first place after booting or rebooting.
    I remember that could be configured with third party applications used to format disks on Mac OS 9 (Casablanca Works Drive 7, LaCie Silverlining, Prosoft Radialogic, etc) but I do not see how to do it on Mac OS X.
    Thanks.

    Search these forums for automount and see this one, for example, http://discussions.apple.com/thread.jspa?messageID=6112779 Remember to try it at your own risk.

  • [Solved] "Version Magic" error when booting with m

    Hi, I compiled kernel 2.6.16.18  and I receive the following error when booting:
    ide_core: version magic '2.6.16-ARCH SMP preempt 686 gcc-4.0' should be '2.6.16.18-ARCH preempt 686 gcc-4.0'
    amd74xx: version magic '2.6.16-ARCH SMP preempt 686 gcc-4.0' should be '2.6.16.18-ARCH preempt 686 gcc-4.0'
    generic: version magic '2.6.16-ARCH SMP preempt 686 gcc-4.0' should be '2.6.16.18-ARCH preempt 686 gcc-4.0'
    ide_disk: version magic '2.6.16-ARCH SMP preempt 686 gcc-4.0' should be '2.6.16.18-ARCH preempt 686 gcc-4.0'
    cdrom: version magic '2.6.16-ARCH SMP preempt 686 gcc-4.0' should be '2.6.16.18-ARCH preempt 686 gcc-4.0'
    ide_cd: version magic '2.6.16-ARCH SMP preempt 686 gcc-4.0' should be '2.6.16.18-ARCH preempt 686 gcc-4.0'
    ide_floppy: version magic '2.6.16-ARCH SMP preempt 686 gcc-4.0' should be '2.6.16.18-ARCH preempt 686 gcc-4.0'
    sd_mod: version magic '2.6.16-ARCH SMP preempt 686 gcc-4.0' should be '2.6.16.18-ARCH preempt 686 gcc-4.0'
    libata: version magic '2.6.16-ARCH SMP preempt 686 gcc-4.0' should be '2.6.16.18-ARCH preempt 686 gcc-4.0'
    sata_nv: version magic '2.6.16-ARCH SMP preempt 686 gcc-4.0' should be '2.6.16.18-ARCH preempt 686 gcc-4.0'
    jbd: version magic '2.6.16-ARCH SMP preempt 686 gcc-4.0' should be '2.6.16.18-ARCH preempt 686 gcc-4.0'
    ext3: version magic '2.6.16-ARCH SMP preempt 686 gcc-4.0' should be '2.6.16.18-ARCH preempt 686 gcc-4.0'
    jfs: version magic '2.6.16-ARCH SMP preempt 686 gcc-4.0' should be '2.6.16.18-ARCH preempt 686 gcc-4.0'
    reiserfs: version magic '2.6.16-ARCH SMP preempt 686 gcc-4.0' should be '2.6.16.18-ARCH preempt 686 gcc-4.0'
    xfs: version magic '2.6.16-ARCH SMP preempt 686 gcc-4.0' should be '2.6.16.18-ARCH preempt 686 gcc-4.0'
    I compiled my kernel with this line:
    # make -s clean bzImage modules modules_install
    Any ideas?

    Ok, I fixed it.
    When doing mkinitrd auto it would make an initrd image from the modules at /lib/modules/2.6.16-ARCH when it had to do it from /lib/modules/2.6.16.18-ARCH
    I fixed it with 
    mkinitrd kernel_version=2.6.16.18-ARCH
    Also my menu.lst was wrong, a new image was created under the name of
    initrd-2.6.16.18-ARCH.img.
    My menu.lst pointed to initrd26.img. I didn't change it before because I didn't know, someone should update the wiki article about compiling the kernel from source.

  • [SOLVED] /home not mounted on boot after installing tp_smapi

    Hi. After installing tp_smapi, my /home partition isn't mounted on boot any more.
    I can log in as a normal user, but I am then left with a command line and thus need to mount /home manually and launch X/dwm with startx. The startup shell shows no error messages.
    After I uninstall tp_smapi, X starts up automatically again and everything seems to work.
    Here's my fstab:
    /dev/sda2 / ext4 rw,noatime,data=ordered 0 1
    # /dev/sda4 UUID=9d976c9a-4fe2-4cc9-a8b9-c22c713149d7
    /dev/sda4 /home ext4 rw,noatime,data=ordered 0 2
    # /dev/sda3 UUID=a6153a96-b9ef-412f-a670-af6775275f15
    /dev/sda3 none swap defaults 0 0
    I am dual-booting Arch with Windows XP on a Thinkpad X60s. A /mnt/home folder also exists. And, the error aside, tp_smapi seems to work nicely,
    Thanks for any help!
    Last edited by marttt (2013-06-01 20:59:55)

    Okay, it works now (after creating /mnt/home anew and rebooting). However, I wonder why did tp_smapi touch my mount points in the first place?
    Last edited by marttt (2013-05-31 20:46:09)

  • [SOLVED] Partitions not mounted on boot / boots to (none)

    I have strange problem after I ran pacman -Syu today. After reboot I can't login and it doesn't show hostname in login window, I do get kdm login screen.
    If I select console login or change to tty1 then I can login as root, without any password asked.
    After that I am able to mount partitions just fine, and I am also able to chroot in and update the system, didn't help. I also tried downgrading kernel to 3.5.6.1, with no change in behaviour.
    I don't have /usr on different partition but decided to try adding usr and shutdown to mkinitcpio hooks anyway, again no improvement.
    Recent update only brought shadow.pacnew, which I merged. I do pacnew merges after each update.
    Any pointers on where to go next?
    Thanks in advance.
    Last edited by thepanu (2012-11-01 20:21:41)

    You need to understand what you are actually doing when you overwrite old files with new ones.  When there is a recommendation to "merge" your pacnew files, that doesn't mean just go ahead and use the new ones.  It means you should take the time to see what is in them, see where they differ, and then make an educated decsion on what to do with them from there.
    If this is how you have always been handling pacnew files, don't expect that the prolem is totally solved.  I would not be suprised if this one sneaks up and bites you in the ass.

  • [solved] netfs/sshfs failing on boot

    ok I seem to have a very weird problem and I can not for the life of me figure out a solution.
    I have ssh setup with rsa authentication, I am mounting the sshfs share in fstab according to the wiki.
    [email protected]:torrents/ /mnt/desktop fuse defaults,users,port=22000,reconnect,allow_other 0 0
    On boot netfs fails with the error
    Connection reset by peer.
    But if I let kde finish loading and start a terminal and type in
    /etc/rc.d/netfs start
    it mounts just fine. This is where I don't understand why it will not mount when booting. Because I can not replicate the error once the machine is fully booted. I even tried the sleep 20 trick in netfs.
    my daemon array looks like this.
    DAEMONS=(syslog-ng acpid cpufreq crond hal !net-profiles net-auto-wireless rpcbind nfs-common oss fam sshd ntpd !avahi-daemon netfs)
    Any idea is worth a shot so please amuse me
    Solution: Delete the /root/.ssh/known_hosts file and then re-authenticate the host machine for root user locally. My known_hosts had two entries and the first entry was not available on the network. I assume this is the reason why netfs was failing. The rsa key of the only working host was the exact same before and after in the known_hosts file.
    Last edited by jacko (2009-12-29 16:16:56)

    After booting "swapon -s" give me:
    Filename Type Size Used Priority
    /dev/sda3 partition 8388604 0 -1
    So I assume that the swap partition is actually mounted and activated. However, resuming from hibernation always results in output which says "clearing orphan nodes." I know it has something to do with the swap because I was able to get resume to work by activating swap after I manually mounted swap after booting. I can't remember the exact process I used, whether it be through systemctl or swapon. I will see if I can get figure it out again.

  • External HDD won't mount at boot. [Solved]

    Edit:
    I've noticed that this is an issue regarding my NTFS partition being on an external drive. Please check post #8 by me to get further details.
    Hello guys, I'm having some problems getting my external NTFS HDD to mount automatically at boot. I have installed HAL and NTFS-3G, but I'm still getting problems. Mounting once the computer has finished booting is no problem using the simple mount command (sudo mount /media/pebble). I see no reason why this should be having problems mounting at boot with my fstab entry, but no errors occur when mounting manually.
    Fstab entry:
    /dev/sdc1 /media/pebble ntfs-3g fmask=022 1 0
    rc.conf:
    # /etc/rc.conf - Main Configuration for Arch Linux
    # LOCALIZATION
    # LOCALE: available languages can be listed with the 'locale -a' command
    # HARDWARECLOCK: set to "UTC" or "localtime"
    # USEDIRECTISA: use direct I/O requests instead of /dev/rtc for hwclock
    # TIMEZONE: timezones are found in /usr/share/zoneinfo
    # KEYMAP: keymaps are found in /usr/share/kbd/keymaps
    # CONSOLEFONT: found in /usr/share/kbd/consolefonts (only needed for non-US)
    # CONSOLEMAP: found in /usr/share/kbd/consoletrans
    # USECOLOR: use ANSI color sequences in startup messages
    LOCALE="en_US.utf8"
    HARDWARECLOCK="localtime"
    USEDIRECTISA="no"
    TIMEZONE="America/Vancouver"
    KEYMAP="us"
    CONSOLEFONT=
    CONSOLEMAP=
    USECOLOR="yes"
    # HARDWARE
    # MOD_AUTOLOAD: Allow autoloading of modules at boot and when needed
    # MOD_BLACKLIST: Prevent udev from loading these modules
    # MODULES: Modules to load at boot-up. Prefix with a ! to blacklist.
    # NOTE: Use of 'MOD_BLACKLIST' is deprecated. Please use ! in the MODULES array.
    MOD_AUTOLOAD="yes"
    #MOD_BLACKLIST=() #deprecated
    MODULES=(fuse)
    # Scan for LVM volume groups at startup, required if you use LVM
    USELVM="no"
    # NETWORKING
    # HOSTNAME: Hostname of machine. Should also be put in /etc/hosts
    HOSTNAME="r3-desktop-arch"
    # Use 'ifconfig -a' or 'ls /sys/class/net/' to see all available interfaces.
    # Interfaces to start at boot-up (in this order)
    # Declare each interface then list in INTERFACES
    # - prefix an entry in INTERFACES with a ! to disable it
    # - no hyphens in your interface names - Bash doesn't like it
    # DHCP: Set your interface to "dhcp" (eth0="dhcp")
    # Wireless: See network profiles below
    #Static IP example
    #eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255"
    #eth0="dhcp"
    eth0="eth0 192.168.0.23 netmask 255.255.255.0 broadcast 192.168.0.255"
    INTERFACES=(eth0)
    # Routes to start at boot-up (in this order)
    # Declare each route then list in ROUTES
    # - prefix an entry in ROUTES with a ! to disable it
    gateway="default gw 192.168.0.1"
    ROUTES=(gateway)
    # Enable these network profiles at boot-up. These are only useful
    # if you happen to need multiple network configurations (ie, laptop users)
    # - set to 'menu' to present a menu during boot-up (dialog package required)
    # - prefix an entry with a ! to disable it
    # Network profiles are found in /etc/network.d
    # This now requires the netcfg package
    #NETWORKS=(main)
    # DAEMONS
    # Daemons to start at boot-up (in this order)
    # - prefix a daemon with a ! to disable it
    # - prefix a daemon with a @ to start it up in the background
    DAEMONS=(syslog-ng network netfs crond dbus hal alsa)
    Do I need to load HAL earlier? What am I doing wrong?
    Last edited by ryeguy146 (2009-11-05 10:04:32)

    I just noticed something, I don't think that this is an issue with the partition being NTFS, but rather with it being on an external hard drive (/dev/sdc). I say this because I just rebooted and noticed another NTFS partition that I have in my fstab is mounting (/dev/sda5). It's an internal HDD, and I didn't notice that it mounted up because I rarely use it. But there it is.
    I suppose that I should define /dev/sdc. It is a Western Digital External HDD running off of a USB 2.0 cable. I don't know why this makes a difference, but it apparently does. Both entries in the fstab are identical for their respective devices and mount points.
    Now that we have that figured out, I think that I'll change the title of the thread. So any ideas on how to solve this one?

  • [SOLVED] Preventing nonexistent filesystem in fstab from blocking boot

    Some years ago I moved out of my parents house, but that didn't exonerate me from being their netadmin. I have an arch box there which provides local fileserver, DHCP, and NAT. It's set up with a RAID5+LVM samba server to give my parents an easy place to back up their local computers and dump photographs.
    At one point while I was clear on the other side of the world from them, one of the drives in the RAID5 failed. No problem - the data's safe. But the bigger issue was that it prevented the system from booting. There are entries in fstab to mount filesystems, and when one doesn't exist the whole thing just hangs. Usually when problems occur I just ssh in from wherever I am and fix whatever is wrong. In this case, I had to walk my father through using single user mode and editing fstab with vim over the phone. It sucked.
    Is there an elegant way to ensure that when a non-critical filesystem listed in fstab disappears that it does not prevent the system from booting? So far my kludge solution has been to remove the entry from fstab and just mount it manually from rc.local. But that seems like a hack. Is there a better solution?
    Thanks,
    Sasha
    Last edited by kleptophobiac (2011-01-02 04:26:41)

    Try using the option 'nofail'.  For example, in fstab:
    UUID=669b1bcd-5ae9-4ae9-868c-be327b044e23 /mnt/backup jfs defaults,nofail,noatime,nodiratime,noexec,nosuid 0 2

  • How prevent OS X backup volume from mounting at boot

    I have 10.6.2 in a bootable GUID partition on my main drive (Bay 1) and another 10.6.2 in a bootable GUID partition on another drive (Bay 3).
    How do I prevent the second bootable partition from mounting when the startup disk is my main drive?
    How do I prevent the first bootable partition from mounting when the startup disk is the partition in Bay 3?
    There disk utilities that cannot fix errors or volume fragmentation (not file fragmentation) on the boot drive.
    Thank you,
    Don

    see this mac os x hint on how to prevent a partition from mounting at startup
    http://www.macosxhints.com/article.php?story=20060930150059172
    you'll need to edit the file /etc/fstab separately on each boot drive.

  • Prevent Encrypted Partition From Mounting at Boot

    I have an external USB HDD partitioned into two. Both partitons are encrypted. I use partition A for a time machine backup for my mac, and the other (when pluged in to a different macbook) is used similarly for that machine. Every time I boot up, or plug the drive in, I get 2 dialogue boxes asking me to enter passwords - one for each partiton.
    I'd like is to set my OS to not mount the second partition on boot at all (no password dialogue / no disk in finder). If I need to mount it, I'd like to be able to do so via Disk Utility.
    I've tried using the method described here: https://discussions.apple.com/thread/4271735?start=0&tstart=0, but it does not work - perhaps because my partiton is encrypted? Is there perhaps a different fs type for encrypted disks? (not "hfs").
    I've also followed this thread: https://discussions.apple.com/thread/4870225 , but I'm reticent to switch off automounting totally because I use other encrypted disks for work and need them to mount at boot.
    Any thoughts?

    Linc Davis wrote:
    It seems that the fstab method doesn't work with CoreStorage volumes.
    Yes, that's correct. Core Storage doesn't look at fstab at all.
    If the only Core Storage volumes you have are encrypted containers, you can achieve the desired outcome by disabling boot time invocation of the Core Storage daemon. Please note that Apple's Fusion Drive technology relies on Core Storage, so if you have a system with Fusion Drive, this workaround may break your computer.
    Linc Davis wrote:
    There is no way I know of to prevent automounting of CoreStorage volumes selectively. You may be able to prevent all CS volumes from automounting by deleting or commenting out the "LaunchEvents" key in this file:
    That's the idea, but good heavens, don't comment things out in launch plists! Do it right, use launchctl.
    The Core Storage daemon normally runs at boot, and manages logical volumes assigned to Core Storage—specifically, in the OP's case, encrypted containers. If you have no other mission-critical Core Storage volumes, you may use the launchctl command to disable the Core Storage daemon, using the unload -w argument, as per the launchctl man page:
    unload [-w] [-S sessiontype] [-D domain] paths ...
                  Unload the specified configuration files or directories of con-
                  figuration files.  This will also stop the job if it is running.
                  -w       Overrides the Disabled key and sets it to true. In pre-
                           vious versions, this option would modify the configura-
                           tion file. Now the state of the Disabled key is stored
                           elsewhere on-disk.
    So, in Terminal, the command to prevent Core Storage from running at boot time would be as follows:
      $ sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.corestorage.corestoraged.plist
    Please note again that Apple's Fusion Drive technology relies on Core Storage, so if you have a system with Fusion Drive, this workaround may break your computer.
    After disabling the Core Storage daemon, you may still mount encrypted volumes using Disk Utility, or the command line (hdiutil attach /dev/diskX where /dev/diskX is the encrypted container).
    Hope this helps.

  • [SOLVED] External HDD not mounting at boot

    So, I've got this USB external HDD which won't mount at boot time. I set it in /etc/fstab using its UUID and it works immediately after boot if I do
    sudo mount -a
    I had it before on a different machine, running Arch too, and never had this problem. How can I see what's going on at boot time? I usualy just start the computer remotely (wake on lan).
    Last edited by RaisedFist (2010-10-21 11:22:46)

    Couldn't it be caused by the external HDD not being ready yet when the system boot? Nowadays I rarely encounter these issues, but some years ago even certain internally connected drive would need a delay to get ready for boot. If so settings in BIOS has to be adjusted.
    Just a quick guess.

  • [SOLVED] NFS share not mounting at boot

    Hi All,
    I have an NFS share listed in fstab and it doesn't mount at boot; however, when i mount -a, it mounts fine. Any thoughts?
    Thanks.
    Shawn
    Last edited by shawn.abdushakur (2011-05-06 12:21:27)

    @damnshock: Good point . Here it is:
    # /etc/fstab: static file system information
    # <file system> <dir> <type> <options> <dump> <pass>
    devpts /dev/pts devpts defaults 0 0
    shm /dev/shm tmpfs nodev,nosuid 0 0
    #/dev/cdrom /media/cd auto ro,user,noauto,unhide 0 0
    #/dev/dvd /media/dvd auto ro,user,noauto,unhide 0 0
    #/dev/fd0 /media/fl auto user,noauto 0 0
    /dev/sda1 swap swap defaults 0 0
    LABEL=arch / ext4 defaults 0 1
    UUID=c1a8b2e0-bf9e-4382-ac4e-15c2aec65090 /srv/nfs ext3 defaults 0 0
    /srv/nfs/shawn/Documents /home/shawn/Documents none bind
    /srv/nfs/shawn/Downloads /home/shawn/Downloads none bind
    /srv/nfs/shawn/Music /home/shawn/Music none bind
    /srv/nfs/shawn/Pictures /home/shawn/Pictures none bind
    /srv/nfs/shawn/Videos /home/shawn/Videos none bind
    xbmc:/srv/nfs/watch /home/shawn/Downloads/torrents/watch nfs rsize=8192,wsize=8192,timeo=14,intr

  • [solved] no sound when booting with webcam attached

    Hi everybody,
    hopefully this is the right section to post since I'm not quite sure if the problem is related to KDE or a general hardware thing. ;-)
    Anyway, the problem that I have is that I don't have any sound at all when booting my system while my webcam, a logitech 9000 pro, is attached to the USB port.
    Even when unplugging the webcam afterwards the sound does not work. I need to reboot my system first with the webcam detached and than it'll work again. I also did already manually insert the modules in /etc/rc.conf but no change. Every time it seems that the webcams audio interface will be recognized as the primary audio device.
    When not having the camera plugged in and plugging it in while KDE is up, everything works like a charm.
    But of course it bothers me quite big time to unplug the webcam every time after using it and rebooting the system again after I forgot to unplug it.
    I also checked for other modules to be loaded automatically (compared the output of lsmod before and after plugging in the webcam) but there was no change.
    So does anyone have an idea what to do in order to get the order of the audio devices right?
    Thank you!...
    Last edited by kurisutian (2009-11-23 19:34:10)

    In your /etc/rc.d/modprobe.d/modprobe.conf try to put zero index for your audio driver, so it will load first. In my case it's this line:
    options snd-hda-intel index=0

  • Error Message when booting from System CD's

    Ill advised I put a OSX disk in my hardly used iMac CRT G4 with 64meg of RAM. I did not know about the firmware upgrade required. Discovering my error I tried to use the System Recovery / Install CDs that came with the machine.
    When booting from the CD all goes well until about 50% into the boot and then the following error appears on the screen
    interfaceLib -- MgmError with a button to reboot the machine and make sure that the C button is held down on the keyboard. BUT the mac is trying to boot from the CD. Holding down the C button makes no difference. Holding down the shift key (preventing the extentions) gets past the error BUT the system restore or system install programs will not run.
    Help! I am really stuck

    Not only were you suppose to update your firmware, you also needed to purchase more RAM. The minimum RAM requirement for OS X is 128mb. However, Cat System users strongly recommend 256mb+.
    Suggest you check out the following links & see the section on "Tray Loaders".
    iMac (CRT) (FAQ)>
    User-Contributed Tips & Answers>Fixing iMac(CRT) firmware/OS X problems
    Firmware Problem Solver Thanks to Giles Kennedy.
    Good luck.

  • I partitioned my MacBook Pro and installed Windows 8 in it.....now I can't find my partition when I pressed option key when booting up.....so how can I do to find the partition to boot...I can see it in the disk manager in Mac....any ideas? thanks..!..

    I partitioned my MacBook Pro and installed Windows 8 in it.....now I can't find my partition when I pressed option key when booting up.....so how can I do to find the partition to boot...I can see it in the disk manager in Mac....any ideas? thanks..!..

    Hi LamboMong,
    just try this:
    http://refit.sourceforge.net
    install, reboot twice and choose the Windows-Partition on next startup.
    (The apple-bootloader doesn't display all bootable harddisks.
    With rEFIt you can boot from all partitions/harddisks on your computer.)
    I hope that will solve your problem.
    Daniel Fernau

Maybe you are looking for

  • Can a workflow process continue from form trigger?

    in my workflow project i have launched a workflow process from a form.in the process there is a notification from which i can open a form for further modification of data .currently i am continuing this particular process by pressing an 'updated' but

  • How to correct start failover after loosing disk0 on one of ASA

    Hello, guys. I have some problems with correct answer. One CF in one of ASA had died from active/standby failover cluster few days ago. So all works perfectly. But now I have: asa-5520/act# sh fail Failover On Failover unit Secondary Failover LAN Int

  • How to define a regular expression using  regular expressions

    Hi, I am looking for some regular expression pattern which will identify a regular expression. Also, is it possible to know how does the compile method of Pattern class in java.util.regex package work when it is given a String containing a regex. ie.

  • Safari 5 not working properly!

    Until earlier today, Safari was working just fine. Then suddenly, when I was changing options on my iPhone to sync with the Safari bookmarks rather than the IE ones, Safari stopped working. After looking at the processes in Task Manager, it is indeed

  • Search and replace for Unicode characters

    Hello, I have a function which searches and replaces characters on file. It works with ASCI sharacters, but not when the strings which needs to be replaced contains Unicode ('á', 'ā') etc.  The source file is codding utf8 . $file = "file.txt"  $Searc