Welcome! Log In Create A New Profile

Advanced

Flash drive with debian becomes read-only

Posted by davidnewton 
Flash drive with debian becomes read-only
August 09, 2011 09:35AM
My dockstar runs great with debian, but recently I found a strange problem: when I use one of the backup flash drive to boot the dockstar with debian, it works fine and everything seems to be normal, but after 4-10 hours, this drive becomes read-only for some reason, even though it looks like working properly. I checked with this drive from an Ubutun machine using fsck, and no error is found on this drive. It can always reboot without problem and every time after reboot, it becomes normal (writable), then after some time, it becomes read-only again. There is no such problem if I use other backup flash drives to boot. Anybody has idea why this happens and is there any solution, or this drive is damaged but fsck can not detect the damage? Thanks in advance.
Re: Flash drive with debian becomes read-only
August 09, 2011 10:33AM
It's probably encountering some error and re-mounting read-only. You probably don't have any logging enabled, right, so we can't find out why. Install busybox-syslogd. It'll capture log messages to a small ring buffer in memory. You view at the log with "busybox logread". It has a "-f" option to view it live. You're going to need to catch the error that's forcing the re-mount as read-only.
Re: Flash drive with debian becomes read-only
August 09, 2011 03:10PM
kraqh3d:

Thanks for the reply. I use the syslog to catch some logs. There are some errors related to mtdblock1 (as shown below), but with these errors, the flash drive is still writable. So, I guess these errors not related to the read-only problem. I will wait longer to see if re-mount as read-only happens later.


Aug 9 14:48:41 debian user.err kernel: uncorrectable error :
Aug 9 14:48:41 debian user.err kernel: end_request: I/O error, dev mtdblock1, sector 0
Aug 9 14:48:41 debian user.err kernel: uncorrectable error :
Aug 9 14:48:41 debian user.err kernel: end_request: I/O error, dev mtdblock1, sector 0
Aug 9 14:48:41 debian user.err kernel: uncorrectable error :
Aug 9 14:48:41 debian user.err kernel: end_request: I/O error, dev mtdblock1, sector 8
Aug 9 14:48:41 debian user.err kernel: end_request: I/O error, dev mtdblock1, sector 128
Re: Flash drive with debian becomes read-only
August 10, 2011 08:21AM
I got some clue about the read-only problem: in the fstab file, I have a line as:


/dev/root / ext2 noatime,errors=remount-ro 0 1


So, if there is any error, the file system will be remounted as read-only. Some I/O error must have happened when it was remounted.
Re: Flash drive with debian becomes read-only
August 10, 2011 12:08PM
Yes, that's why I gave you that suggestion. The default fstab includes the remount as readonly on error. But those errors on mtdblock1 are unrelated. That mtd "partition" is where the stock pogo kernel is located. What device is your root parition? Do this on a terminal and see what it catches (assuming its /dev/sda)

busybox logread -f | grep /dev/sda

You can also have it run in the background and pipe all the captured messages to another mounted device.
Re: Flash drive with debian becomes read-only
August 11, 2011 10:55AM
Thanks a lot for your input. It seems that I am lucky these 2 days: there is no read-only problem come out for the last 48 hours and the log file from logread does not have error message except the error for mtdblock1. I will keep logread running to see if it can catch the I/O error. BTW, is it safe to put the remount as rw instead of ro in the fstab file? Thanks.
Re: Flash drive with debian becomes read-only
August 11, 2011 03:20PM
You could remove "errors=remount-ro", but I wouldn't advise it. That's to protect the root fs by trying to prevent further damage.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: