LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-06-2010, 03:02 PM   #1
bobby953
Member
 
Registered: Mar 2009
Posts: 41

Rep: Reputation: 15
Can't mount an encrypted volume with an overlaying ext3 FS


I created a encrypted volume on top of software raid1. These are my steps:

1. Create logical partition on sda
2. Create logical partition on sdb (same size)
3. Change type to partition to 'fd' for both partitions
4. Check that the both partitions are same size and type
fdisk -l /dev/sda && fdisk -l /dev/sdb
5. partprobe
6. Make sure there are no remains from previous RAID installations on /dev/sdb by running:
mdadm --zero-superblock /dev/sda6
mdadm --zero-superblock /dev/sdb6
7. mdadm --create /dev/md4 --level=1 --raid-disks=2 /dev/sda6 /dev/sdb6
8. watch cat /proc/mdstat

9. update mdadm.conf
mdadm --examine --scan | grep mdx >> /etc/mdadm.conf

10. Load twofish module
[root@localhost ~]# modprobe twofish

11. # cryptsetup -y -c twofish-cbc-essiv:sha256 create ftdata /dev/md4
Enter passphrase:
Verify passphrase:

12. mkfs.ext3 -b 4096 -R stride=8 /dev/mapper/ftdata

13. mkdir /ftdata

14. Mount the encrypted volume:
mount -O noatime /dev/mapper/ftdata /ftdata

It mounts successfully this first time. When I cd /ftdata, I can see the lost+found dir

Now, I unmount the volume
cd ~
Code:
umount /ftdata

cryptsetup remove ftdata
And now, if I try to setup my encrypted volume like this:
Code:
[root@localhost ~]# cryptsetup create ftdata /dev/md4
Enter passphrase:
mount -O noatime /dev/mapper/ftdata /ftdata
I get this error:
mount: you must specify the filesystem type

So I do:
Code:
mount -t ext3 /dev/mapper/ftdata /ftdata/
mount: wrong fs type, bad option, bad superblock on /dev/mapper/ftdata,
       missing codepage or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so
The dmesg | tail shows this:
Code:
[root@localhost ~]# dmesg | tail
Bluetooth: RFCOMM TTY layer initialized
Bluetooth: RFCOMM ver 1.8
Bluetooth: HIDP (Human Interface Emulation) ver 1.1
eth0: no IPv6 routers present
kjournald starting.  Commit interval 5 seconds
EXT3 FS on dm-0, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
padlock: VIA PadLock not detected.
hfs: unable to find HFS+ superblock
VFS: Can't find ext3 filesystem on dev dm-0.
So why is it that I can't mount my encrypted volume after the first time? I am giving the correct password when it asks to. Any insights? Thanks for your help in advance.
 
Old 06-07-2010, 08:31 AM   #2
g33ky
Member
 
Registered: Jun 2010
Location: France
Distribution: openSUSE 11.2, (B)LFS, Mepis, Linux Mint 9
Posts: 30

Rep: Reputation: 17
Quote:
Now, I unmount the volume
cd ~
Code:
umount /ftdata

cryptsetup remove ftdata


Hello,

I see you removed the crypting right before you unmount the volume. I'm not an expert in that domain, but I would say that when you remove, the FAT looks like corrupted as :

Quote:
EXT3 FS on dm-0, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
padlock: VIA PadLock not detected.
hfs: unable to find HFS+ superblock
VFS: Can't find ext3 filesystem on dev dm-0.
Could you try any 'fsck' on the node '/dev/mapper/ftdata' ?

Keep me up to date. Thanks !

g33ky
 
Old 06-07-2010, 08:55 AM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
The filesystem was unmounted first.
...

Examine the raid array with the file command:
sudo file -s /dev/dm4

Does it describe an encrpted filesystem?

Use "-o" instead of "-O".

You may find using Luks to be more convenient.
 
Old 06-07-2010, 09:14 AM   #4
g33ky
Member
 
Registered: Jun 2010
Location: France
Distribution: openSUSE 11.2, (B)LFS, Mepis, Linux Mint 9
Posts: 30

Rep: Reputation: 17
Sorry for the mistake... Didn't see correctly.. A bit tired tho... :|
 
Old 06-07-2010, 03:10 PM   #5
bobby953
Member
 
Registered: Mar 2009
Posts: 41

Original Poster
Rep: Reputation: 15
Thanks for your efforts guys... I got an answer as to why it wasn't mounting from people at centos forums. I thought I would share here as well

When I create subsequent mapping between /dev/mapper/ftdata and /dev/md4, I need to mention the cipher I am using with the -c option. The -y is not needed any more. This is because the default is aes. If I had used aes as my cipher, then simple
cryptsetup create ftdata /dev/md4
would work.

Therefore, I have to do the following:
cryptsetup -c twofish-cbc-essiv:sha256 create ftdata /dev/md4
Enter passphrase:

Now, mounting like this has no problem:
mount -O noatime /dev/mapper/ftdata /ftdata
It mounts successfully. yay
 
Old 06-07-2010, 06:58 PM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Thanks for the update. I've always used aes & luks and didn't know that the encryption method wasn't supplied in the superblock.
 
  


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
Recovering data from password encrypted volume akumarkind Linux - Desktop 1 03-04-2010 08:42 AM
Recovering data from password encrypted volume akumarkind LQ Suggestions & Feedback 1 03-04-2010 08:41 AM
mounting / rescue encrypted volume simonwil Ubuntu 2 11-02-2009 02:58 PM
Encrypted Volume Recovery seta37 Fedora 3 06-22-2009 04:14 PM
Mayday! How do I manually mount my encrypted ext3 external usb disk? simonsharry Linux - Newbie 11 02-15-2009 04:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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