Ubuntu :: Automatically Unmount Encrypted USB Flash Drive When Device Is Unplugged?
Apr 21, 2010
I formatted the USB flash drive using Karmic's Format Disk utility (right-click on a volume, select "Format..."), and selected "Encrypted, compatible with Linux (FAT)" from the "Type" drop-down menu.It mounts correctly when I plug it in, and I can access the files just fine.When I unplug the Flash drive without using the 'Safely Remove Drive' option, the icon on my desktop changes its name to '2.0 GB Encrypted', instead of disappearing and unmounting like my unencrypted Flash drives do.
I would like to have encrypted Flash drive treated in the same way as my unencrypted Flash drives, which disappear and unmount when unplugged, even if the 'Remove Safely' menu option isn't used. What can I do to accomplish this?NOTES:When I plug the encrypted Flash drive in, the following line shows up in the output of 'mount'. 'secure' is the name I gave the disk during the format process:
Code:
/dev/mapper/devkit-disks-luks-uuid-302db16c-c6e2-4dd9-a259-436437c76475-uid1005 on /media/secure type vfat
I accidentally unplugged my usb drive before unmounting it. In windows this is no big deal, so I'm used to that. However, I'm finding that in Kubuntu 10.04 this is a big deal. Now I can't mount any other drives unless I use the command line. Also, I can't unmount anything, even if I mount it on the command line.
What do i do? I know a reboot will fix this, but if it happens again i will be right back at this point. It should not take a full reboot just to unmount a drive. I have tried umount -l and umount -f and the terminal window just hangs.
I have external USB hard drive of 320GB(seagate sata).It works fine but, it unmount automatically after some time.In windows it works fine without any problem. also I unplug USB cable & plug it again to mount it is there any other way of mounting it after it gets unmounted.
I've recently purchased a 4gb "ultra speed" flash drive. It reads and writes just fine on both my laptop and desktop. Both of which are running Ubuntu 9.04. However, when I go to unmount the drive from my desktop system, the drive icon on the desktop disappears, but it remains in the "media - File Browser".
There is one change in the file browser though. When I unmount the drive, the "eject" symbol disappears from next to the drive in the "media - File Browser" but the drive icon itself remains. The light never extinguishes on the USB drive, and when I click on the icon that remains in the File Browser, the USB drive mounts itself again and reappears on my desktop and the eject symbol reappears in the File Browser.This drive unmounts just fine from my laptop.
Code:
Bus 002 Device 002: ID 046d:0870 Logitech, Inc. QuickCam Express Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 001 Device 003: ID 058f:6387 Alcor Micro Corp. Transcend JetFlash Flash Drive
I think my 4GB Cruzer flash drive has got a bit corrupted as it suddenly has started mounting at /_"[ instead of something along the lines of /45C1-8FE6 (can't remember the actual number). See the gparted screenshot attached.
So I thought I'd delete the partition, reformat and relabel... but gparted won't let me do it. When it tries to unmount, I get an error message:
Code:
Actually, I just figured it out whilst writing this. I used a umount command in terminal with escape characters, specifically:
Code:
That unmounted it so that I could reformat and relabel.
I have two questions regarding auto mount function of Truecrypt. First question:
I want to automatically mount my flash drive encrypted by Truecrypt using a keyfile whenever I plug the drive. How can I do this? I use Ubuntu 10.10.
Second question:
As I do not know the answer of my first question, I currently use following command in a startup script to mount my encrypted flash drive automatically at every system start-up.
My problem with this method is, Truecrypt always search for the drive in the same path saved in favorite drives list, e.g. /dev/sdb1. However sometimes there are more than one flash drive plugged to my computer and my encrypted drive's path changes. In such cases Truecrypt cannot mount my encrypted drive because it cannot find the drive in its path.
As a workaround I tried "auto-mount=devices" parameter. It is slow because it checks every mounted drive, and some of them external hard disk big in size. Moreover it does not recognize any mount point parameter. I'd like to mount the drive to the same mount point every time.
I've just started using ubuntu one. However, some of the files I store on there are sensitive so I encrypt them using seahorse. Right click, encrypt etc etc. My question is, is there a way to automatically get the encrypt process to delete the un-encrypted file when it makes the new encrypted copy?
Is it possible to automatically run a program on a USB Flash drive upon plugging it on a computer?the program should create a text file inside the USB flash drive as i plug it on the computer? Is this possible? how can i do this? autorun.inf doesn't work. Are there any solutions? by the way, i am using kernel 1.0 on my computer...
I plug a USB device, it gets a /dev entry, e.g. sdf, i mount its filesystem, then some program opens a file on this filesystem. I unplug this device, its /dev entry disappears, but if i replug this device again, it gets another name - sdg.
How can i force the program to close the file so the filesystem is ready to be unmounted without using "lazy unmount" to release the device name, BUT so that the program doesn't crash after trying to make I/O to this file, and, of course, without having to kill the program?
I have a netbook running Ubuntu Netbook Edition and I would like a USB flash drive to be automatically mounted whenever I plug it in. The drive is FAT formatted. It mounts when I plug it in but all files are only writable by my user, other users only have read access. I understand that I need to add a corresponding entry to the /etc/fstab file. I've added the following so far:/dev/sdb1 /mnt/USB_DRIVE vfat
Firstly, is that appropriate so far? I've created /mnt/USB_DRIVE as root. Next, I'm not sure what options I should be finishing the line with, especially to get all users to be able to write to the drive.
What happens on my computer is this: when I insert my Walletex business card-shaped pendrive into any USB port, everything works fine, and so does unmounting using the right-click "Eject" option.However, when I try to unmount the device using the other context menu option, "Remove device safely" (or something like that; sorry, I'm using a localized version of GNOME), it does unmount it, but then mounts it right back on. The weird thing is that after it does it, if you try using that same unmount option again ("Remove safely"), it actually works! And I can replicate this issue every time: the "Eject" context menu option works the first time every time I try it, but the "Remove safely" one, when used for the first time per device insertion causes an unmount and then a re-mount, and works the second time you try it
I have (at least 4) native USB ports that contain flash drives. I know that the /dev/sd[abcd] devices are created in the order they were inserted, but say you have all four plugged in at boot time, or further, they can be plugged and unplugged in real time. At times, /dev/sdf, /dev/sdg, etc. are created as well. I'm ignoring external hubs for now.
I need to know which drive is plugged into the "top port on the front panel", etc, by physical location. From dmesg I can check right after booting and get the physical assignment of a PCI device, say, PCI 0000:00:10.3, as being assigned to the EHCI usb bus. From /proc/bus/usb/devices, and the "T:" field, I have learned that the physical connectors I'm interested are known as USB Bus 1, Port=00, Port=01, Port=04, and Port=05.
From lsusb I can see all sorts of information from the USB point of view, but with no /dev/sd references.
From /proc/scsi/scsi, I can see what scsi devices have been created, with a count consistent with the number of flash drives plugged in, but no USB data.
So, I can get lots of information from the USB storage point of view, and lots of information from the SCSI point of view, but nowhere can I find how to correlate them. In other words, if I want to mount the drive plugged into a given physical slot, how can I find the /dev/sd device I need to mount? udev isn't really interesting here, because I'm just looking for the information that udev would use to answer the same question.
I've done some heaving exploring in the /sys and /proc filesystems and have not yet found where the USB and SCSI worlds intersect.
The closest I have found is (where "Port" is the physical port number from above):
This seems to have some mapping to the physical port and references a "/dev/sd[a-z]" value, but I don't know how reliable it might be, nor do I know if my having to increment that physical port by 1 is meaningful. Anyone have a simpler approach?
So, my goal becomes mount /dev/<sd that was created for the top slot> /mnt/top mount /dev/<sd that was created for the bottom slot> /mnt/bottom etc.
Code: HP 210 Mini Fedora 14 xfce 2.6.35.11-83.fc14.x86_64
I have inserted my handy drive. However, when I right click and select unmount I get the following message:
Code: An application is preventing the volume "New Volume" from being unmounted
So I try from the command line:
Code: umount /dev/sdb1 And I get the following message:
Code: umount: /media/New Volume: device is busy. All I have done is copied some files to my handy drive. So I am not sure what process is keeping my handy drive busy.
Is there any command that I can use to see what process of anything else is using the handy drive?
I have 3 u3 type flash drives, 1 Memorex and 2 Sandisk Cruzers, and one non-U3 (JDSecure).The purpose is file storage.All four work perfectly on Ubuntu 10.04 and XP.I have continual problems with the U3 devices on 11.04. Problems vary from not being able to open the flash drives causing screen to freeze until I remove the device from the hub, or I am unable to unmount the device causing the desktop to freeze until devices are removed.Sometimes I am able to access files in the flash, before the freeze.The non-U3 device works perfectly on 11.04, 10.04, and XP.Sounds like a system problem to me. I have google searched this to death, but can't find a solution.
Ubuntu 10.04.1 to prepare a USB flash drive for use as installation media for a new computer that's on the way. When the Linux kernel tries booting up on the flash drive, I get an error saying VFS: Cannot open root device "<NULL>" or unknown-block(8,1).Here's how I got to this point...Created bootable partition on the thumb drive.Put the following files onto the flash drive: initrd.gz, vmlinuz, and ubuntu-10.04.1-server-amd64.iso fromhttp://archive.ubuntu.com/ubuntu/dis...ages/hd-media/Install Grub2 to the drive via grub-install.Put the following into boot/grub/grub.cfg:
I'm running both Ubuntu 11.04 and Windows XP Home Edition. I have my hard drive partitioned with 90 GB for Windows and 60 GB for Ubuntu. Here's the problem: When I booted up Ubuntu for the first time, the Windows file system appeared as a second HDD. My dad told me that I need to make it so that drive doesn't appear or be read only or else he will be uninstalling Ubuntu because of the risk that some program will write to the Windows file system. I personally am not worried about that happening, but he clearly is. Remember, I'm brand new to Linux so please make things simple for me to under stand!
I've created some encrypted partitions using Disk Utility, and would like them to be automatically mounted when Ubuntu starts up. Is there a guide to this anywhere?
I've gathered that it involves /etc/crypttab and possibly /etc/init.d/cryptdisks, but haven't had much success so far.
Ideally, some of the partitions would mount early in the boot process, while some of them can mount after I've logged in.
I have an external hard drive which connects to a usb port. until recently i could unmount it by right clicking on the desktop icon and selecting unmount. now when i try that it tells me that i can't because the device is not in fstab and i am not the root. i checked mtab and it had this line '/dev/sdb1 /media/usb0 msdos rw,noexec,nodev,nosuid 0 0' i changed that to '/dev/sdb1 /media/usb0 msdos user,rw,noexec,nodev,nosuid 0 0' thinking that would fix it, but it didn't. i unmounted using 'sudo umount /media/usb0' and restarted my computer and now the line in mtab reads '/dev/sdb1 /media/usb0 vfat rw,noexec,nodev,sync,noatime,nodiratime 0 0' and i still can't unmount without using the sudo umount command. i also tried adding '/dev/sdb1 /media/usb0 msdos user,rw,noexec,nodev,nosuid 0 0' to fstab and that didn't help
I have a 160GB drive installed as /dev/sdb. If I replace it with a 500GB drive, do I have to unmount/mount or will it work as is? This is on Ubuntu Server.
I am having this problem. I use an external usb hard drive with my pc running on ubuntu 11.04, If I keep the hard drive idle for a few minutes, ubuntu unmounts it. I suspect there are some options for this, so I looked into the Power Management section, but found nothing that can solve the problem.
Ubuntu(9.10) does not let me the permission to mount/unmount any NTFS partition with a normal click . I have to do it by using sudo mount command like below every time.
"sudo mount /dev/sda6 /media/sda6"
and a similar command to Unmount When I try to mount using the normal click I get the following error message Error unmounting: umount exited with exit code 1: helper failed with: umount: only root can unmount /dev/sda6 from /media/sda6 And a similar error for mounting This problem started when I used storage device manager(pysdm) to mount the drives I have the same problem with all the drives
I use a notebook for work and require a secure place for files in case of theft. I had dev/sda6 for that purpose and I mounted it only when needed and it was encrypted with password. Due to issues with file permissions, I had to re-install the OS. This time I do not have access to the dev/hda6 drive (owned as root) and get warnings when trying to unmount or encript it.
I have thumb drive connected to a busybox box.I mounted it /opt in initialzation file. However after a while it will unmount itself because it changes its drive letter from sda1 to sdb1. How could a usb device change its drive letter by itself? How could I prevent it happening?
I have external hard drive which I used to connect via eSATA. I have edited fstab and it looks like that now: UUID=35C595D5738A319A /media/DATA ntfs auto,user,exec,suid,rw 0 0 The problem is that I can't unmount it as normal user, when do that, receive: Error unmounting: umount exited with exit code 1: helper failed with: umount: only root can unmount UUID=35C595D5738A319A from /media/DATA
I have Seagate Freeagent Go 500GB external hard drive that I use for backup. I wanted to resize the partition so I used GParted to shrink the 500GB NTFS partition to 400GB. The other 100 I wanted to encrypt and use for some other more important files. For some reason, the shrink failed and I disconnected the hard drive and reconnected it. I didn't see the icon appear on the desktop. I went into the Disk Utility to discover that GParted's shrink error deleted all of the partitions on my hard drive. So I created a new 400GB NTFS partition and put back all of my files. The other 100 is unallocated currently.
It will normally mount automatically and show up on the desktop but the hard drive won't mount without me going into the Disk Utility and mounting it through there. I can't even mount it from the Terminal with root privileges. It gives me this:
Quote:
sudo mount /media/My Data mount: can't find /media/My Data in /etc/fstab or /etc/mtab
Now, I can unmount with root privileges and I can unmount it from the Disk Utility. I can browse and edit the files within. But I can't unmount it from within Nautilus or on the desktop (the Safely Remove Drive option is not there).
The new 400GB partition also isn't detected by GParted. It just shows the whole drive as unallocated.
I am using a live-cd version of linux and want to install it to my hard-drive but when i try to unmount it and go into qtparted, it says it is still busy so i cant perform changes. This is my result when i type "mount"
Code:
aufs on / type aufs (rw) tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755) /proc on /proc type proc (rw,noexec,nosuid,nodev) sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
I have Puppy installed on an old laptop and one way or another I ended up with a file inside /usr/bin that has the Stale NFS file error. I've tried to look around for a way to fix it but all places I've looked have only been for the situation where it's on a drive you're able to unmount. At least I think they were. I certainly don't know what I'm doing well enough to know for sure. Obviously restarting the computer has been tried as well as attempting to unmount things, but I can't unmount the drive that is running the unmounting.
I'm trying to configure pam_mount to automatically mount an encrypted partition (luks) and formatted to NTFS. I typed the command in the configuration file: