Ask Your Question

tcplay: USB clean unmount

asked 2011-11-18 15:02:11 -0600

Mohan G gravatar image

updated 2011-11-18 19:00:17 -0600

Hi, I am using "tcplay" to encrypt my USB. I am able to map, mount and unmount the encrypted partition. But I think unmount is no clean.

When I insert my USB for the 1st time, it is under /dev/sdb, I mapped, mounted and unmounted it. 2nd time when I inserted it, USB gets detected as /dev/sdc. This continues as /dev/sdd, /dev/sde and so on. I even tried removing the map files (/dev/mapper/truecryptX) which were created previously. But no luck. When I restart my PC, this starts from /dev/sdb.

There is absolutely no problem when use a normal (unencrypted) USB.

How can overcome this problem ?

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2011-11-23 21:42:12 -0600

Mohan G gravatar image

updated 2011-11-25 05:09:05 -0600

I finally got my issue solved. I had to remove (unmapping) the map files (/dev/mapper/truecryptX) using cryptsetup, i.e., "cryptsetup remove truecryptX". Previously I was not unmapping but, just removing the map files using "rm" command.

In the tcplay man pages, the process of mapping and mounting is explained but nothing is mentioned about unmapping and unmounting. And being a beginner in using encrypted partitions, I knew nothing about this.

Anyhow thanks to both of you, for trying to help me.

edit flag offensive delete link more

answered 2011-11-21 04:03:13 -0600

Stanislav Ochotnicky gravatar image

While it might indeed indicate a problem with tcplay, it's safer and more resilient to use UUIDs to identify drives (especially removable). To get what is UUID of your encrypted drive, put it into USB slot and run blkid. Example output:

# blkid 
/dev/sda1: UUID="899b91ab-2c23-4ee3-b5d0-b53919e1d192" TYPE="ext4" 
/dev/sda2: UUID="xfxKg0-xE1h-OF5m-CxpF-jjNv-oVWt-YgGzUO" TYPE="LVM2_member" 
/dev/sda5: UUID="MKZ7BS-AJjm-LfCW-RDQS-k9eH-WD7x-4POh5W" TYPE="LVM2_member" 
/dev/mapper/vg_fedora-lv_swap: UUID="adcab3d7-967b-42d3-8ca8-4840bb0959b5" TYPE="swap" 
/dev/mapper/vg_fedora-lv_root: UUID="a6167631-1e31-4496-a89d-333155c2028b" TYPE="ext4" 
/dev/mapper/vg_fedora-lv_home: UUID="7a07fbbd-7eec-4897-bcd4-4614c5b0028b" TYPE="ext4" 
/dev/mapper/vg_fedora-data: UUID="2655240f-ef82-4eee-9ef1-fcbb7217165c" TYPE="ext4"
/dev/sdc: UUID="94372b90-1427-11e1-95ab-2b823b8cf22f" TYPE="ext4"

Let's say /dev/sdc is our drive. Then to configure /etc/fstab properly for changing device names I'd have to add following line into /etc/fstab:

UUID="94372b90-1427-11e1-95ab-2b823b8cf22f" /mnt/external_drive defaults 0 0

Obviously change the options suitable for your drive. But basically it all boils down to: Don't use device names, but rather UUIDs. They are unique and stable for each device.

edit flag offensive delete link more

answered 2011-11-21 03:46:55 -0600

mether gravatar image

Perhaps you should report a bug against tcplay in bugzilla.

edit flag offensive delete link more


Question Tools


Asked: 2011-11-18 15:02:11 -0600

Seen: 2,044 times

Last updated: Nov 25 '11