[SOLVED] Intentionally forcing array into read-only mode?


Recommended Posts

Is there a way to force the array into a read-only mode (persistent across reboots)?  I've noticed, for instance, that each disk in my array tends to do ~5 writes after starting on boot even if I don't intentionally do any reads/writes (per the stats on the main admin page).

 

I've searched a bit, but everything that comes up is related to arrays/disks being put into read-only mode because of a disk error.

 

As just one of many potential use cases... this would be useful for instance during a parity drive upgrade -- what if another disk fails when the parity drive upgrade is only half-done on the new drive, and there have been writes to the array in the meantime? 

 

If there were a way to force into read-only mode before starting the upgrade, you could use the 'trust my parity drive' procedure to swap the (old, unmodified) parity drive back into the array and recover the failed drive.

Link to comment

When a file system is mounted, the mount date/time is written to the superblock.  Those are the writes you are seeing.  In the same way, when un-mounted, the date-timestamp is updated.

 

You could possibly force read mode on each of the file systems by typing for each:

 

mount -o remount,ro  /dev/md1

mount -o remount,ro  /dev/md2

mount -o remount,ro  /dev/md3

 

etc...

Link to comment

Putting something like that in the 'go' script would satisfy the 'read only' functionality some people have requested whereby drives are set read-only after filling them with media, but wouldn't truly be sufficient for the use case I outlined.

 

Poked in the emhttpd binary, and it looks like (in 4.7) the mount command string is "mount -t reiserfs -o noacl,nouser_xattr,noatime,nodiratime %s %s" -- doesn't look like it's parametrized to be able to specify ',ro' when mounting the device to prevent all writes.  Perhaps I should post this (or have a mod move it?) into Feature Requests.

Link to comment

Putting something like that in the 'go' script would satisfy the 'read only' functionality some people have requested whereby drives are set read-only after filling them with media, but wouldn't truly be sufficient for the use case I outlined.

 

Poked in the emhttpd binary, and it looks like (in 4.7) the mount command string is "mount -t reiserfs -o noacl,nouser_xattr,noatime,nodiratime %s %s" -- doesn't look like it's parametrized to be able to specify ',ro' when mounting the device to prevent all writes.  Perhaps I should post this (or have a mod move it?) into Feature Requests.

There is already a feature in the 5.0series to bring the array up in "safe" mode (not mounting any disks) but you can certainly add this as a feature request.

 

Joe L.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.