LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 02-14-2014, 02:24 PM   #1
shams
Member
 
Registered: Jan 2004
Posts: 535

Rep: Reputation: 30
Cannot close the mapping device with cryptsetup?


I want to encrypt a partition with cryptsetup plain mode what i did is here:
Quote:
cryptsetup create /dev/sdc3
mkfs.ext4 /dev/mapper/crypt
mount /dev/mapper/crypt /crypt
The commands was successfull and asked for the passphrase and everything was done, i copy my data to the /crypt directory and umount the /crypt:
Quote:
umount /crypt
Now how to close the /dev/mapper/crypt device for the security reason that no one can mount it? and how i can open the device again to mount it?
 
Old 02-14-2014, 02:33 PM   #2
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,851
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
cryptsetup luksClose /dev/mapper/crypt

to re-open

cryptsetup luksOpen /dev/sdc3 crypt

Last edited by mostlyharmless; 02-14-2014 at 02:35 PM.
 
Old 02-14-2014, 05:45 PM   #3
shams
Member
 
Registered: Jan 2004
Posts: 535

Original Poster
Rep: Reputation: 30
Thanks for the reply, the first command luksClose working, but when i want to open the device get the error:
Quote:
# cryptsetup luksOpen /dev/sdc3 crypt

Device /dev/sdc3 is not a valid LUKS device.

Last edited by shams; 02-14-2014 at 05:51 PM.
 
Old 02-14-2014, 08:57 PM   #4
metaschima
Senior Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 1,982

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
'cryptsetup remove' is the command to remove a device.
 
Old 02-15-2014, 03:14 PM   #5
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,851
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
Might be the way it was created: I use
cryptsetup -s 255 -y luksFormat /dev/sdc3 to create the encrypted partition.
Warning: if you do that now it will wipe out whatever you put on sdc3
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cryptsetup: WARNING: could not determine root device from /etc/fstab rendezvous123 Ubuntu 4 02-28-2013 07:09 AM
Different between Device Mapper and DM-Crypt and Cryptsetup , LUKS saeedsssss Linux - Software 1 10-01-2012 02:57 AM
13 2.6.29.6 cryptsetup luks wrong device name in /dev/mapper/* TheSoftRock Slackware 1 03-04-2010 05:51 PM
cryptsetup and device-mapper problem avallach Linux - Software 5 03-08-2007 11:38 AM
physical scsi channel mapping to scsiX device node mapping, how to configure manually drthornt Linux - Hardware 3 02-09-2003 11:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 07:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration