Skip to content


Solving system error -3009 when formatting hard drive (Yast, OpenSUSE)

I got this “-3009” error when trying to install OpenSUSE on a fairly old laptop. The error occurred when formatting the partition, at the beginning of the (actual) installation procedure. I previously had a “-3008” error, which clearly stated that was because I mounted the partition (I used the liveCD and browsed around a bit before launching the installation), so I first thought this might be connected somehow. But the error even occur while running the installation procedure without loading the liveCD desktop.

Unfortunately, no indication is given apart from the error number. And searching for it with duckduckgo basically returned only this 4 year old thread, suggesting an issue related to the partition system in use (you know, MBR vs GPT or something). Anyway, in my case that wasn’t the issue. It turned out the hard drive had issues: a bunch of undetected badblocks. Luckily, the post I found and the fact that the error occurred during formatting, combined with the fact that the previous OS installed on this laptop (Ubuntu) was last seen failing to boot with a hard-drive related error directly oriented me to this. However, there remained the question of how to fix the drive.

I found those 3 posts dealing with the subject:
The Beginner’s Guide to Linux Disk Utilities
Forcing a hard disk to reallocate bad sectors
How to securely keep a hard drive with bad blocks in a raid array

They present a lot of different approaches, not always very clearly explained, and notably not clearly stating the differences between the approaches. Feel free to browse them if you need to try more stuff. Personally, I first tried a combination of badblocks and fsck: badblocks to generate a list of faulty sectors, and fsck to mark them as faulty. I’m not sure it really worked, because some of the blocks detected by badblocks were reported as out of range by fsck. Nonetheless those are the commands I used to do it, as far as I remember (I think the second one needed some tweaking, but I don’t remember it :/):
sudo badblocks /dev/sda5 > /path/to/list_of_bad_blocks
sudo fsck.ext4 -C 0 -l /path/to/list_of_bad_blocks -y /dev/sda4

NB: before you do this, make sure the partition you’re checking is unmounted: ummout /dev/sda4
NB2: don’t forget to replace file names, drive names and partition number by yours
NB3: the partition of interest was previously formatted as ext4. I think it should work on ext2 and ext3, but I’m not sure about other types such as NTFS.

Since this gave me a few error messages about out of range sectors, I assumed it missed and directly decided to try another method. Fsck is supposed to be able to both check and repair, only somehow the man page and –help aren’t very useful about it. Luckily, when trying one of the commands mentioned in the above-linked posts, I eventually reached a more helpful help page. The argument to check a partition with fsck is simply “-c”. Giving something like:
sudo fsck -c -t ext4 /dev/sda4
NB: again, I did some more tweaking (notably, I believe there’s an option to automatically fix errors without user input), but I forgot it :/

Well, that’s it. After that the partition was good enough to be formatted and have OpenSUSE 13.1 installed without issues. Sorry for the lack of precision in the commands, that was like a week ago and I didn’t expect to recall those details so poorly after so little time… (and the commands can’t be found in my history since I used them all from the LiveCD) Anyway, I still hope you’ll find them helpful 🙂

Posted in hardware, Linux.


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.

Sorry about the CAPTCHA that requires JS. If you really don't want to enable JS and still want to comment, you can send me your comment via e-mail and I'll post it for you.

Please solve the CAPTCHA below in order to fight spamWordPress CAPTCHA