Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have Ubuntu 12.04 installed on an SDHC card (only one ext2 partition, no swap). When I suspend using pm-suspend, my root filesystem is mounted read-only. I am currently "fixing" this with the following file:

/etc/pm/sleep.d/99_make_disk_rw:

#!/bin/sh

mount -o remount,rw /

But the disk is marked as needing an fsck on reboot. How can I prevent the filesystem from being mounted read-only or whatever is going wrong here.

Update: It looks like it is getting mounted read-only because an error occurred. I have changed the mount options for / in /etc/fstab to noatime,nodiratime,errors=continue and it no longer mounts the SDHC card as read-only after it resumes. So the problem is happening when it suspends, not when it resumes as I had thought.

I checked /sys/bus/usb/devices/1-4/power/persist and it is set to 1. So the SDHC card shouldn't appear disconnected to the OS (or more accurately it should recover from the disconnection without error).

Here seems to be the relevant section of the syslog

Sep 10 10:34:23 iubit kernel: [  748.246226] sd 4:0:0:0: [sdb] Media Changed
Sep 10 10:34:23 iubit kernel: [  748.246234] sd 4:0:0:0: [sdb]  Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
Sep 10 10:34:23 iubit kernel: [  748.246243] sd 4:0:0:0: [sdb]  Sense Key : Unit Attention [current] 
Sep 10 10:34:23 iubit kernel: [  748.246253] Info fld=0x0
Sep 10 10:34:23 iubit kernel: [  748.246258] sd 4:0:0:0: [sdb]  Add. Sense: Not ready to ready change, medium may have changed
Sep 10 10:34:23 iubit kernel: [  748.246271] sd 4:0:0:0: [sdb] CDB: Read(10): 28 00 00 5d 3e f0 00 00 08 00
Sep 10 10:34:23 iubit kernel: [  748.246291] end_request: I/O error, dev sdb, sector 6110960
Sep 10 10:34:23 iubit kernel: [  748.247027] EXT2-fs (sdb1): error: ext2_fsync: detected IO error when writing metadata buffers
Sep 10 10:34:23 iubit anacron[6954]: Anacron 2.3 started on 2012-09-10
Sep 10 10:34:23 iubit anacron[6954]: Normal exit (0 jobs run)
Sep 10 10:34:24 iubit laptop-mode: Laptop mode 
Sep 10 10:34:24 iubit laptop-mode: enabled, not active
Sep 10 10:34:24 iubit kernel: [  749.055376] sd 4:0:0:0: [sdb] No Caching mode page present
Sep 10 10:34:24 iubit kernel: [  749.055387] sd 4:0:0:0: [sdb] Assuming drive cache: write through
Sep 10 10:34:25 iubit anacron[7555]: Anacron 2.3 started on 2012-09-10
Sep 10 10:34:25 iubit anacron[7555]: Normal exit (0 jobs run)
Sep 10 10:34:31 iubit kernel: [  756.090861] EXT2-fs (sdb1): previous I/O error to superblock detected
share|improve this question

1 Answer 1

The real problem here is the error "error: ext2_fsync: detected IO error when writing metadata buffers". There was an ext2 bug that was causing this problem but I thought it was fixed, or at least patched.

The file system is being flagged as inconsistent because of the metadata buffers, hence the mounting as R/O and the need for a disk check. Maybe you should change the title of this to something relating to this error and you might get a few more knowledgeable people having a look at it.

I have an EeePC that I use an 8Gb SDHC card in which mounts as /home. It is formatted ext4 and I've never had this problem with any 'buntu from 10.04LTS through to 12.04LTS. It might be worth formatting the SDHC card as ext4 and seeing if the problem goes away in case it is a regression in only the ext2 modules.

Edit: Oh, you might also report this as a bug. See if you can find the original reports on Launchpad and try to re-open them as a regression, or start a new one if you think it is appropriate to do so.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.