Drive tends to mount as read-only instead of read-write

617 views
Skip to first unread message

boxbox

unread,
Dec 4, 2014, 5:48:14 AM12/4/14
to al...@googlegroups.com
I use LUKS encrypted drives in my DNS-323. When I decrypt the drive, Alt-F automatically mounts it. Most of the time it works fine, but for some reason it tends to mount sometimes as 'ro' instead of 'rw'. It never used to happen like this until several months ago, before that it always worked perfectly. Started happening randomly all of a sudden (I haven't upgraded Alt-F or anything). Strange thing is this problem seems to occur when for the drive in /dev/dm-1 not /dev/dm-0.

Here is sample output from the mount command.

/dev/dm-1 on /mnt/mydrive type ext4 (ro,relatime,barrier=1,data=ordered)

Any suggestions how to fix this so that the drive always mounts read-write after being LUKS-decrypted by Alt-F?

João Cardoso

unread,
Dec 4, 2014, 10:39:31 AM12/4/14
to al...@googlegroups.com


On Thursday, December 4, 2014 10:48:14 AM UTC, boxbox wrote:
I use LUKS encrypted drives in my DNS-323. When I decrypt the drive,

And how do you do that? details are important. Do you have the password stored in an USB pen? Does that happens at power up? have you used the webUI to create the device? 

I have a comment in the initscript saying:

#usleep 1500000 # this is evil! looks like dm needs to settle... 0.5 sec is not enough

so it might be a timing issue.
 
Alt-F automatically mounts it. Most of the time it works fine, but for some reason it tends to mount sometimes as 'ro' instead of 'rw'.

As you know that happens when fsck isn't able to check the filesystem. Any error on the Status page? what does the system and hot log says?
 
It never used to happen like this until several months ago, before that it always worked perfectly. Started happening randomly all of a sudden (I haven't upgraded Alt-F or anything).

still on RC3?

boxbox

unread,
Dec 4, 2014, 11:48:34 AM12/4/14
to al...@googlegroups.com


On Thursday, December 4, 2014 4:39:31 PM UTC+1, João Cardoso wrote:


On Thursday, December 4, 2014 10:48:14 AM UTC, boxbox wrote:
I use LUKS encrypted drives in my DNS-323. When I decrypt the drive,

And how do you do that? details are important. Do you have the password stored in an USB pen? Does that happens at power up? have you used the webUI to create the device? 

See below please.
 

I have a comment in the initscript saying:

#usleep 1500000 # this is evil! looks like dm needs to settle... 0.5 sec is not enough

so it might be a timing issue.
 
Alt-F automatically mounts it. Most of the time it works fine, but for some reason it tends to mount sometimes as 'ro' instead of 'rw'.

As you know that happens when fsck isn't able to check the filesystem. Any error on the Status page? what does the system and hot log says?

You're right, it didn't even occur to me to check this. On the status page it says

    No cryptsetup support found for partition type "crypt_LUKS" in "sdb1"
    No cryptsetup support found for partition type "crypt_LUKS" in "sdc1"
     
    Unable to automatically fix dm-1, mounting Read Only: fsck 1.41.14 (22-Dec-2010)
    fsck
    .ext4: Device or resource busy while trying to open /dev/dm-1
    Filesystem mounted or opened exclusively by another program?
I encrypted the drives originally using another Linux computer, not through Alt-F web UI.

I don't decrypt the drives on DNS-323 startup, I have a trivially simple script that I run manually that provides the encryption password on the command line.

Both drives are decrypted with my manual commands, and Alt-F then automatically mounts them, but only the one in /dev/dm-1 is mounted as 'ro' instead of 'rw'.

Not sure why the error thinks device or resource is busy, as I only ever try to decrypt the drives after the DNS-323 has rebooted, so everything should be starting from a clean slate.

 
 
It never used to happen like this until several months ago, before that it always worked perfectly. Started happening randomly all of a sudden (I haven't upgraded Alt-F or anything).

still on RC3?

Didn't realize, upgrading to RC4 now.
 
Reply all
Reply to author
Forward
0 new messages