From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.saout.de ([127.0.0.1]) by localhost (mail.saout.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9m7iU_d5sIdL for ; Wed, 29 Feb 2012 17:40:32 +0100 (CET) Received: from v4.tansi.org (ns.km33513-03.keymachine.de [87.118.94.3]) by mail.saout.de (Postfix) with ESMTP for ; Wed, 29 Feb 2012 17:40:32 +0100 (CET) Received: from gatewagner.dyndns.org (84-74-163-71.dclient.hispeed.ch [84.74.163.71]) by v4.tansi.org (Postfix) with ESMTPA id 5294020508C for ; Wed, 29 Feb 2012 17:40:32 +0100 (CET) Date: Wed, 29 Feb 2012 17:40:31 +0100 From: Arno Wagner Message-ID: <20120229164031.GA9165@tansi.org> References: <4F4E519B.3030504@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F4E519B.3030504@gmail.com> Subject: Re: [dm-crypt] loop file with partition problems List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: dm-crypt@saout.de 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