Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Having some problems with on of my harddrives, a 500gb samsung. I have to fsck almost everytime I boot. smartctl tells me the hd is healthy, badblocks returns no errors. I've run samsungs hd tool on the hd and it didnt find any errors. Is there some known bug in ext4 or something else that would cause this?
It's possible it's not unmounting cleanly, but I have one really stupid idea worth looking at real quicklike. Run `tune2fs -l` on the partition in question and look for the line that says 'Maximum mount count:'. That's the number of mounts you're allowed before the system will force a fsck, and if yours is 1 or 2... like I said, stupid idea.
tune2fs 1.41.8 (11-July-2009)
Filesystem volume name: <none>
Last mounted on: <not available>
Filesystem UUID: 5906182a-0fe1-46fb-b2f5-6d409d26bebd
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
Filesystem flags: signed_directory_hash
Default mount options: (none)
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 2444624
Block count: 9765511
Reserved block count: 488275
Free blocks: 7914790
Free inodes: 2107743
First block: 0
Block size: 4096
Fragment size: 4096
Reserved GDT blocks: 1021
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 8176
Inode blocks per group: 511
Flex block group size: 16
Filesystem created: Sat Aug 8 02:41:28 2009
Last mount time: Fri Aug 21 07:39:39 2009
Last write time: Fri Aug 21 07:39:39 2009
Mount count: 2
Maximum mount count: 32
Last checked: Fri Aug 21 06:43:01 2009
Check interval: 15552000 (6 months)
Next check after: Wed Feb 17 05:43:01 2010
Lifetime writes: 8 GB
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 256
Required extra isize: 28
Desired extra isize: 28
Journal inode: 8
First orphan inode: 267504
Default directory hash: half_md4
Directory Hash Seed: e94ea8bf-4ff3-419e-8d4a-289e169948ba
Journal backup: inode blocks
When I run fsck it finds errors and repairs them. In /lost+found theres 4 files with some of the content of fstab. Just ran badblocks again found 0 badblocks.
Not sure where to go from here. Can you think of any reason why your shutdowns wouldn't be going as expected? One diagnostic you could try if you can afford to - don't do anything important in combination with this - is to change the on-error behavior (`man tune2fs`) and see if it's happening while the system's up. That's potentially dangerous, though, so think about it a lot before trying it.
You had better believe fsck, and it is telling you that there is a problem.
If badblocks says you are OK, I would be trying something more basic, like spinrite. I also would be considering replacing the cable to the drive, and I would be taking a look at the voltages applied to the drive to make sure they are in spec. I also would be looking for dust bunnies, or a bent connector pin, or anything else that could cause an intermittent malfunction or data error.
You didn't specify the interface, but I'm guessing SATA. Does the drive have error logging? What does that say? You access it with the smartctl -a command. Does the drive have a self-test mode? Try that too.
Is your controller on the motherboard, or a plugin?
Actually, truth is that in your position I'd have spinrite running that drive in a heartbeat. However spinrite costs $89 and because of that many people don't want to use it. Personally I found it to be money well spent.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.