LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 11-21-2010, 06:35 AM   #1
skoinga
Member
 
Registered: May 2010
Posts: 87

Rep: Reputation: 0
problem with cryptsetup


Hi all.

i've created an encrypted volume with the following commands:

Quote:
dd if=/dev/urandom of=./secret bs=1M count=10
sudo losetup /dev/loop0 /home/skoinga/secret
sudo cryptsetup -c aes -y create secret /dev/loop0
sudo mke2fs -j /dev/mapper/secret
I can successfully mount and write on that volume.
When I dismount this volume and try to remont, I got this error:

Quote:
mount: wrong fs type, bad option, bad superblock on /dev/mapper/secret,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

and in dmesg:
Quote:
[ 6372.799527] EXT3-fs error (device dm-0): ext3_check_descriptors: Block bitmap for group 0 not in group (block 1752694931)!
[ 6372.801126] EXT3-fs (dm-0): error: group descriptors corrupted
[ 9285.574341] EXT3-fs: barriers not enabled
[ 9285.574464] kjournald starting. Commit interval 5 seconds
[ 9285.574580] EXT3-fs (dm-0): using internal journal
[ 9285.574588] EXT3-fs (dm-0): mounted filesystem with ordered data mode
[ 9408.511844] EXT3-fs error (device dm-0): ext3_check_descriptors: Block bitmap for group 0 not in group (block 1752694931)!
[ 9408.513412] EXT3-fs (dm-0): error: group descriptors corrupted
I've already used the same commands on my older OS (Linux Mint 9).
Now I'm on Linux Mint 10.
The only difference is that now I've an ext4 root partition (/).
This can be a problem?

Thankyou.
 
Old 11-22-2010, 04:48 AM   #2
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
What commands are you using to remount after the initial file creation? It has been a while since I have done this, but I recall the commands are slightly different.

I have attached a couple of script files to this post, one for mount and unmount that work with ext4. You will at least need to change the name of the volume, which in my case is disk.img and double check the name of the names of the underlying files. In the script, it creates a /dev/usbkey and mounts the file system to /media/encrypted.

Note, these scripts are modified versions of one originally found on an Ubuntu wiki for creating encrypted volumes. The wiki page might have some helpful information.
Attached Files
File Type: txt mount.sh.txt (404 Bytes, 93 views)
File Type: txt umount.sh.txt (176 Bytes, 25 views)
 
Old 11-22-2010, 11:02 AM   #3
skoinga
Member
 
Registered: May 2010
Posts: 87

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Noway2 View Post
What commands are you using to remount after the initial file creation? It has been a while since I have done this, but I recall the commands are slightly different.
Maybe you forgot the command to create the filesystem?

Anyway, I've followed your commands:

Quote:
#modprobe aes_generic
#mkdir -p /media/encrypted
#dd if=/dev/urandom of=/root/test bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 33.0241 s, 3.2 MB/s
#losetup /dev/loop0 /root/test
#cryptsetup -c aes -s 256 -h sha256 create test /dev/loop0
Enter passphrase:
#mount -t ext4 /dev/mapper/test /media/encrypted/
mount: wrong fs type, bad option, bad superblock on /dev/mapper/test,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
 
Old 11-23-2010, 03:46 AM   #4
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
I am not sure I fully understand your reply. The scripts that I attached were just to mount and unmount an existing ecryptfs volume, not to create one. Here is the link that I followed initially. It is based upon the idea that you want to store GPG keys in an encrypted volume on a USB stick, but the technique followed should be the same.
 
Old 11-30-2010, 05:52 AM   #5
skoinga
Member
 
Registered: May 2010
Posts: 87

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Noway2 View Post
I am not sure I fully understand your reply. The scripts that I attached were just to mount and unmount an existing ecryptfs volume, not to create one. Here is the link that I followed initially. It is based upon the idea that you want to store GPG keys in an encrypted volume on a USB stick, but the technique followed should be the same.
My fault. I was omitting the "-c aes" cryptsetup parameter when mounting the loop device.
Thankyou
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 problem on -current BCarey Slackware 5 05-06-2010 03:45 PM
[Slackware 13.0]Cryptsetup problem with encrypted home partition dlinux Slackware 3 08-29-2009 12:18 PM
cryptsetup-lux yeehi SUSE / openSUSE 2 12-06-2007 09:21 AM
cryptsetup and device-mapper problem avallach Linux - Software 5 03-08-2007 11:38 AM
Cryptsetup : Arrrrg ! kemkem42 Linux - Software 0 09-28-2005 04:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 04:38 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