|
OpenBSD Security Functionally paranoid! |
|
Thread Tools | Display Modes |
|
|||
Whole Disk Encryption and USB Drive
I'm trying to switch over to a BSD from Slackware Linux. So far OpenBSD has been almost perfect. I have installed 5.9 with whole disk encryption and it seems to work OK. The glitch is that I can no longer mount any USB devices. dmesg will show that a plugged in flash disk is recognized, but it cannot be mounted. Error message says device is busy and the flash disk led flashes constantly. I'm using an SSD in my laptop. Could this be causing a conflict since softraid is also being used? Any help would be appreciated.
|
|
|||
Can you provide more details, please?
Code:
# #seconds after pluging of USB dmesg | tail -n 15 sysctl hw.disknames
__________________
Signature: Furthermore, I consider that systemd must be destroyed. Based on Latin oratorical phrase Last edited by e1-531g; 20th June 2016 at 02:55 PM. |
|
|||
Sorry it took so long to reply.
Here is the dmesg information: Code:
scsibus4 detached umass0 detached umass0 at uhub0 port 7 configuration 1 interface 0 "PNY Technologies USB 2.0 FD" rev 2.00/11.00 addr 3 umass0: using SCSI over Bulk-Only scsibus4 at umass0: 2 targets, initiator 0 sd1 at scsibus4 targ 1 lun 0: <PNY, USB 2.0 FD, 1100> SCSI2 0/direct removable serial.154b007a08YE11003234 sd1: 7788MB, 512 bytes/sector, 15950592 sectors sd1 detached scsibus4 detached umass0 detached umass0 at uhub0 port 7 configuration 1 interface 0 "TOSHIBA TransMemory" rev 2.00/1.00 addr 3 umass0: using SCSI over Bulk-Only scsibus4 at umass0: 2 targets, initiator 0 sd1 at scsibus4 targ 1 lun 0: <TOSHIBA, TransMemory, 1.00> SCSI2 0/direct removable serial.09306544CF614007589F sd1: 29587MB, 512 bytes/sector, 60594432 sectors Code:
hw.disknames=wd0:07909548bdb1d885,cd0:,sd0:40143ecea7dff7cb,sd1: Thanks again, if this will help solve the problem. Last edited by ocicat; 5th July 2016 at 10:53 AM. Reason: Please use [code] & [/code] tags when posting command output. |
|
|||
Wait some time till the led stopps flashing then try again to mount it. As bigger as the disk is, as longer it needs. Experienced the same with a 32 / 64 GB USB stick and a external 1 TB harddisk connected using USB.
|
|
|||
Disklabel seems to correctly identify the flash drive as sd1i. But if I try mounting it, the message error is that it is busy. The led indicator on the flash drive continually flashes. I finally removed the flash after 2 minutes. I tried another Toshiba flash drive. it gave the same error. Led keeps flashing.
|
|
||||
Busy? According to the mount(2) syscall man page, EBUSY will be returned if the mount point directory is held by another process. Your problem is not the device, it is the mount point you are attempting to use.
For example, if your shell's working directory is currently /mnt, you will not be able to successfully use /mnt as your mount point, because .... it is in use by your shell. |
|
|||
My working directory is my home directory. And I'm attempting to mount the device under a subdirectory called /usb. As soon as I plug in the flash device, the led begins flashing, even as root. I think I remember testing out mounting flash drives before I did a whole disk encryption, and I think it worked as it should then. Still a mystery why the drive flashes immediately at plugin and never stops.
|
|
|||
I ran fstat and got a lot of info, none of which stands out. I have OpenBSD on a Fujitsu laptop and have specified apm, hotplug, and dbus to be run. Could there be a conflict with these? I kept all defaults during the installation. Didn't change any configurations.
|
|
||||
If $ fstat /usb shows more than just one line of column headers, the directory is in use. You must choose a different mount point, or terminate the processes.
|
|
|||
I forgot to say I also have toadd enabled. When I try fstat /usb. I get the error no such file.
If I fstat -f ~/usb, I get a long list, the same as when I fstat -f, only FD MOUNT at wd /home. It does not list /usb as being mounted. If I try mount /dev/sd1i /mnt, I still get a device busy message. |
|
||||
You have automation you have provisioned which read disklabels every 8 seconds and attempt to mount for you, and you wonder why your LED is blinking and your device is busy?
Try stopping *all* of your automated mounting services. Code:
# rcctl stop toadd # rcctl stop hotplugd # rcctl stop amd Quote:
Quote:
$ fstat -f ~/usb will list every open file and directory in /home.If you want to see if /home/staus/usb is busy, the command is $ fstat /home/staus/usb Quote:
$ df -h will show you all mounted filesystems, their mount points, their capacity, and their current storage usage. Perhaps /dev/sd1i is already in that list, mounted by toadd somewhere under /run/media/.
Last edited by jggimi; 27th June 2016 at 02:18 PM. Reason: typos / disabling -> stopping |
|
|||
Thanks for the help. I stopped toadd, hotplugd, and amd. hotplugd was the only daemon that killed the flashing when the drive is plugged in. I also did an fstat | less (after re-anabling all three daemons) to see all info, and did not find any reference to /usb or /media with or without the flash drive plugged in.
I guess I will need to compare the two lists to see what might be different. Work keeps interfering with solving this problem, so I cannot devote more time like I want. Thanks again. |
|
|||
I did a comparison of fstat with the flash memory uplugged versus plugged. The only difference was the pid for fstat. I'm beginning to think the problem is the softraid setup for whole dick encryption on an ssd.
I really like OpenBSD. It has almost all the functions I need for daily laptop use, except for usb access to flash and external harddrives. |
|
||||
Softraid and USB insertion should not interfere with each other.
As I don't have a clue about your situation except for what you've posted in this thread, I have a suggestion for diagnosis. Setup
|
|
|||
Thanks for all the help. I ran and saved the log file just as you wrote. The led on the flash drive flashed continually after I successfully mounted it, and a listing proved it really did mount on /mnt.
Here is my log file attached, I hope. I cannot tell where it is on my post. |
|
||||
Thanks for taking the time to run this test. You have been able to confirm a lot of things the problem is not.
It is:
What are we left with, then, as a possible problem cause? The processes you are running when in multi-user mode. Is it one of your fleet of automounting daemons? I thought so before, and your test seems to have confirmed it. To test this, try disabling them and rebooting, instead of stopping them. Stopping them didn't seem to eliminate the problem previously. Code:
# rcctl disable amd # rcctl disable toadd # rcctl disable hotplugd |
|
|||
For what it's worth, I've used whole disk encryption on an SSD for years without having any issues at all, including mounting USB drives.
But I think I destroyed a 32 GB SanDisk USB drive once though, dd:ing the entire thing it with /dev/zero. It wasn't even working in windoze after that |
|
|||
I finally got the usb flash to reliably mount after disabling amd, toadd, and hotplugd. Lots of reboots later, I found an error in the /etc/rc.conf.local for apmd_flags. Thanks for all the help and suggestions. Now on to further testing and use.
|
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Full Disk Encryption | jjstorm | OpenBSD Installation and Upgrading | 3 | 30th May 2016 08:19 PM |
Full disk encryption in NetBSD 7.0 RC2 | bashrules | NetBSD Installation and Upgrading | 1 | 18th August 2015 02:11 AM |
Disk encryption | mfaridi | OpenBSD Security | 12 | 2nd March 2015 08:45 PM |
whole disk encryption | 22decembre | OpenBSD Security | 6 | 5th January 2015 09:23 AM |
Security: Encryption: Disk Encryption | eurovive | Other BSD and UNIX/UNIX-like | 17 | 6th March 2010 04:09 AM |