DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 6th November 2010
guitarscn guitarscn is offline
Package Pilot
 
Join Date: Oct 2008
Posts: 166
Thanked 1 Time in 1 Post
Default I failed very badly with fsck

Okay, so I mounted my ext3 external hard drive on OpenBSD (as mount_ext2fs) with the intention to transfer some files over to my new home. It told me to run fsck, so I unmounted it and ran fsck_ext2fs with the -p option, but it ran into some unallocated inodes or something (a few million of them, lol) so I just ran with -y and it was taking a while so I went to watch some TV and went out for dinner.

So I come back, and the fsck is all done...and half my files are gone. I checked back the terminal logs and saw that it removed files for some reason. Oh my goodness I wish I made backups of backups...why did I do that? I'm so dumb

Some very important files were deleted, but I hope I can learn from this huge loss.
Reply With Quote
  #2   (View Single Post)  
Old 6th November 2010
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

You really should have ran fsck on a Linux machine, it probably wasn't unmounted properly the last time you used it.

Running OpenBSD's fsck_ext2 implementation, especially on a ext3 file system.. was really the worst thing you could have done, obviously fsck meddles with critical filesystem metadata and you had no idea how it would react to it.

The files may be there, but if the metadata was corrupted then it'll be difficult to find them.. if the "inodes" for a ext3 filesystem are removed (..unlinked) then there is nothing pointing to the physical blocks that make up the file, it's practically impossible to recover the files.

Some recovery programs can scan media for known filetype signatures, filenames would be lost.. as would permissions.. file sizes.. basically you messed up big time.

If you want to hold onto hope of recovery, unmount the drive and don't copy anything to it.. otherwise you risk overwriting the blocks they reside in (..some may have already been by fsck).

Here is some guide, for possibly recovering some of it.. but.. it's probably not going to be easy.

http://www.xs4all.nl/~carlo17/howto/undelete_ext3.html
Reply With Quote
  #3   (View Single Post)  
Old 6th November 2010
guitarscn guitarscn is offline
Package Pilot
 
Join Date: Oct 2008
Posts: 166
Thanked 1 Time in 1 Post
Default

Ugh...I didn't know. I knew I probably should've studied more about hardware before doing something like this. I didn't know it was that serious, I just thought it was similar to defragmenting and just cleaning up the drive.
Reply With Quote
  #4   (View Single Post)  
Old 6th November 2010
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

(EDIT: Someone trolled this topic, it was cleaned up by moderators.)

That is called a forum signature, the fsck tool is not a filesystem defragmentor.. an improperly unmounted filesystem is left in an inconsistent state and isn't marked as "safe" to mount the next time.

The ext3 filesystem is mostly compatible except for the addition of journaling and some other features, but not completely, the fsck_ext2fs(8) tool is probably only safely usable on ext2 filesystems.. even then this is a foreign filesystem.

Many of us are aware of your previous antics on the OpenBSD mailing list "bsdmaster", it's hardly productive.

The OP has lost files, certainly it's not his fault.. but he could have forced mounted this alien filesystem read-only instead of risking fsck, and in non-interactive, and not entirely comprehending the error messages he was seeing.

Last edited by BSDfan666; 6th November 2010 at 04:11 AM.
Reply With Quote
  #5   (View Single Post)  
Old 9th November 2010
passthejoe passthejoe is offline
Real Name: Steven
Port Guard
 
Join Date: Oct 2010
Location: Los Angeles
Posts: 30
Thanked 2 Times in 2 Posts
Default

I used to dual-boot Linux and OpenBSD, which is indeed very good at pointing out errors in Linux filesystems. But I always used Linux's fsck to repair the ext2/ext3 filesystems and had very good luck with it.

Even now when I run OpenBSD (and generally don't dual-boot because it's more trouble than it's worth), I often make backups to a Linux ext2 filesystem so I have an easier time of transferring the files to a Linux box.
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Uncompress failed. delboy FreeBSD Ports and Packages 2 9th February 2010 12:58 PM
Ok, i've tried but failed. Damn birdmansdomain OpenBSD Security 28 23rd July 2009 07:50 AM
mdmfs and fsck on boot elon FreeBSD General 0 8th December 2008 06:33 PM
fsck reports errors but does not fix them. map7 FreeBSD General 13 2nd December 2008 10:45 PM
Disable manual fsck on startup Malakim FreeBSD General 4 2nd September 2008 05:28 PM


All times are GMT. The time now is 05:42 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick