linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* loop-aes: It is not longer possible to create a filesystem on an encrypted DVD-RAM
@ 2011-03-27 17:16 Thomas Siedlich
  2011-03-28  6:56 ` Jari Ruusu
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Siedlich @ 2011-03-27 17:16 UTC (permalink / raw)
  To: linux-crypto

Hi!
 
I try to format a loop-aes encrypted DVD-RAM in /dev/sr0 with mke2fs.
 
,----[command line]
| eagle:~# losetup -v -e AES256 -K ./key.gpg /dev/loop2 /dev/sr0
| Password:
| eagle:~# losetup /dev/loop2
| /dev/loop2: [000b]:985 (/dev/sr0) encryption=AES256 multi-key-v3
| eagle:~# mke2fs -K -N 2048 -m 0 -b 4096 -v /dev/loop2
| mke2fs 1.41.12 (17-May-2010)
| fs_types for mke2fs.conf resolution: 'ext2', 'default'
| Filesystem label=
| OS type: Linux
| Block size=4096 (log=2)
| Fragment size=4096 (log=2)
| Stride=0 blocks, Stripe width=0 blocks
| 2240 inodes, 1118352 blocks
| 0 blocks (0.00%) reserved for the super user
| First data block=0
| Maximum filesystem blocks=1149239296
| 35 block groups
| 32768 blocks per group, 32768 fragments per group
| 64 inodes per group
| Superblock backups stored on blocks:
|   32768, 98304, 163840, 229376, 294912, 819200, 884736
|
| Writing inode tables: done
| Writing superblocks and filesystem accounting information: done
|
| This filesystem will be automatically checked every 29 mounts or
| 180 days, whichever comes first.  Use tune2fs -c or -i to override.
| eagle:~# echo $?
| 0
| eagle:~#
`----
 
 
After the successfull mke2fs run ($? = 0) I have got this error message
in syslog:
 
,----[/var/log/syslog]
| Mar 27 15:29:27 eagle kernel: loop2: loop_end_io_transfer err=-95 bi_rw=0x461
| Mar 27 15:29:27 eagle kernel: Buffer I/O error on device loop2, logical block 0
| Mar 27 15:29:27 eagle kernel: lost page write due to I/O error on loop2
| Mar 27 15:29:27 eagle kernel: loop2: loop_end_io_transfer err=-95 bi_rw=0x20
| Mar 27 15:29:27 eagle kernel: Buffer I/O error on device loop2, logical block 0
`----
 
 
And I'm not able to mount the freshly created file system:
 
,----[command line]
| eagle:~# mount -text2 /dev/loop2 /media/backup/
| mount: wrong fs type, bad option, bad superblock on /dev/loop2,
|        missing codepage or helper program, or other error
|        In some cases useful info is found in syslog - try
|        dmesg | tail  or so
|
| eagle:~#
`----
 
,----[/var/log/syslog]
| Mar 27 15:30:40 eagle kernel: EXT2-fs (loop2): error: can't find an ext2 filesystem on dev loop2.
`----
 
 
Do I the same without encryption this means:
 
,----[command line]
| eagle:~# mke2fs -K -N 2048 -m 0 -b 4096 -v /dev/sr0
| mke2fs 1.41.12 (17-May-2010)
| /dev/sr0 is entire device, not just one partition!
| Proceed anyway? (y,n) y
| fs_types for mke2fs.conf resolution: 'ext2', 'default'
| Filesystem label=
| OS type: Linux
| Block size=4096 (log=2)
| Fragment size=4096 (log=2)
| Stride=0 blocks, Stripe width=0 blocks
| 2240 inodes, 1118352 blocks
| 0 blocks (0.00%) reserved for the super user
| First data block=0
| Maximum filesystem blocks=1149239296
| 35 block groups
| 32768 blocks per group, 32768 fragments per group
| 64 inodes per group
| Superblock backups stored on blocks:
|   32768, 98304, 163840, 229376, 294912, 819200, 884736
|
| Writing inode tables: done
| Writing superblocks and filesystem accounting information: done
|
| This filesystem will be automatically checked every 30 mounts or
| 180 days, whichever comes first.  Use tune2fs -c or -i to override.
| eagle:~# mount -text2 /dev/sr0 /media/backup/
| eagle:~#
`----

It just works fine but unencrypted :-(.

I guess it is a problem with loop-aes. Have someone an idea how I
can track this down or has someone seen this already?

My recipe above did work two years ago. I have a couple of working
formatted DVD-RAM from this time. Only e2fsck doesn't work any longer
in fact with the same behavior as mke2fs above this means $? = 0 and
the same errors in /var/log/syslog.

Thanks for help
Thomas



      

^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: loop-aes: It is not longer possible to create a filesystem on an  encrypted DVD-RAM
@ 2011-03-28 22:24 Thomas Siedlich
  2011-03-29  4:07 ` Jari Ruusu
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Siedlich @ 2011-03-28 22:24 UTC (permalink / raw)
  To: Jari Ruusu; +Cc: linux-crypto

Hi Jari!

Jari Ruusu wrote:
> Thomas Siedlich wrote:
> > I try to format a loop-aes encrypted DVD-RAM in
> > /dev/sr0 with mke2fs.
> 
> What loop-AES version are you using?

3.3a, which is the latest in Debian.
I see sourceforge has 3.6b :-( and I see also that the Debian package
has orphaned.
<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=614808>
It's a pity.

> What kernel version are you using?

2.6.35.3 (selfcompiled from kernel.org).

> > ,----[/var/log/syslog]
> > | Mar 27 15:29:27 eagle kernel: loop2:
> > loop_end_io_transfer err=-95 bi_rw=0x461
> 
> Backing device returned EOPNOTSUPP (Operation not supported
> on transport
> endpoint) error for a write. Interpreting rest of bi_rw
> bits depends on
> kernel version. For 2.6.38 kernel bi_rw means: "metadata io
> request",
> "request to discard sectors", and "This bio has already
> been subjected to
> throttling rules. Don't do it again"

For my kernel it should mean (if I interpret 
/usr/src/linux/include/linux/bio.h right):
"Tell the IO scheduler not to wait for more requests after this
        one has been submitted, even if it is a SYNC request."
"synchronous I/O hint."
"barrier"
"write"

> > | Mar 27 15:29:27 eagle kernel: Buffer I/O error on
> >   device loop2, logical block 0
> > | Mar 27 15:29:27 eagle kernel: lost page write due to
> >   I/O error on loop2
> 
> Somehow EOPNOTSUPP error got interpreted as I/O error
> and/or write was not
> retried with bi_rw bits cleared that backing device do not
> support.
> 
> > | Mar 27 15:29:27 eagle kernel: loop2:
> >   loop_end_io_transfer err=-95 bi_rw=0x20
> > | Mar 27 15:29:27 eagle kernel: Buffer I/O error on
> >   device loop2, logical block 0
> 
> Backing device returned EOPNOTSUPP error for a read.
> Interpreting rest of
> bi_rw bits depends on kernel version. For 2.6.38 kernel
> bi_rw means:
> "metadata io request".

Here:
"barrier"
and
"read"

So "barrier" is the same in both messages. But why does it work
without loop? The backing device should be the same, shouldn't it?

> > It just works fine but unencrypted :-(.
> 
> As a temporary workaround, you can create unencrypted file
> system and then
> encrypt it in-place using aespipe tool.

Great idea! I give it a try.

dd if=/dev/sr0 bs=64k | aespipe -e AES256 -K ./key.gpg \
  | dd of=/dev/sr0 bs=64k conv=notrunc

This works. Thanks Jari for this workaround!

Thomas



      

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-04-02 21:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-27 17:16 loop-aes: It is not longer possible to create a filesystem on an encrypted DVD-RAM Thomas Siedlich
2011-03-28  6:56 ` Jari Ruusu
  -- strict thread matches above, loose matches on Subject: below --
2011-03-28 22:24 Thomas Siedlich
2011-03-29  4:07 ` Jari Ruusu
2011-03-29 20:42   ` Thomas Siedlich
2011-04-02 21:32     ` markus reichelt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).