LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-23-2005, 08:35 PM   #1
time112852
Member
 
Registered: Aug 2003
Location: Pennsylvania, USA
Distribution: Gentoo 2.6.30
Posts: 92

Rep: Reputation: 15
ext2 filesystem errors


Ok this might be a question, but i logged into my slack 10.1 server and when i tried to mount my second hard drive (primary hdd is 40gb, secondary is 160gb..backup hard drive) i got this error:

Code:
root@slackserv:/mnt# mount -t ext2 /dev/hdb1 /mnt/hdb
mount: wrong fs type, bad option, bad superblock on /dev/hdb1,
       missing codepage or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so
so i said..alright..i'll do e2fsck..i did and i keep getting this error:

Code:
root@slackserv:/mnt# e2fsck /dev/hdb1
e2fsck 1.35 (28-Feb-2004)
/dev/hdb1 contains a file system with errors, check forced.
Error reading block 13 (Attempt to read block from filesystem resulted in short read).  Ignore error<y>?
Does this mean that all of my data got lost on my filesystem? I'm pretty sure the reason this came up was because my roommate went to take the server home and didn't shut the server down properly. Are those errors really bad? Thanks.
 
Old 12-23-2005, 09:36 PM   #2
Tuttle
Senior Member
 
Registered: Jul 2003
Location: Wellington, NZ
Distribution: mainly slackware
Posts: 1,291

Rep: Reputation: 52
I would try a manual fsck of /dev/hdb1 (as root):
Code:
fsck dev/hdb1
and see if the manual method is required to complete a repair on the filesystem.
 
Old 12-23-2005, 10:28 PM   #3
time112852
Member
 
Registered: Aug 2003
Location: Pennsylvania, USA
Distribution: Gentoo 2.6.30
Posts: 92

Original Poster
Rep: Reputation: 15
what is the difference between fsck and e2fsck? i thought it was the same thing but made for a specific filesystem..
 
Old 12-24-2005, 01:25 AM   #4
chadwick
Member
 
Registered: Apr 2005
Location: At the 100th Meridian where the great plains begin
Distribution: Debian Testing on T60 laptop
Posts: 105

Rep: Reputation: 17
Did you let fsck finish running through it? Maybe all it needs is to run through it once or twice and then it'll be fixed. I usually just do something like

e2fsck -fp /dev/hdb1
or
e2fsck -fy /dev/hdb1
or
e2fsck -fcy /dev/hdb1
etc.

Then you don't have to bother with answering all the time to what it's asking. As far as I know this has not caused harm to my system . I usually just put my faith in the people that write those things since they seem to be pretty smart and definitely know more about it than I do.
I don't know if your error's bad, but one way to find out would be to let fsck finish, unless you have already done so.

fsck is a front-end for your specific file system checker. The checker for ext2fs or ext3fs is e2fsck. See man pages for fsck and for e2fsck.
 
Old 12-24-2005, 08:37 AM   #5
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
I like to add the -C parameter as well. That will tell fsck or e2fsck to print progress messages and a progress "meter". Don't get discouraged if the progress appears to stall from time to time. When I fsck my 60GB ext2 partition it stops for about 5 minutes several times in the process. The 60Gb partition is encrypted and it takes 40 minutes to do an fsck.

If you want to know the status of an ext2 partition/file system you can use the tune2fs command with the -l parameter as follows:

tune2fs -l /dev/hda1

This will give you a lot of information. You should look for a line labeled "Filesystem state". It will tell you if the file system needs to be checked. If the file system state is clean then it doesn't need to be checked. If the tune2fs command gives you an error then you may have another type of file system or the ext2/ext3 filesystem is corrupt.

Last edited by stress_junkie; 12-24-2005 at 08:41 AM.
 
Old 12-24-2005, 12:36 PM   #6
time112852
Member
 
Registered: Aug 2003
Location: Pennsylvania, USA
Distribution: Gentoo 2.6.30
Posts: 92

Original Poster
Rep: Reputation: 15
i just went through and did a e2fsck -y /dev/hdb1 and now every single file is in lost+found. What do I do now if I want to have it back to the way it was?
 
Old 12-24-2005, 12:47 PM   #7
Tuttle
Senior Member
 
Registered: Jul 2003
Location: Wellington, NZ
Distribution: mainly slackware
Posts: 1,291

Rep: Reputation: 52
hmm, well it's repaired as best it could so I would suggest a reboot (to umount and mount the drive again, just in case), then move all the files back to where they were if you can remember that is!
Remember: in unix a file is a file, simple as that!
 
Old 12-24-2005, 02:41 PM   #8
time112852
Member
 
Registered: Aug 2003
Location: Pennsylvania, USA
Distribution: Gentoo 2.6.30
Posts: 92

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Tuttle
hmm, well it's repaired as best it could so I would suggest a reboot (to umount and mount the drive again, just in case), then move all the files back to where they were if you can remember that is!
Remember: in unix a file is a file, simple as that!

Yeah I did do a reboot...its all still there in lost+found. I have like 86gb of stuff...this is going to suck

This is going to sound like a stupid question and i'm not saying windows is better, but how come when you don't properly shut down a windows machine the filesystem doesn't seem to get screwed up but after one time of not properly shutting my linux machine down the whole drive got f*#cked up?
 
Old 12-24-2005, 03:05 PM   #9
Tuttle
Senior Member
 
Registered: Jul 2003
Location: Wellington, NZ
Distribution: mainly slackware
Posts: 1,291

Rep: Reputation: 52
Just bad luck I suppose, I've lost stuff on vfat, ntfs, ext2 and ufs before.
I've never lost anything on reiser before, maybe try that.

edit: Actually the best answer to that is..... BACKUP YOUR DATA!!
Merry commercial gains season

Last edited by Tuttle; 12-24-2005 at 03:10 PM.
 
Old 12-24-2005, 03:46 PM   #10
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
I've had my computers subjected to sudden power failure on many occassions. I don't believe that I've ever lost a file from it.
 
Old 12-24-2005, 03:51 PM   #11
arckane
Member
 
Registered: Sep 2005
Location: UK
Distribution: Gentoo/Debian/Ubuntu
Posts: 308

Rep: Reputation: 39
I've had a bad experience with ext2/3 on a couple of occasions. I have now settled on ReiserFS and not had an issue. This includes a powercut while encoding.

The other issue could well be that your second drive is on it's way out. Do a check just to be on the safe side.
 
Old 12-24-2005, 06:38 PM   #12
time112852
Member
 
Registered: Aug 2003
Location: Pennsylvania, USA
Distribution: Gentoo 2.6.30
Posts: 92

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Tuttle
Just bad luck I suppose, I've lost stuff on vfat, ntfs, ext2 and ufs before.
I've never lost anything on reiser before, maybe try that.

edit: Actually the best answer to that is..... BACKUP YOUR DATA!!
Merry commercial gains season
Actually..that was my network backup drive for my windows machine. I was thinking a linux filesystem would be safe enough for my files. I dont think the drive is going out though. It's fairly new.

It seems like after a power failure or after an improper shutdown, i always get some sort of error after the power comes back on a ext2 filesystem. I don't mean just on this machine..on any machine i've had linux on with an ext2 filesystem. I have used reiserfs in the past and maybe i'll use that again because i remember not having that many problems that i have had with ext2. It just seems like I would have to run fsck every time i boot with a ext2 filesystem...or run it at least twice a day just to make sure my filesystem isnt dieing.

Yes I have lost data using fat32 and ntfs before. My one friend used disk defragmenter in windows xp on his raid 0 array and his computer blue screened and he lost data. I've seen it happen on windows filesystems..so i know it happens, but I haven't had this machine up for more than like 3-4 months and have this happen..it sucks.
 
Old 12-25-2005, 05:51 PM   #13
Tuttle
Senior Member
 
Registered: Jul 2003
Location: Wellington, NZ
Distribution: mainly slackware
Posts: 1,291

Rep: Reputation: 52
It do suck - lots sry I didn't realise it was a backup. Reiser is definitely more robust though, or even ext3 as it basically adds journaling to the ext2 fs. If you want something really hardcore go for xfs or jfs, there's plenty of documentation out there for your pleasure. Good luck in the future.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ext2 Filesystem Problem DrWorm Linux - General 11 06-02-2005 03:02 PM
ext3\ext2 filesystem amjad Linux - General 1 05-23-2005 04:51 AM
Red ext2 filesystem under windows2000 zahoo Linux - General 2 03-18-2005 08:23 PM
About ext2 filesystem creation 7ux_spirit Linux - Newbie 1 04-30-2004 02:23 PM
Ext2 Filesystem in RAM Fernando Linux - General 0 03-21-2002 02:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration