* [dm-crypt] loop file with partition problems
@ 2012-02-29 16:26 Giovanni Di Stasi
2012-02-29 16:40 ` Arno Wagner
2012-02-29 16:41 ` Milan Broz
0 siblings, 2 replies; 5+ messages in thread
From: Giovanni Di Stasi @ 2012-02-29 16:26 UTC (permalink / raw)
To: dm-crypt
Hi everyone,
I am having problems accessing a partition I have created on a file. I
have never managed to mount it after reboot.
I am using Debian (testing).
This is what I did:
# sudo -i
# echo aes >> /etc/modules
# echo dm_mod >> /etc/modules
# echo dm_crypt >> /etc/modules
# dd if=/dev/urandom of=.encrypted bs=1024 count=500000
# sudo cryptsetup -y create crypt .encrypted
# echo "crypt /home/giovanni/.encrypted none none" >> /etc/crypttab
# sudo mkfs.ext4 /dev/mapper/crypt
# mkdir /home/giovanni/cip
# chown giovanni:giovanni /home/giovanni/cip/
# sudo mount /dev/mapper/crypt /home/giovanni/cip
# ls /home/giovanni/cip/
# sudo umount /home/giovanni/cip
# sudo mount /dev/mapper/crypt /home/giovanni/cip
After rebooted, I don't really know how to mount my partition.
I have tried this:
# sudo -i
# cryptsetup luksOpen .encrypted crypt
Device /dev/loop0 is not a valid LUKS device.
Did I lost all my data as I suspect? If so, why?
Thanks a lot,
Giovanni
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dm-crypt] loop file with partition problems
2012-02-29 16:26 [dm-crypt] loop file with partition problems Giovanni Di Stasi
@ 2012-02-29 16:40 ` Arno Wagner
2012-02-29 16:41 ` Milan Broz
1 sibling, 0 replies; 5+ messages in thread
From: Arno Wagner @ 2012-02-29 16:40 UTC (permalink / raw)
To: dm-crypt
On Wed, Feb 29, 2012 at 05:26:03PM +0100, Giovanni Di Stasi wrote:
> Hi everyone,
>
> I am having problems accessing a partition I have created on a file.
> I have never managed to mount it after reboot.
> I am using Debian (testing).
>
> This is what I did:
>
> # sudo -i
> # echo aes >> /etc/modules
> # echo dm_mod >> /etc/modules
> # echo dm_crypt >> /etc/modules
> # dd if=/dev/urandom of=.encrypted bs=1024 count=500000
> # sudo cryptsetup -y create crypt .encrypted
> # echo "crypt /home/giovanni/.encrypted none none" >> /etc/crypttab
> # sudo mkfs.ext4 /dev/mapper/crypt
> # mkdir /home/giovanni/cip
> # chown giovanni:giovanni /home/giovanni/cip/
> # sudo mount /dev/mapper/crypt /home/giovanni/cip
> # ls /home/giovanni/cip/
> # sudo umount /home/giovanni/cip
> # sudo mount /dev/mapper/crypt /home/giovanni/cip
>
> After rebooted, I don't really know how to mount my partition.
> I have tried this:
>
> # sudo -i
> # cryptsetup luksOpen .encrypted crypt
> Device /dev/loop0 is not a valid LUKS device.
>
> Did I lost all my data as I suspect? If so, why?
You are confusing plain dm-crypt and LUKS. You created the
crypto-container (which is not a partition but a whole
decive here) as plain dm-crypt and are trying to map it
as LUKS. These two are different and not compatible.
Try this:
cryptsetup create crypt .encrypted
mount /dev/mapper/crypt /home/giovanni/cip
Arno
--
Arno Wagner, Dr. sc. techn., Dipl. Inform., CISSP -- Email: arno@wagner.name
GnuPG: ID: 1E25338F FP: 0C30 5782 9D93 F785 E79C 0296 797F 6B50 1E25 338F
----
One of the painful things about our time is that those who feel certainty
are stupid, and those with any imagination and understanding are filled
with doubt and indecision. -- Bertrand Russell
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dm-crypt] loop file with partition problems
2012-02-29 16:26 [dm-crypt] loop file with partition problems Giovanni Di Stasi
2012-02-29 16:40 ` Arno Wagner
@ 2012-02-29 16:41 ` Milan Broz
2012-02-29 17:57 ` Giovanni Di Stasi
1 sibling, 1 reply; 5+ messages in thread
From: Milan Broz @ 2012-02-29 16:41 UTC (permalink / raw)
To: Giovanni Di Stasi; +Cc: dm-crypt
On 02/29/2012 05:26 PM, Giovanni Di Stasi wrote:
Here you are creating plain container (did you mean luksFormat in fact?)
> # sudo cryptsetup -y create crypt .encrypted
and here you are trying to open LUKS...
> # cryptsetup luksOpen .encrypted crypt
so try
sudo cryptsetup -y create crypt .encrypted
which will just recreate the mapping (create just set up mapping,
it doesn't format anything)
Milan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dm-crypt] loop file with partition problems
2012-02-29 16:41 ` Milan Broz
@ 2012-02-29 17:57 ` Giovanni Di Stasi
2012-02-29 18:44 ` Arno Wagner
0 siblings, 1 reply; 5+ messages in thread
From: Giovanni Di Stasi @ 2012-02-29 17:57 UTC (permalink / raw)
To: Milan Broz; +Cc: dm-crypt
Il 29/02/2012 17:41, Milan Broz ha scritto:
> On 02/29/2012 05:26 PM, Giovanni Di Stasi wrote:
>
> Here you are creating plain container (did you mean luksFormat in fact?)
>> # sudo cryptsetup -y create crypt .encrypted
>
> and here you are trying to open LUKS...
>> # cryptsetup luksOpen .encrypted crypt
>
> so try
> sudo cryptsetup -y create crypt .encrypted
>
> which will just recreate the mapping (create just set up mapping,
> it doesn't format anything)
>
> Milan
Worked!! Thanks!!
But I was asked the password twice... how come?
What if I type a different password?
Thanks,
Giovanni
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dm-crypt] loop file with partition problems
2012-02-29 17:57 ` Giovanni Di Stasi
@ 2012-02-29 18:44 ` Arno Wagner
0 siblings, 0 replies; 5+ messages in thread
From: Arno Wagner @ 2012-02-29 18:44 UTC (permalink / raw)
To: dm-crypt
The -y option is useful to use initially to make sure
you have the right password when you format.
It causes cryptsetup to ask the password twice.
For more documentation on the options, run
cryptsetup -h
and refer to the man-page.
Arno
On Wed, Feb 29, 2012 at 06:57:33PM +0100, Giovanni Di Stasi wrote:
> Il 29/02/2012 17:41, Milan Broz ha scritto:
> >On 02/29/2012 05:26 PM, Giovanni Di Stasi wrote:
> >
> >Here you are creating plain container (did you mean luksFormat in fact?)
> >># sudo cryptsetup -y create crypt .encrypted
> >
> >and here you are trying to open LUKS...
> >># cryptsetup luksOpen .encrypted crypt
> >
> >so try
> >sudo cryptsetup -y create crypt .encrypted
> >
> >which will just recreate the mapping (create just set up mapping,
> >it doesn't format anything)
> >
> >Milan
> Worked!! Thanks!!
>
> But I was asked the password twice... how come?
> What if I type a different password?
>
> Thanks,
> Giovanni
> _______________________________________________
> dm-crypt mailing list
> dm-crypt@saout.de
> http://www.saout.de/mailman/listinfo/dm-crypt
>
--
Arno Wagner, Dr. sc. techn., Dipl. Inform., CISSP -- Email: arno@wagner.name
GnuPG: ID: 1E25338F FP: 0C30 5782 9D93 F785 E79C 0296 797F 6B50 1E25 338F
----
One of the painful things about our time is that those who feel certainty
are stupid, and those with any imagination and understanding are filled
with doubt and indecision. -- Bertrand Russell
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-02-29 18:44 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-29 16:26 [dm-crypt] loop file with partition problems Giovanni Di Stasi
2012-02-29 16:40 ` Arno Wagner
2012-02-29 16:41 ` Milan Broz
2012-02-29 17:57 ` Giovanni Di Stasi
2012-02-29 18:44 ` Arno Wagner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox