From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from holgerdanske.com (holgerdanske.com [184.105.128.27]) by mail.server123.net (Postfix) with SMTP for ; Wed, 27 Apr 2016 06:18:09 +0200 (CEST) Received: from ::ffff:99.100.19.101 ([99.100.19.101]) by holgerdanske.com for ; Tue, 26 Apr 2016 21:18:01 -0700 References: <571FEDEE.7030904@gmail.com> From: David Christensen Message-ID: <57203D89.40808@holgerdanske.com> Date: Tue, 26 Apr 2016 21:18:17 -0700 MIME-Version: 1.0 In-Reply-To: <571FEDEE.7030904@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dm-crypt] LUKS partition write-protected, mounting read-only List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: dm-crypt@saout.de On 04/26/2016 03:38 PM, Serrano Pereira wrote: > Hello, > > When I create a LUKS partition like so: > > $ cryptsetup luksFormat /root/test I typically put a LUKS container into a partition on a HDD, SSD, USB flash drive, etc. -- e.g. /dev/sdb1. Is /root/test a file (?). How did you create it? > $ cryptsetup open /root/test test Note that 'test' is a user-space command and/or a shell built-in. It's best to avoid using that word for *anything*. My 'man cryptsetup' doesn't show any 'open' action. Did you cut/paste the above from a console session? If not, please post exact console sessions with commands and output. Entering things by hand from memory invites Murphy's Law. > $ mkfs.ext4 -j /dev/mapper/test Why the '-j' option (ext3 journal)? > $ mount /dev/mapper/test /mnt/files I assume /mnt/files already existed when you ran the above command? > > Then I can create files in /mnt/files just fine. But when I copy > /root/test to a different computer, Did you unmount the file system and close the LUKS container before copying /root/test to the other machine? > and then do: > > $ cryptsetup open /root/test test > Enter passphrase for /root/test: > mount: /dev/mapper/test is write-protected, mounting read-only > $ mount /dev/mapper/test /mnt/files > > As you can see, the device is mounted read-only. I cannot write any > files to the LUKS partition. Why is this so? How can I write to the > partition on another computer? As root, please run these commands on the computer with the source LUKS device (file) and post the console session: uname -a umount /mnt/test cryptsetup --version cryptsetup luksClose test ls -l /root/test cryptsetup luksDump /root/test cryptsetup luksOpen /root/test test ls -l /dev/mapper/test fsck /dev/mapper/test ls -ld /mnt/files mount /dev/mapper/test /mnt/files mount | grep '/mnt/files' ls -ld /mnt/files echo 'hello, world!' > /mnt/files/hello.txt Then repeat for the computer with the copy. We're looking for error messages. If you don't understand the above commands, RTFM each one. If a command is broken, fix it. Hopefully, that will provide enough clues to figure out what's going on. David