[Solved] Wait for external usb disk before mounting partition

Hello,
I have a fresh setup where 3 btrfs subvolumes are supposed to be mounted on /var /home and /opt. Those subvolumes are on an external usb drive (root fs is on a sd card).
During boot, systemd tries to mount /var first but encounter "var not empty, mounting anyway" (probably due to several boot attempts) and then "special device uUID=12f15a3e-cf5c-4bc2-9475-6b4686a30f90 does not exist" where 12f15a3e-cf5c-4bc2-9475-6b4686a30f90 is the correct id of the drive.
From journactl extract it seems that usb drive is not ready yet when /var is being mounted.
Is there a way to make systemd wait for "the disk is ready" before trying to mount /var ?
Information:
- mounting /var in rescue mode works perfectly (mount -o subvol=var /dev/sda /var)
- device is a raspberry but I think it has no link to the issue (except maybe being slow to send power to usb)
- the usb drive is behind a 4 port usb hub (externally powered)
- the usb drive indeed take some time to be powered up
- /home and /opt are mounted in rescue mode automatically a few seconds later
journatctl wrote:Jan 01 01:00:07 capodimonte systemd[1]: Starting Local File Systems (Pre).
Jan 01 01:00:07 capodimonte systemd[1]: Reached target Local File Systems (Pre).
Jan 01 01:00:07 capodimonte systemd[1]: Mounting /var...
Jan 01 01:00:07 capodimonte systemd[1]: var.mount: Directory /var to mount over is not empty, mounting anyway.
Jan 01 01:00:07 capodimonte systemd-udevd[138]: starting version 218
Jan 01 01:00:07 capodimonte mount[139]: mount: special device uUID=12f15a3e-cf5c-4bc2-9475-6b4686a30f90 does not exist
Jan 01 01:00:07 capodimonte kernel: scsi 0:0:0:0: Direct-Access     Inateck                   0001 PQ: 0 ANSI: 6
Jan 01 01:00:07 capodimonte kernel: sd 0:0:0:0: [sda] 1953525168 512-byte logical blocks: (1.00 TB/931 GiB)
Jan 01 01:00:07 capodimonte kernel: sd 0:0:0:0: [sda] Write Protect is off
Jan 01 01:00:07 capodimonte systemd[1]: var.mount mount process exited, code=exited status=32
Jan 01 01:00:07 capodimonte kernel: sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00
Jan 01 01:00:07 capodimonte kernel: sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
Jan 01 01:00:07 capodimonte systemd[1]: Failed to mount /var.
Jan 01 01:00:09 capodimonte kernel:  sda: unknown partition table
Jan 01 01:00:09 capodimonte kernel: sd 0:0:0:0: [sda] Attached SCSI disk
Jan 01 01:00:09 capodimonte kernel: random: nonblocking pool is initialized
Jan 01 01:00:09 capodimonte kernel: BTRFS: device label external_hdd devid 1 transid 24 /dev/sda
Jan 01 01:00:09 capodimonte systemd[1]: Found device NS1066 external_hdd.
Jan 01 01:00:09 capodimonte systemd[1]: Mounting /home...
Jan 01 01:00:09 capodimonte systemd[1]: Mounting /opt...
Jan 01 01:00:09 capodimonte kernel: BTRFS info (device sda): enabling auto defrag
Jan 01 01:00:09 capodimonte kernel: BTRFS info (device sda): disk space caching is enabled
Jan 01 01:00:09 capodimonte kernel: BTRFS: has skinny extents
Jan 01 01:00:09 capodimonte systemd[1]: Mounted /home.
Jan 01 01:00:09 capodimonte systemd[1]: Mounted /opt.
Jan 01 01:00:09 capodimonte systemd[1]: Startup finished in 5.088s (kernel) + 4.607s (userspace) = 9.696s.
My fstab:
# /dev/mmcblk0p3
UUID=4660fa0a-bcf6-4d83-b956-d7bf9df222b9 / ext4 rw,relatime,data=ordered 0 1
# /dev/sda LABEL=external_hdd
UUID=12f15a3e-cf5c-4bc2-9475-6b4686a30f90 /home btrfs rw,relatime,space_cache,noatime,compress=lzo,autodefrag,subvol=home 0 0
# /dev/sda LABEL=external_hdd
uUID=12f15a3e-cf5c-4bc2-9475-6b4686a30f90 /var btrfs rw,relatime,space_cache,noatime,compress=lzo,autodefrag,x-systemd.device-timeout=30s,subvol=var 0 0
# /dev/sda LABEL=external_hdd
UUID=12f15a3e-cf5c-4bc2-9475-6b4686a30f90 /opt btrfs rw,relatime,space_cache,noatime,compress=lzo,autodefrag,subvol=opt 0 0
# /dev/mmcblk0p1
UUID=95DB-C13B /boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro 0 2
Last edited by kamaradclimber (2015-03-12 19:25:40)

Thanks for your reply.
I don't see any btrfs subvolume information in /dev.
Here is the var.mount config:
systemctl show var.mount wrote:Where=/var
What=/dev/sda
Options=rw,relatime,compress=lzo,space_cache,autodefrag
Type=btrfs
TimeoutUSec=1min 30s
ControlPID=0
DirectoryMode=0755
SloppyOptions=no
Result=exit-code
ExecMount={ path=/bin/mount ; argv[]=/bin/mount -n uUID=12f15a3e-cf5c-4bc2-9475-6b4686a30f90 /var -t btrfs -o rw,relatime,space_cache,noatime,compress=lzo,autodefrag,subvol=var ; ignore_errors=no ; start_time=[Thu 1970-01-01 01:00:07 CET] ; stop_time=[Thu 1970-01-01 01:00:07 CET] ; pid=141 ; code=exited ; status=32 }
Slice=system.slice
ControlGroup=/system.slice/var.mount
Delegate=no
CPUAccounting=no
CPUShares=18446744073709551615
StartupCPUShares=18446744073709551615
CPUQuotaPerSecUSec=infinity
BlockIOAccounting=no
BlockIOWeight=18446744073709551615
StartupBlockIOWeight=18446744073709551615
MemoryAccounting=no
MemoryLimit=18446744073709551615
DevicePolicy=auto
UMask=0022
LimitCPU=18446744073709551615
LimitFSIZE=18446744073709551615
LimitDATA=18446744073709551615
LimitSTACK=18446744073709551615
LimitCORE=18446744073709551615
LimitRSS=18446744073709551615
LimitNOFILE=4096
LimitAS=18446744073709551615
LimitNPROC=7329
LimitMEMLOCK=65536
LimitLOCKS=18446744073709551615
LimitSIGPENDING=7329
LimitMSGQUEUE=819200
LimitNICE=0
LimitRTPRIO=0
LimitRTTIME=18446744073709551615
OOMScoreAdjust=0
Nice=0
IOScheduling=0
CPUSchedulingPolicy=0
CPUSchedulingPriority=0
TimerSlackNSec=50000
CPUSchedulingResetOnFork=no
NonBlocking=no
StandardInput=null
StandardOutput=journal
StandardError=inherit
TTYReset=no
TTYVHangup=no
TTYVTDisallocate=no
SyslogPriority=30
SyslogLevelPrefix=yes
SecureBits=0
CapabilityBoundingSet=18446744073709551615
MountFlags=0
PrivateTmp=no
PrivateNetwork=no
PrivateDevices=no
ProtectHome=no
ProtectSystem=no
SameProcessGroup=yes
IgnoreSIGPIPE=yes
NoNewPrivileges=no
SystemCallErrorNumber=0
RuntimeDirectoryMode=0755
KillMode=control-group
KillSignal=15
SendSIGKILL=yes
SendSIGHUP=no
Id=var.mount
Names=var.mount
Requires=-.mount
Wants=system.slice
RequiredBy=systemd-journal-flush.service man-db.service shadow.timer man-db.timer local-fs.target systemd-random-seed.service logrotate.timer systemd-update-utmp.service
Conflicts=umount.target
Before=systemd-journal-flush.service man-db.service shadow.timer man-db.timer local-fs.target systemd-random-seed.service logrotate.timer systemd-update-utmp.service umount.target
After=local-fs-pre.target -.mount systemd-journald.socket system.slice
RequiresMountsFor=/
Documentation=man:fstab(5) man:systemd-fstab-generator(8)
Description=/var
LoadState=loaded
ActiveState=active
SubState=mounted
FragmentPath=/run/systemd/generator/var.mount
SourcePath=/etc/fstab
UnitFilePreset=disabled
InactiveExitTimestamp=Thu 1970-01-01 01:01:11 CET
InactiveExitTimestampMonotonic=71204114
ActiveEnterTimestamp=Thu 1970-01-01 01:01:11 CET
ActiveEnterTimestampMonotonic=71204114
ActiveExitTimestampMonotonic=0
InactiveEnterTimestamp=Thu 1970-01-01 01:00:07 CET
InactiveEnterTimestampMonotonic=7409499
CanStart=yes
CanStop=yes
CanReload=yes
CanIsolate=no
StopWhenUnneeded=no
RefuseManualStart=no
RefuseManualStop=no
AllowIsolate=no
DefaultDependencies=yes
OnFailureJobMode=replace
IgnoreOnIsolate=yes
IgnoreOnSnapshot=no
NeedDaemonReload=no
JobTimeoutUSec=0
JobTimeoutAction=none
ConditionResult=yes
AssertResult=yes
ConditionTimestamp=Thu 1970-01-01 01:00:07 CET
ConditionTimestampMonotonic=7365732
AssertTimestamp=Thu 1970-01-01 01:00:07 CET
AssertTimestampMonotonic=7365738
Transient=no

Similar Messages

  • How does the security model work for external USB disks attached to an AEBS

    I've attached a USB disk to my AEBS after partitioning it first on my MBP using Disk Utility. I created a single partition with a GUID partition table covering the entire disk. Next I deselected the "Ignore ownership on this volume" checkmark and assigned myself and my wife read/write access, my group read access, and the rest no access. Next, I hooked it up to the AEBS and created some test files. I noticed in Terminal that the files I created all had rwx access for user, group and others. Trying to chmod that into something less open, like rwx for me, rx for the group and nothing for others didn't work. Also I noticed that when I was logged in the files I had created had my name as the owner, but when my wife logged in, those same files were owned by my wife.
    What is happening here ? Who is the actual owner of the files on the external USB disk on my AEBS, and what are the real access rights (as they seem to depend on the actual user). On my AEBS I've setup "File sharing", "With accounts" and created accounts for both me and my wife, as well as disabled guest account access.
    I get the impression that the owner and access rights seem to depend on the actual user connected to the AEBS, but I'm not sure.
    Can anybody please enlighten me on the subject of AEBS access rights/ownership for USB disks ?
    With kind regards,
    Aloy

    All that I can provide is what has worked for me for years.
    The Time Capsule is setup as the router for the network, connected to a simple Zoom 5431J cable modem.
    Static Internet IP connection from the cable provider is 12.34.567.89
    By default, the Time Capsule is at 10.0.1.1 on the local network
    Port Mapping setup for the Time Capsule is......
    Public UDP Port 8884
    Public TCP Ports 8884
    Private IP 10.0.1.1
    Private UDP 548
    Private TCP 548
    The hard drive on the Time Capsule is accessed from a remote location at afp://12.34.567.89:8884
    The AirPort Extreme is connected by Ethernet to the Time Capsule and is it setup to operate in Bridge Mode
    The AirPort Extreme always receives a reserved local IP address of 10.0.1.2 from the Time Capsule
    The Port Mapping setup (on the Time Capsule) looks like this for the AirPort Extreme.......
    Public UDP Port 8888
    Public TCP Port 8888
    Private IP  10.0.1.2
    Private UDP 548
    Private TCP 548
    The USB hard drive connected to the AirPort Extreme is accessed from a remote location at afp://12.34.567.89:8888
    If you are still having difficulty, I would delete all of Port Mapping settings on the Time Capsule and Update the Time Capsule. Then, go back and setup the Port Mapping for the Time Capsule, check that to make sure that it is working, then setup the Port Mapping settings on the Time Capsule for the AirPort Extreme.

  • Have to wait for Time Machine disk before opening or saving

    I can't tell you how irritating it is, when it click open or save (any program) , to hear my Time Machine hard disk begin to spool up. As soon as hear that sound, I know that means I have to sit and wait for the Time Machine disk to initialize and get all set before I can save my work. This is majorly ticking me off.
    This problem is present on any document i go to save/open.
    Why is the OS trying access the Time Machine disk when I try to open or save anywhay??? There's no reason for that! No one is ever opening up and saving to Time Machine while doing normal workflow! The only thing the Time Machine hard drive should be responsible for is backing up!
    I swear, I'm thinking about disconnecting my Time Machine disk while I'm working and just reconnect it when I'm away from the computer...it's getting that bad. I shouldn't have to do that. That's ridiculous.
    Any ideas?
    Thank you

    Why is the OS trying access the Time Machine disk when I try to open or save anywhay???
    The system will wake ALL hard disks when the save dialog is opened TM is not excepted from this. There is nothing very special a TM volume other than its icon.
    There's no reason for that! No one is ever opening up and saving to Time Machine while doing normal workflow!
    There are many users who use a TM drive for data other than TM backups.
    What make and model is your drive? Some drives have power management controllers which have to be set with disk management software. If you have one of these drives you may need to turn off the hardware power management with this software. The problem here is that some manufactures only provide this software for Windows. Seagate is one such manufacturer

  • Disk Utility hangs attempting to erase SimpleTech 100gb external USB disk

    I'm attempting to erase and format a SimpleTech 100gb external USB disk. Disk Utility hangs. The system error log says:
    "AppleUSBEHCI[0x1d59000]::Found a transaction past the completion deadline on bus 91, timing out!
    Jul 21 17:30:35 Kari-Hohnbaums-Computer-2 kernel[0]: USBF:"
    The console log (and Disk Utility log) shows:
    Preparing to erase : “PBEX1”
    Creating Partition Map
    error writing partition map: Device not configured (6)
    Disk Erase failed with the error:
    What is the problem? This disk is recognized by Tiger but only as read-only as it ships as an NTFS volume and must be erased and reformatted before it can be used by a MAC.
    All help appreciated.

    I tried the partition approach and it unfortunately failed as well. The same "hung" symptoms as before. The green light (disk activity) on the disk flashed several times at the initial request, but that was all. I eventually interrupted it after a hourn which generated the same system log message: AppleUSBEHCI[0x1d59000]::Found a transaction past the completion deadline on bus 91, timing out!
    The disk utility log says:
    Preparing to partition disk: “SAMSUNG HM100JC Media”
    Partition Scheme: Apple Partition Scheme
    Mac OS 9 Disk Drivers installed
    1 partitions will be created
    Partition 1
    Name : “PBEX1”
    Size : 93.2 GB
    Filesystem : Mac OS Extended (Journaled)
    Creating Partition Map
    Partition failed for disk SAMSUNG HM100JC Media Device not configured
    Partition complete.
    I don't have easy access to a Window's box. I do have access to a Linux system. Perhaps I can configure it there and it will work on my PB.

  • How can i create a Trash for external USB Drives ?

    Hello,
    how can i create a Trash for external USB Drives or my TimeCapsule ?
    Thanks.

    You do not need to create trash cans for individual drives.  The trash can on the desktop holds deleted files from all mounted drives.
    TimeCapsule manages its own space.  If it fills up it will delete older backps to make space for newer ones.

  • When trying to do a system backup to my remote LaCie hard drive, what does it mean when I get a message that says "waiting for volume LaCie disk"?  While this message apears no back-up occurs.  Is there a setting I need to change?

    When trying to do a system backup to my remote LaCie hard drive, what does it mean when I get a message that says "waiting for volume LaCie disk"?  While this message apears no back-up occurs.  Is there a setting I need to change?

    You can't do a backup of icloud to an external drive.  In fact, does your post have anything to do with icloud (you're in the icloud forum)?
    What kind of "system backup" are you doing?  Are you using Time Machine?

  • Time Capsule doesn't allow to access NTFS external USB Disks

    good morning. I've just configured a 2TB Timecapsule, in a wireless network with 2 MACBookPro and 1 windows xp.
    A HP HJPro 8500 is connected to TC and is reachable via wireless, thru a Belkin USB port replicator.
    two time machine's usb disks are connected thru the same belkin adapter and work fine.
    Another two external usb disks, formatted as NTFS, are not visible at all (even if they are, if connected directly to the macs of to the xp.
    I've tried to disconnect the TM disks, leaving connected only the two ntfs disks, with no results.
    Any idea to solve this issue? i don't expect to have NTFS disks not accessible thru TC.. no manuals mentioned this as a problem..
    thank you in advance.
    F

    NTFS is not supported:
    http://support.apple.com/kb/ht2426

  • Aperture Library on External USB disk

    Hello
    My internal, 250GB disk on my iMac is almost full.
    Are there any performance / reliability issues I should be aware of of moving my 50GB aperture library to an external USB disk ??
    I don't use time machine to back it up - just the aperture vaults. I would probably back it up to a second external USB drive.
    Any help much appreciated.
    Andrew

    USB2 is a poor connectivity method for hard drives on Macs, adequate for backup where speed is unimportant but bad news for a Library. Aperture performance is largely about the Library, so you want it on a relatively unfilled internal drive, definitely not on an external USB drive.
    Hard drives slow as they fill above 40% or so. Take enough data off the internal drive to maintain at least 100 GB free space and keep the Aperture Library on the internal drive with Referenced Masters on external drives.
    In the future buy large hard drives (currently the 1 TB size is cost effective) that have multiple connectivity methods that include Firewire800 and eSATA. One good source is OWC: <http://www.owcomputing.com/>.
    Good luck!
    -Allen Wicks

  • Boot from external USB disk

    Is there any way to boot from an external USB disk formatted in NTFS or UFS (CD/DVD format)? Basically my idea was to be able to boot the Win7 install image from an USB device. I tried many different ways, I even have my old internal HDD with the boot camp partition in a USB case (I just upgraded to 500GB!! ;)) but I can't in any way boot from USB. Only OSX backup and its installation disk boot fine from an external USB source. Any idea?

    It isn't well supported by Microsoft. The problem on Apple hardware is you can't even make changes to the BIOS boot manager.
    I have 4 internal hard drives so it is rather easy to boot from one hard drive and run the installer.
    You ran into the lack of support for UEFI though which adds another layer and meant most likely having to alter and reburn the ISO to disc with Imgburn or something (and can be done from Windows only so you need a VM).
    I got tired of the trouble and work arounds needed though and in the end I just built my own custom PCs - one of which has native eSATA that are bootable (an Intel DX58SO board).
    Oh, and it is easy to install Windows 7 on PC, then just move the drive into Mac Pro and boot from there!

  • Menu bar items disappear, and external hard disks not mounting

    Hi,
    This problem started yesterday. I start up my Mac, and none of the menu bar items in the top-right of the screen show up. Then I noticed that none of my external hard disks had mounted.
    Looking at the Activity Monitor, I saw that sustemuiserver was not running.
    Reading around, I discovered that this usually follows a FrontRow hack (which I haven't installed). I tried deleting the ~/Library/preferences/com.apple.systemuiserver.plist file and logging out and back in again. Everything seems to work again, for a while. However, the same thing happened this morning.
    Has anyone else experienced this, and anyone know a fix to stop it from happening?
    Thanks!
    Tom

    I've been having the same problem for a while (I believe since 10.5.3). I have reinstalled OSX, installed OSX 10.5.6 combo hoping that it would fix it, but nothing yet. I have the problem only when I insert an expresscard into the slot and restart. It connects to a PCI expansion chassis. When I restart with the ExpressCard installed, all menu items dissappear and I can't eject volumes (hard drives) from the desktop. If I restart without the ExpressCard in, the menu bars seem to work properly. I tried with an older G4 running 10.4.11, with a CardBus card and the same chassis, and that worked fine... all menu bar items displayed and worked properly and I could eject disks.
    I have also tried creating new users, but that didn't work either.

  • Problems saving files Using a FAT formated external usb disk

    Can not save my files 360gb on a external usb disk. Message appear" can not save file, the file already exist". If i format he disk as macos there is no problem.
    I want to share mi files between mac an pc and I don't want to expend 45 dollars buying MACDRIVE
    Thanks

    Try installing "MacFUSE", which may provide better support for FAT and NTFS-formatted drives than the built-in filesystem support. Unlike the default support, MacFUSE will enable writing to NTFS drives, which may be a more compatible solution for your Windows PCs.

  • ExFAT external usb disk not working in Lion?

    Hi, I used to be able to read/write to an external usb disk, exFAT formatted, using Snow Leopard.
    Since upgrading to Lion I can't seem to be able to find the disk anymore on the desktop/finder. When I go into Disk Utility it sees it but thats pretty much all it will do. Anyone knows of this issue or how to fix it?
    Thanks
    Richard

    I am encountering a similar issue where I can read but not write to an exFAT volume (connected over FireWire 800) in the Finder.  While I don't know of a fix, opening a Terminal and using CP to move files seems to work.

  • Wait for a few minutes before starting a backgroung step in workflow

    Dear All,
    I have a requirement where in I have to make sure the user has completed a particular workitem. The workitem is to open the transaction PP02. I cannot make it asynchronous and use a terminating event as I could not see any logical place where I could trigger the terminating event on SAVE.
    Now, I am trying to check if the database is updated on save of the transaction and before I do that I would want the workflow to wait for a few mintues.Is this approach correct?
    Is there any way I can make the workflow to wait for a few mintues before it starts the next backgound step?
    Please suggest.
    Best Regards
    Vikram

    I think it is better option to use the WAIT Step 
    as you said that until you save the data in the trabsaction you don't want to proceed further then, try like this
    Create a wait step and use the option wait for condition.
    define a element in the workflow of type char01( assume TEST) .
    Pass X to this element from the transaction when ever you save the data.
    and define the condition for the wait step in such a way that until the value of TEST = X do not proceed further.

  • Every time I start my Apple TV it shuts down. I have to unplug it and wait for it to reconnect before I can use it.  Any suggestions?

    Every time I start my Apple TV it shuts down. I have to unplug it and wait for it to reboot before I can use it.  This makes turning on Apple TV a very long process.  Any suggestions?

    That would be very hard to do, as I would have to do a lot of things--including moving furniture to get at the back of a receiver--and I'm not at all sure that the receive could accommodate it.
    The process is like this:  I dial the receiver to the Apple TV input.  The light comes on, like it's connecting, but then the Apple TV goes dark before any connection happens.  Then I unplug the power cord, wait a few moments, and plug it back in.  Then the Apple TV actually connects, but only after a full reboot (setting time, etc).

  • External USB disk (time machine) won't mount or unmount... can't acces data

    I have a recently bought FreeCom external USB drive for backups to Time-Machine.
    And just today time machine gave an error “backup failed” and the disk appeared unmounted.
    I tried mounting it.. but it wasn’t there. I disconnected it. Restarted the whole computer.
    Now, it shows up in Disk Utility sometimes... but the actual volume of the disk is invisible.
    Only the option “unmount” is available, but that fails. Neither can I "verify" or "repair" or anything.
    I hear it starts up and shuts down, it semi-shows up in disk utility... what can I do to acces it again???
    There are some important files on there (besides the backup) that I need.
    (This disk has never travelled or fallen/bumped.. it always sits stationairy under my desk.)
    Message was edited by: Inofaith

    Oddly enough, I attempted to post an answer to your question earlier, but it seems to have not been posted.
    Have you tried a different cable or a different USB port?
    Have you tried the drive on a different Mac?
    Does the drive get its power from the USB port, or does it have an independent power supply?
    Does the drive have any security features?
    Since I am not familiar with this particular drive, I looked it up, and see that there are several models, and I don't know exactly which one you have. So I will be guessing as to what could be wrong.
    If the drive gets its power through the USB port and draws too much power, it could be overloading the USB port and the USB port will shut down rather than allow too much power to be drawn. If you shut down the computer, it can "reset" the USB hub so that it will work again. If this is a possibility, you could try a powered USB hub or powering the drive with a independent power supply. Mac USB ports are very picky about anything drawing too much voltage.
    It's possible that you have a faulty USB cable, so it would be worth trying a different cable.
    It's possible, although I think less likely, that the enclosure itself could be faulty.
    If there is a security feature, it may need to be reactivated in order to connect with the drive.
    Hopefully the drive and its data are intact. It sounds to me more like a problem connecting with the drive than a problem with the drive itself. The intermittent nature of the problem lead me to suspect a problem with the cable or the USB port, as the connection itself is what seems to be flakey.
    Good luck!

Maybe you are looking for