LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 10-13-2007, 03:36 PM   #1
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Rep: Reputation: 44
SATA drive can't see files after power failure


Long story short. I lost power to a SATA drive connected via a USB cable while I was moving files from my PC to the drive. Ever since I have been having a hard time getting the data off of it. I ended up getting a new PC that has SATA connectors on the MB so I connected the drive directly to the MB instead of its USB enclosure. It took me a while to finally get it to mount but I can't find any files on it.


Slackware 10.2 kernel 2.6.13


At one point when I was trying to mount it I was getting the "bad super block" error and it wouldn't mount.



When I do a df -h it shows there should be 5gb of data on it



# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda1 37G 21G 15G 60% /
/dev/sda1 466G 5.6G 460G 2% /mnt/sata

when I go to /mnt/sata and do a ls -alR it just shows the directory

# ls -laR
.:
total 52
drwxr-xr-x 3 root root 16384 1969-12-31 19:00 ./
drwxr-xr-x 18 root root 4096 2007-10-13 12:46 ../
-rwxr-xr-x 1 root root 350 2007-03-04 16:02 fstab*
drwxr-xr-x 0 root root 16384 2007-06-29 15:22 hda3/

./hda3:
total 48
drwxr-xr-x 0 root root 16384 2007-06-29 15:22 ./
drwxr-xr-x 3 root root 16384 1969-12-31 19:00 ../
drwxr-xr-x 0 root root 16384 2007-06-29 15:40 audio/

./hda3/audio:
total 0


I had to manually load these modules

aic79xx
ata_piix




from fdisk /dev/sda


Expert command (m for help): p

Disk /dev/sda: 255 heads, 63 sectors, 60801 cylinders

Nr AF Hd Sec Cyl Hd Sec Cyl Start Size ID
1 80 1 1 0 254 63 1023 63 976768002 0c
2 00 0 0 0 0 0 0 0 0 00
3 00 0 0 0 0 0 0 0 0 00
4 00 0 0 0 0 0 0 0 0 00


dmesg

Vendor: ATA Model: ST3500841AS Rev: 3.AA
Type: Direct-Access ANSI SCSI revision: 05
SCSI device sda: 976773168 512-byte hdwr sectors (500108 MB)
SCSI device sda: drive cache: write back
SCSI device sda: 976773168 512-byte hdwr sectors (500108 MB)
SCSI device sda: drive cache: write back
sda: sda1
Attached scsi disk sda at scsi2, channel 0, id 1, lun 0



There were pages of errors when I tried to mount it. I can post all that if anyone wants. Didn't want to clutter up the thread with several pages of that.
 
Old 10-13-2007, 04:17 PM   #2
bsdunix
Senior Member
 
Registered: May 2006
Distribution: BeOS, BSD, Caldera, CTOS, Debian, LFS, Mac, Mandrake, Red Hat, Slackware, Solaris, SuSE
Posts: 1,761

Rep: Reputation: 80
I don't know if there's a way to repair the filesystem information so you can mount and read the drive contents natively. I found a data recovery software that reads ext2 and ext3 formated disks. Of course it will only read what it can find, and the data string might not be complete. There's a demo version that will only read the drive so it will give you an idea of your recovery chances, the paid version will recovery the readable data.

http://www.stellarinfo.com/linux-data-recovery.htm
http://www.stellarinfo.com/esupport/...ory_id=0&sid2=

I've used a similar product recovering data on NTFS formated disks.

Maybe someone else will have a better idea.

Last edited by bsdunix; 10-13-2007 at 04:19 PM.
 
Old 10-14-2007, 04:10 PM   #3
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Original Poster
Rep: Reputation: 44
Thanks for the reply. I'll look into that but if it doesnt do vfat recovery I dont think it will help me.


more info:

du -h
from /mnt/sata:

16K ./hda3/audio
32K ./hda3
64K .


# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda1 37G 27G 8.4G 77% /
/dev/sda1 466G 5.6G 460G 2% /mnt/sata




Anyone know why it shows )df -h)Used 5.6GB but when I do a df -h on /mnt/sata it shows only 64k...



Would it be ok to run a file system check on it? using fsck.vfat ?




EDIT

I unmounted the drive and ran fdisk -l and got this.

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sda doesn't contain a valid partition table

Last edited by ncsuapex; 10-14-2007 at 04:23 PM. Reason: .
 
Old 10-27-2007, 01:43 PM   #4
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Original Poster
Rep: Reputation: 44
need some advice before I do anything further.


I found this command from someone who had a similar problem except his problem was with a 512mb usb thumb drive.


dd if=/dev/sda of=/tmp/r1 bs=512


my question is, for the "bs=512" that means it's forcing the byte size to be 512.. Now my sata drive is 500GB but only has 5GB of data on it. what would I need to set my "bs=" to?


Also, would running "fsck -t vfat /dev/sda" hurt to try?
 
Old 10-27-2007, 02:45 PM   #5
farkus888
Member
 
Registered: Oct 2006
Distribution: usually use arch
Posts: 103

Rep: Reputation: 15
fsck'ing the files system on the drive should work for a bad superblock. you may also want to consider trying testdisk, which I have used to recover deleted partition tables before. personally I would start with fsck for a bad superblock and move on to testdisk if fsck doesn't work.
 
Old 10-27-2007, 07:16 PM   #6
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Original Poster
Rep: Reputation: 44
dosfsck /dev/sda
dosfsck 2.10, 22 Sep 2003, FAT32, LFN
Read 512 bytes at 0:Input/output error

Although fdisk -l took a few minutes to respond it came back without any mention of the sata drive



I noticed a ton of errors in dmesg


ata1: SATA max UDMA/133 cmd 0x20C8 ctl 0x20EE bmdma 0x20A0 irq 11
ata2: SATA max UDMA/133 cmd 0x20C0 ctl 0x20EA bmdma 0x20A8 irq 11
ata1: dev 1 cfg 49:2f00 82:346b 83:7d01 84:4023 85:3469 86:3c01 87:4023 88:007f
ata1: dev 1 ATA, max UDMA/133, 976773168 sectors: lba48
ata1: dev 1 configured for UDMA/133
scsi4 : ata_piix
ATA: abnormal status 0x7F on port 0x20C7
ata2: disabling port
scsi5 : ata_piix
Vendor: ATA Model: ST3500841AS Rev: 3.AA
Type: Direct-Access ANSI SCSI revision: 05
SCSI device sda: 976773168 512-byte hdwr sectors (500108 MB)
SCSI device sda: drive cache: write back
SCSI device sda: 976773168 512-byte hdwr sectors (500108 MB)
SCSI device sda: drive cache: write back
sda: sda1
Attached scsi disk sda at scsi4, channel 0, id 1, lun 0
ata1: command 0x25 timeout, stat 0xd0 host_stat 0x41
ata1: status=0xd0 { Busy }
SCSI error : <4 0 1 0> return code = 0x8000002
sda: Current: sense key=0xb
ASC=0x47 ASCQ=0x0
end_request: I/O error, dev sda, sector 0
Buffer I/O error on device sda, logical block 0
ATA: abnormal status 0xD0 on port 0x20CF
ATA: abnormal status 0xD0 on port 0x20CF
ATA: abnormal status 0xD0 on port 0x20CF
ata1: command 0x25 timeout, stat 0xd0 host_stat 0x41
ata1: status=0xd0 { Busy }
SCSI error : <4 0 1 0> return code = 0x8000002
sda: Current: sense key=0xb
ASC=0x47 ASCQ=0x0
end_request: I/O error, dev sda, sector 8
Buffer I/O error on device sda, logical block 1
ATA: abnormal status 0xD0 on port 0x20CF
ATA: abnormal status 0xD0 on port 0x20CF
ATA: abnormal status 0xD0 on port 0x20CF
ata1: command 0x25 timeout, stat 0xd0 host_stat 0x41
ata1: status=0xd0 { Busy }
SCSI error : <4 0 1 0> return code = 0x8000002
sda: Current: sense key=0xb
ASC=0x47 ASCQ=0x0
end_request: I/O error, dev sda, sector 16
Buffer I/O error on device sda, logical block 2
ATA: abnormal status 0xD0 on port 0x20CF
ATA: abnormal status 0xD0 on port 0x20CF
ATA: abnormal status 0xD0 on port 0x20CF
ata1: command 0x25 timeout, stat 0xd0 host_stat 0x40
ata1: status=0xd0 { Busy }
SCSI error : <4 0 1 0> return code = 0x8000002
sda: Current: sense key=0xb
ASC=0x47 ASCQ=0x0
end_request: I/O error, dev sda, sector 24
Buffer I/O error on device sda, logical block 3
ATA: abnormal status 0xD0 on port 0x20CF
ATA: abnormal status 0xD0 on port 0x20CF
ATA: abnormal status 0xD0 on port 0x20CF
ata1: status=0x51 { DriveReady SeekComplete Error }
ata1: error=0x84 { DriveStatusError BadCRC }
ata1: command 0x25 timeout, stat 0xd0 host_stat 0x41
ata1: status=0xd0 { Busy }
SCSI error : <4 0 1 0> return code = 0x8000002
sda: Current: sense key=0xb
ASC=0x47 ASCQ=0x0
end_request: I/O error, dev sda, sector 16
Buffer I/O error on device sda, logical block 2
ATA: abnormal status 0xD0 on port 0x20CF
ATA: abnormal status 0xD0 on port 0x20CF
ATA: abnormal status 0xD0 on port 0x20CF
ata1: command 0x25 timeout, stat 0xd0 host_stat 0x41
ata1: status=0xd0 { Busy }
SCSI error : <4 0 1 0> return code = 0x8000002
sda: Current: sense key=0xb
ASC=0x47 ASCQ=0x0
end_request: I/O error, dev sda, sector 16
Buffer I/O error on device sda, logical block 2
ATA: abnormal status 0xD0 on port 0x20CF
ATA: abnormal status 0xD0 on port 0x20CF
ATA: abnormal status 0xD0 on port 0x20CF
ata1: command 0x25 timeout, stat 0xd0 host_stat 0x41
ata1: status=0xd0 { Busy }
SCSI error : <4 0 1 0> return code = 0x8000002
sda: Current: sense key=0xb
ASC=0x47 ASCQ=0x0
end_request: I/O error, dev sda, sector 24
Buffer I/O error on device sda, logical block 3
ATA: abnormal status 0xD0 on port 0x20CF
ATA: abnormal status 0xD0 on port 0x20CF
ATA: abnormal status 0xD0 on port 0x20CF
ata1: command 0x25 timeout, stat 0xd0 host_stat 0x40
ata1: status=0xd0 { Busy }
SCSI error : <4 0 1 0> return code = 0x8000002
sda: Current: sense key=0xb
ASC=0x47 ASCQ=0x0
end_request: I/O error, dev sda, sector 32
Buffer I/O error on device sda, logical block 4
ATA: abnormal status 0xD0 on port 0x20CF
ATA: abnormal status 0xD0 on port 0x20CF
ATA: abnormal status 0xD0 on port 0x20CF
ata1: status=0x51 { DriveReady SeekComplete Error }
ata1: error=0x84 { DriveStatusError BadCRC }
ata1: command 0x25 timeout, stat 0xd0 host_stat 0x41
ata1: status=0xd0 { Busy }
SCSI error : <4 0 1 0> return code = 0x8000002
sda: Current: sense key=0xb
ASC=0x47 ASCQ=0x0
end_request: I/O error, dev sda, sector 976772992
Buffer I/O error on device sda, logical block 122096624
ATA: abnormal status 0xD0 on port 0x20CF
ATA: abnormal status 0xD0 on port 0x20CF
ATA: abnormal status 0xD0 on port 0x20CF
ata1: command 0x25 timeout, stat 0xd0 host_stat 0x41
ata1: status=0xd0 { Busy }
SCSI error : <4 0 1 0> return code = 0x8000002
sda: Current: sense key=0xb
ASC=0x47 ASCQ=0x0
end_request: I/O error, dev sda, sector 976772992
Buffer I/O error on device sda, logical block 122096624
ATA: abnormal status 0xD0 on port 0x20CF
ATA: abnormal status 0xD0 on port 0x20CF
ATA: abnormal status 0xD0 on port 0x20CF
ata1: command 0x25 timeout, stat 0xd0 host_stat 0x41
ata1: status=0xd0 { Busy }
SCSI error : <4 0 1 0> return code = 0x8000002
sda: Current: sense key=0xb
ASC=0x47 ASCQ=0x0
end_request: I/O error, dev sda, sector 0
Buffer I/O error on device sda, logical block 0
ATA: abnormal status 0xD0 on port 0x20CF
ATA: abnormal status 0xD0 on port 0x20CF
ATA: abnormal status 0xD0 on port 0x20CF
ata1: command 0x25 timeout, stat 0xd0 host_stat 0x41
ata1: status=0xd0 { Busy }
SCSI error : <4 0 1 0> return code = 0x8000002
sda: Current: sense key=0xb
ASC=0x47 ASCQ=0x0
end_request: I/O error, dev sda, sector 0
Buffer I/O error on device sda, logical block 0
ATA: abnormal status 0xD0 on port 0x20CF
ATA: abnormal status 0xD0 on port 0x20CF
ATA: abnormal status 0xD0 on port 0x20CF
ata1: command 0x25 timeout, stat 0xd0 host_stat 0x40
ata1: status=0xd0 { Busy }
SCSI error : <4 0 1 0> return code = 0x8000002
sda: Current: sense key=0xb
ASC=0x47 ASCQ=0x0
end_request: I/O error, dev sda, sector 8
Buffer I/O error on device sda, logical block 1
ATA: abnormal status 0xD0 on port 0x20CF
ATA: abnormal status 0xD0 on port 0x20CF
ATA: abnormal status 0xD0 on port 0x20CF
ata1: status=0x51 { DriveReady SeekComplete Error }
ata1: error=0x84 { DriveStatusError BadCRC }
ata1: command 0x25 timeout, stat 0xd1 host_stat 0x41
ata1: status=0xd1 { Busy }
SCSI error : <4 0 1 0> return code = 0x8000002
sda: Current: sense key=0xb
ASC=0x47 ASCQ=0x0
end_request: I/O error, dev sda, sector 16
Buffer I/O error on device sda, logical block 2
ATA: abnormal status 0xD1 on port 0x20CF
ATA: abnormal status 0xD1 on port 0x20CF
ATA: abnormal status 0xD1 on port 0x20CF
ata1: command 0x25 timeout, stat 0xd1 host_stat 0x41
ata1: status=0xd1 { Busy }
SCSI error : <4 0 1 0> return code = 0x8000002
sda: Current: sense key=0xb
ASC=0x47 ASCQ=0x0
end_request: I/O error, dev sda, sector 24
Buffer I/O error on device sda, logical block 3
ATA: abnormal status 0xD1 on port 0x20CF
ATA: abnormal status 0xD1 on port 0x20CF
ATA: abnormal status 0xD1 on port 0x20CF
ata1: command 0x25 timeout, stat 0xd1 host_stat 0x40
ata1: status=0xd1 { Busy }
SCSI error : <4 0 1 0> return code = 0x8000002
sda: Current: sense key=0xb
ASC=0x47 ASCQ=0x0
end_request: I/O error, dev sda, sector 32
Buffer I/O error on device sda, logical block 4
ATA: abnormal status 0xD1 on port 0x20CF
ATA: abnormal status 0xD1 on port 0x20CF
ATA: abnormal status 0xD1 on port 0x20CF
ata1: status=0x51 { DriveReady SeekComplete Error }
ata1: error=0x84 { DriveStatusError BadCRC }



what should I try next?

Thanks for the response.

j
 
Old 11-19-2007, 09:56 AM   #7
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Original Poster
Rep: Reputation: 44
ok, I booted up with a Slax live Cd, kernel 2.6.16 and its taking forever to boot, normally it only takes a few minutes.

has this listed several times on boot
abnormal status 0xd0 on port 0xd407


several i/o on device sda1, sector xxxxxxxx(it has sector # listed)

it has severeal other errors about timeout and return codes, but it goes by before I can get the exact error





I also have a working Sata drive and booted up with the same Slax CD and it found it no problem



ok rebooted and ran dosfsck /dev/sda1, came back with:

got 4096 bytes instead of 122036416 at 16384

whats this mean?

ok I rebooted and did dosfsck -a -l -v /dev/sda and sda1 both mounted and unmounted.
came back with
read 512 bytes at 0: input/output error

Last edited by ncsuapex; 11-19-2007 at 12:26 PM. Reason: .
 
Old 02-28-2008, 07:45 AM   #8
howiegoing
LQ Newbie
 
Registered: Feb 2008
Posts: 1

Rep: Reputation: 0
Unhappy

I think i have exactly the same problem.

When mounting:

Code:
[root@localhost ~]# mount /dev/sdb1
mount: /dev/sdb1: can't read superblock
When fscking:

Code:
[root@localhost ~]# fsck /dev/sdb1
fsck 1.40.2 (12-Jul-2007)
dosfsck 2.11, 12 Mar 2005, FAT32, LFN
Read 512 bytes at 0:Input/output error
My dmesg is filled with messages like this:

Code:
sd 1:0:0:0: [sdb] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK,SUGGEST_OK
end_request: I/O error, dev sdb, sector 69

Did you ever find a solution to this???
 
Old 05-18-2008, 08:47 AM   #9
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Original Poster
Rep: Reputation: 44
No sorry.. I gave up on it and just found the time today to mess with it again. This is what I am getting now


dmesg

usb 5-5: new high speed USB device using ehci_hcd and address 3
usb 5-5: configuration #1 chosen from 1 choice
Initializing USB Mass Storage driver...
scsi2 : SCSI emulation for USB Mass Storage devices
usbcore: registered new driver usb-storage
USB Mass Storage support registered.
usb-storage: device found at 3
usb-storage: waiting for device to settle before scanning
Vendor: Model: Rev:
Type: Direct-Access ANSI SCSI revision: 02
sd 2:0:0:0: Attached scsi disk sdb
sd 2:0:0:0: Attached scsi generic sg1 type 0
usb-storage: device scan complete


nothing shows up in fdisk -l

fdisk /dev/sdb

Unable to read /dev/sdb



Im pretty sure the drive had vfat FS.

so this is what I get

fsck.vfat /dev/sdb
dosfsck 2.11, 12 Mar 2005, FAT32, LFN
Got 0 bytes instead of 512 at 0


any ideas on how to fix this??



mkdosfs -I /dev/sdb
mkdosfs 2.11 (12 Mar 2005)
mkdosfs: Attempting to create a too large file system
[root@70chip ~]# mkfs.ext3 /dev/sdb
mke2fs 1.39 (29-May-2006)
/dev/sdb is entire device, not just one partition!
Proceed anyway? (y,n) y
mkfs.ext3: Device size reported to be zero. Invalid partition specified, or
partition table wasn't reread after running fdisk, due to
a modified partition being busy and in use. You may need to reboot
to re-read your partition table.

Last edited by ncsuapex; 05-18-2008 at 09:00 AM. Reason: .
 
Old 01-28-2011, 04:28 PM   #10
babagau
LQ Newbie
 
Registered: Jun 2010
Location: Volos, Greece
Distribution: Puredyne
Posts: 15

Rep: Reputation: 0
sorry being 2 years late, but...

I have the same issue, do you remember finding any solution? dd? mkfs.vfat?
 
  


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
GRUB boot failure on IDE w/ 1 SATA Drive. Shifter-999 Linux - Hardware 2 06-15-2007 03:10 AM
Sata Raid 1 and Single Sata drive drive order issue Kvetch Linux - Hardware 5 03-19-2007 06:50 PM
set iBook to automatically power-up after power failure peachy Other *NIX 4 04-19-2006 12:44 PM
Power Failure On AC power ONLY Gateway 5300 marti35 Linux - Laptop and Netbook 1 05-22-2005 10:14 AM
power failure = no root tobysaville Linux - General 1 06-22-2004 06:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 01:51 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