LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Need to FSCK regularly (https://www.linuxquestions.org/questions/linux-general-1/need-to-fsck-regularly-484147/)

froussy 09-16-2006 03:58 PM

Need to FSCK regularly
 
Hi,

I'm using a small box, running Fedora Core 5, with a 40gig, 200gig and a 320gig. Its running as a Samba file server for all my windows machines.


Since I started to fill my 320gig i have to ran fsck almost every day.

I copy file on it, and when the problem start, i have that error:

mv: cannot create regular file `/mnt/320gig/misc/xxxxxxxx': Read-only file system (xxx is a filename)

The only thing i can do to fix that, is to unmount the drive, and run:

[root@trinity ~]# fsck -C -V /dev/hdg1 -a


Any Idea?
Thanks

Lenard 09-16-2006 06:06 PM

And how much space is free???
From the console or xterm session try running; df

Have you looked into removing the junk, like old files, un-needed files (like the yum cached downloaded rpm files) or temp files??

froussy 09-16-2006 11:22 PM

Quote:

Originally Posted by Lenard
And how much space is free???
From the console or xterm session try running; df

Have you looked into removing the junk, like old files, un-needed files (like the yum cached downloaded rpm files) or temp files??

Code:

[root@trinity ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/hda1            9.5G  1.9G  7.2G  21% /
tmpfs                252M    0  252M  0% /dev/shm
/dev/hde1            184G  13G  162G  8% /mnt/200gig
/dev/hda2              26G  982M  24G  4% /mnt/users
/dev/hdg1            294G  176G  104G  63% /mnt/320gig
[root@trinity ~]#

The concerned drive is "/dev/hdg1". On this drive, nothing related to the OS, only files from users on the network.

generic_user 09-17-2006 12:54 AM

Quote:

Originally Posted by froussy
Hi,

I'm using a small box, running Fedora Core 5, with a 40gig, 200gig and a 320gig. Its running as a Samba file server for all my windows machines.


Since I started to fill my 320gig i have to ran fsck almost every day.

I copy file on it, and when the problem start, i have that error:

mv: cannot create regular file `/mnt/320gig/misc/xxxxxxxx': Read-only file system (xxx is a filename)

The only thing i can do to fix that, is to unmount the drive, and run:

[root@trinity ~]# fsck -C -V /dev/hdg1 -a


Any Idea?
Thanks

It's very likely the drive is on its' last legs.
Do this as root:
yum -y install smartmontools
/sbin/service smartd start
/sbin/chkconfig smartd on
smartctl --test=long /dev/hda (I'm assuming the drive is hda, change appropriately)
it'll tell you how long the test will take (don't worry it can run on a live system)
finally run:
smartctl -a /dev/hda

and see what it has to say about your drive.

Btw, I think it's a good idea to run the diagnostic program designed for the drive... they're able to map out the bad sectors with reserved ones that most drives have these days. Seagate has seatools, maxtor has powermax, etc.. these are free to download from the manufacturers web sites. Note that data on any bad sector will be lost forever, so best to run some type of backup if possible.

Finally, after that, run fsck again. I had problems with a Maxtor drive that was doing the same thing as your drive is now... I think the drive was overheating, which caused the failure to happen sooner than later. Drives today really need to have some type of active cooling.

froussy 09-18-2006 06:49 AM

Quote:

Originally Posted by generic_user
It's very likely the drive is on its' last legs.
Do this as root:
yum -y install smartmontools
/sbin/service smartd start
/sbin/chkconfig smartd on
smartctl --test=long /dev/hda (I'm assuming the drive is hda, change appropriately)
it'll tell you how long the test will take (don't worry it can run on a live system)
finally run:
smartctl -a /dev/hda

and see what it has to say about your drive.

Btw, I think it's a good idea to run the diagnostic program designed for the drive... they're able to map out the bad sectors with reserved ones that most drives have these days. Seagate has seatools, maxtor has powermax, etc.. these are free to download from the manufacturers web sites. Note that data on any bad sector will be lost forever, so best to run some type of backup if possible.

Finally, after that, run fsck again. I had problems with a Maxtor drive that was doing the same thing as your drive is now... I think the drive was overheating, which caused the failure to happen sooner than later. Drives today really need to have some type of active cooling.


No error.. everything is ok.. and, its a brand new drive (2 week old)

tredegar 09-18-2006 10:33 AM

froussy,
Quote from your original post:
Quote:

mv: cannot create regular file `/mnt/320gig/misc/xxxxxxxx': Read-only file system (xxx is a filename)
...So this looks like it is a permissions problem.

To help you, we need to know what sort of filesystem you have on the disk, the command used to mount the disk, and the output of ls -l /mnt/320gig

generic_user 09-18-2006 10:57 AM

Quote:

Originally Posted by tredegar
...So this looks like it is a permissions problem.
]

note that ext3fs will remount as read-only when problems occur. This happened to that drive I had mentioned was dieing. Must be a safety thing.

Of course, it could still be a permission thing. :)

haertig 09-18-2006 12:47 PM

Quote:

Originally Posted by generic_user
note that ext3fs will remount as read-only when problems occur.

Always? Or just when you tell it to? Check /etc/fstab. The only remounting I'd expect on my system would be for / , because of the following specific fstab entry:
Code:

dev/sda7  /  ext3  defaults,errors=remount-ro  0  1
I would check your syslog for any problems relating to disk, and also post your /etc/fstab here. Also, try the file move as root and report what happens. Your example fsck command indicates you're running as root (duh!), but you really didn't say about the actual mv command. This all could be a simple mount/permissions issue. But if you're triggering some fstab "errors=remount-ro" then it leans more towards filesystem corruption of hardware problems.

generic_user 09-18-2006 01:13 PM

Quote:

Originally Posted by haertig
Always? Or just when you tell it to?

In my case once the system detected a filesystem error, it went directly to read only mode automatically. Nothing to do with fstab. Probably designed in to stop errors from cascading out of control (much like a kernel panic)

froussy 09-18-2006 11:45 PM

Ok, there is few answer:

Quote:

...So this looks like it is a permissions problem.

To help you, we need to know what sort of filesystem you have on the disk, the command used to mount the disk, and the output of ls -l /mnt/320gig
Filesystem is EXT3

Code:

[root@trinity ~]# ls -l /mnt/320gig/
total 32
drwx------  2 root root 16384 Sep  8 11:37 lost+found
drwxr-xr-x 633 root root 16384 Sep 18 11:07 mp3
[root@trinity ~]#

Code:

[root@trinity ~]# cat /etc/fstab
LABEL=/                /                      ext3    defaults        1 1
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
tmpfs                  /dev/shm                tmpfs  defaults        0 0
LABEL=/mnt/200gig      /mnt/200gig            ext3    defaults        1 2
LABEL=/mnt/320gig      /mnt/320gig            ext3    defaults        1 2
LABEL=/mnt/users        /mnt/users              ext3    defaults        1 2
proc                    /proc                  proc    defaults        0 0
sysfs                  /sys                    sysfs  defaults        0 0
LABEL=SWAP-hda3        swap                    swap    defaults        0 0
[root@trinity ~]#

Code:

[root@trinity ~]# cat /etc/fstab
LABEL=/                /                      ext3    defaults        1 1
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
tmpfs                  /dev/shm                tmpfs  defaults        0 0
LABEL=/mnt/200gig      /mnt/200gig            ext3    defaults        1 2
LABEL=/mnt/320gig      /mnt/320gig            ext3    defaults        1 2
LABEL=/mnt/users        /mnt/users              ext3    defaults        1 2
proc                    /proc                  proc    defaults        0 0
sysfs                  /sys                    sysfs  defaults        0 0
LABEL=SWAP-hda3        swap                    swap    defaults        0 0
[root@trinity ~]#

When I had the problem, i was on a samba share (from a Win machine)..
then, i looked on the box, as root, and moving or deleting file was impossible on that drive

Lenard 09-19-2006 08:06 AM

Why do you have two entries in fstab for the partition??

Code:

LABEL=/mnt/200gig      /mnt/200gig            ext3    defaults        1 2
LABEL=/mnt/320gig      /mnt/320gig            ext3    defaults        1 2

And since others will be accessing this partition for read/write access (I assume) it might be better to use something like;

Code:

LABEL=/mnt/200gig      /mnt/200gig            ext3    exec,group,rw        1 2

trickykid 09-19-2006 11:08 AM

In my experience, when a mounted drive suddenly becomes a "read-only" filesystem, it's of two things in most cases but not all. a) it's a controller issue, not a drive or b) it's an outdated or corrupt driver if you're using a raid controller or external card to connect this drive to, etc.

But stop running fsck on the drive, your probably wasting your time. Try unmounting and remounting, if you can write to it, I would suggest looking into what I just pointed out.

generic_user 09-19-2006 11:51 PM

Quote:

Originally Posted by trickykid
In my experience, when a mounted drive suddenly becomes a "read-only" filesystem, it's of two things in most cases but not all. a) it's a controller issue, not a drive or b) it's an outdated or corrupt driver if you're using a raid controller or external card to connect this drive to, etc.

But stop running fsck on the drive, your probably wasting your time. Try unmounting and remounting, if you can write to it, I would suggest looking into what I just pointed out.

If he ran tests on the drive and they came up clean, you'd have to rule out the controller as well. (This is a assuming he actually ran the diagnostic disc from the drive manufacturer like I had asked him to).

The only thing left would be software, so it's very likely it is a driver problem.

Froussy, can you post the output of smartctl -a /dev/hd? where ? is the drive that continously gets corrupted?

froussy 09-21-2006 12:12 AM

Quote:

Originally Posted by generic_user
If he ran tests on the drive and they came up clean, you'd have to rule out the controller as well. (This is a assuming he actually ran the diagnostic disc from the drive manufacturer like I had asked him to).

The only thing left would be software, so it's very likely it is a driver problem.

Froussy, can you post the output of smartctl -a /dev/hd? where ? is the drive that continously gets corrupted?

I dont think it will be a driver problem, because it should happen on my others drives, No?

There is the output as requested:

Quote:

[root@trinity ~]# smartctl -a /dev/hdg1
smartctl version 5.36 [i686-redhat-linux-gnu] Copyright (C) 2002-6 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF INFORMATION SECTION ===
Device Model: ST3320620A
Serial Number: 4QF00M2X
Firmware Version: 3.AAC
User Capacity: 320,072,933,376 bytes
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: 7
ATA Standard is: Exact ATA specification draft version not indicated
Local Time is: Thu Sep 21 01:09:17 2006 EDT
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status: (0x82) Offline data collection activity
was completed without error.
Auto Offline Data Collection: Enabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: ( 430) seconds.
Offline data collection
capabilities: (0x5b) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Suspend Offline collection upon new
command.
Offline surface scan supported.
Self-test supported.
No Conveyance Self-test supported.
Selective Self-test supported.
SMART capabilities: (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time: ( 1) minutes.
Extended self-test routine
recommended polling time: ( 115) minutes.

SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000f 117 092 006 Pre-fail Always - 128254020
3 Spin_Up_Time 0x0003 097 097 000 Pre-fail Always - 0
4 Start_Stop_Count 0x0032 100 100 020 Old_age Always - 4
5 Reallocated_Sector_Ct 0x0033 100 100 036 Pre-fail Always - 0
7 Seek_Error_Rate 0x000f 072 060 030 Pre-fail Always - 17214158
9 Power_On_Hours 0x0032 100 100 000 Old_age Always - 264
10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0
12 Power_Cycle_Count 0x0032 100 100 020 Old_age Always - 6
187 Unknown_Attribute 0x0032 100 100 000 Old_age Always - 0
189 Unknown_Attribute 0x003a 100 100 000 Old_age Always - 0
190 Unknown_Attribute 0x0022 063 058 045 Old_age Always - 706871333
194 Temperature_Celsius 0x0022 037 042 000 Old_age Always - 37 (Lifetime Min/Max 0/31)
195 Hardware_ECC_Recovered 0x001a 060 057 000 Old_age Always - 152183771
197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always - 0
200 Multi_Zone_Error_Rate 0x0000 100 253 000 Old_age Offline - 0
202 TA_Increase_Count 0x0032 100 253 000 Old_age Always - 0

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Extended offline Completed without error 00% 208 -

SMART Selective self-test log data structure revision number 1
SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
1 0 0 Not_testing
2 0 0 Not_testing
3 0 0 Not_testing
4 0 0 Not_testing
5 0 0 Not_testing
Selective self-test flags (0x0):
After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.


All times are GMT -5. The time now is 05:59 PM.