[SOLVED] ext4 partition just went missing; dd if=the_partition writes 0 bytes.
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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.
ext4 partition just went missing; dd if=the_partition writes 0 bytes.
its been a regular day. the only thing that i can think of that could even remotely affect my external hard-drive is, installing laptop-mode. beside that nothing comes to mind.
the hard drive is 1tb usb 3.0 wd externel drive (sdc). hd was already plugged in, its first partition (i.e. sdc1,ext4) mounted when the problem happened. i was working, nothing that io to sdc1. then i realized sdc1 is no longer mounted. i tried to mount it,but the command took at least 1m untill i ^C it. there is no uuid entry in /dev/disk/by-uuid/
Code:
$ fdisk -l /dev/sdc
/dev/sdc1 2048 1843202047 921600000 83 Linux
/dev/sdc2 1943218176 1953458175 5120000 83 Linux
/dev/sdc3 1843202048 1943218175 50008064 7 HPFS/NTFS/exFAT
Partition table entries are not in disk order
checking sdc1 fails too.
Code:
$ e2fsc -f /dev/sdc1
e2fsck 1.42.5 (29-Jul-2012)
e2fsck: Attempt to read block from filesystem resulted in short read while trying to open /dev/sdc1
Could this be a zero-length partition?
i tried to back up it using dd, but that failed too.
Code:
$ dd if=/dev/sdc1 > /mnt/sg/fs
dd: reading '/dev/sdc1': Input/output error
0+0 records in
0+0 records out
0 bytes (0 B) copied, 5.56793 s, 0.0 kB/s
what just happened !
sdc1 had 800+ gb of data in it.
please help.
hd was already plugged in, its first partition (i.e. sdc1,ext4) mounted when the problem happened. i was working, nothing that io to sdc1. then i realized sdc1 is no longer mounted.
Please check your syslog for any messages prior to the approximate time you realized it was no longer mounted. Run 'testdisk /debug /log' on the whole block device, do a quick search, exit without modifying anything and attach the plain text "testdisk.log".
According to Wikipedia this means "Medium Error - nonrecoverable read error".
Quote:
Originally Posted by ununun
what is this !!!
I don't know but apparently your WD Passport connected just fine, then disconnected after approximately 4 hours w/o error message and w/o ever re-connecting back properly and if you search the 'net for phrases like "wd my passport 0740 not recognized" you'll find page upon page of WD horror stories. Common problems:
- disk died,
- host underpowered (external device w/o power adapter),
- cable b0rked or too long,
- flaky enclosure chipset,
- kernel driver bug,
- bad connector.
But AFAIK none of that applies as you say you can access the other partitions. Apart from the complete lack of errors the only thing to say about mounted partitions is the kernel expects to write clean / dirty state back to disk before umounting. And that applies to the mounted partition alone, it doesn't affect other partitions nor the Partition Table. Couple more questions:
- Can you confirm the Passport has or doesn't have its own power adapter?
- Do you use the USB 3.0 cable it came with?
- How long before the errors did you re-format your Passport from factory layout to your 3 partition scheme and did that succeed without any errors?
- You say sdc1 is Ext4, Testdisk says LUKS. Did you (attempt to) encrypt sdc1?
- Can you boot the machine with a Live CD and see if that kernel version works?
- Can the machine run another OS or can you attach it to a machine running another OS?
- Would you be willing to (wrt RMA) / can you open the enclosure (remove Phillips screw, depress plastic retainer on both ends of the case) and connect the device to a machine directly to bypass the enclosure chipset?
Can you confirm the Passport has or doesn't have its own power adapter?
no, the power is drawn from the usb 3.0 cable.
Quote:
Originally Posted by unSpawn
Do you use the USB 3.0 cable it came with?
yes.
Quote:
Originally Posted by unSpawn
How long before the errors did you re-format your Passport from factory layout to your 3 partition scheme and did that succeed without any errors?
yes i got around mid may of this year, formatted similarly back then. but there been no error at all,at any stage. cause i would have scrutinized it thoroughly as it hold very important data. the hd (or partition) did not even gave me a chance, to backup my data.
Quote:
Originally Posted by unSpawn
You say sdc1 is Ext4, Testdisk says LUKS. Did you (attempt to) encrypt sdc1?
no its pure ext4. no encryption at all.
Quote:
Originally Posted by unSpawn
Can you boot the machine with a Live CD and see if that kernel version works?
i dont have a pen drive (or a cd) at the moment. if it works, i could update my arch (as i have not done it for months) and try
newer linux 3.6.5-1 (current:3.4.9-1). e2fsprogs is about latest. (current: 1.42.5-1, new:1.42.6-1).
Quote:
Originally Posted by unSpawn
Can the machine run another OS or can you attach it to a machine running another OS?
no arch linux is only os installed. though i have microxp installed in virtualbox. i will try it, post about it later.
Quote:
Originally Posted by unSpawn
Would you be willing to (wrt RMA) / can you open the enclosure (remove Phillips screw, depress plastic retainer on both ends of the case) and connect the device to a machine directly to bypass the enclosure chipset?
i dont know if it will void warranty, cause i dont see any sticker nor phillips screw. here is the amazon page for more detail. at the moment i dont know how to do this, but i wll if/when it is required.
s.m.a.r.t info:
Code:
smartctl 6.0 2012-10-10 r3643 [x86_64-linux-3.4.9-1-ARCH] (local build)
Copyright (C) 2002-12, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Family: Western Digital My Passport (USB, AF)
Device Model: WDC WD10TMVW-11ZSMS4
Serial Number: xxxx
LU WWN Device Id: xxxx
Firmware Version: 01.01A01
User Capacity: 1,000,204,886,016 bytes [1.00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 5200 rpm
Device is: In smartctl database [for details use: -P show]
ATA Version is: ATA8-ACS (minor revision not indicated)
SATA Version is: SATA 2.6, 3.0 Gb/s (current: 3.0 Gb/s)
Local Time is: Mon Nov 5 22:09:45 2012 IST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
SMART STATUS RETURN: incomplete response, ATA output registers missing
SMART overall-health self-assessment test result: PASSED
Warning: This result is based on an Attribute check.
General SMART Values:
Offline data collection status: (0x00) Offline data collection activity
was never started.
Auto Offline Data Collection: Disabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: (26460) seconds.
Offline data collection
capabilities: (0x7b) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Suspend Offline collection upon new
command.
Offline surface scan supported.
Self-test supported.
Conveyance Self-test supported.
Selective Self-test supported.
SMART capabilities: (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time: ( 2) minutes.
Extended self-test routine
recommended polling time: ( 257) minutes.
Conveyance self-test routine
recommended polling time: ( 5) minutes.
SCT capabilities: (0x7035) SCT Status supported.
SCT Feature Control supported.
SCT Data Table supported.
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x002f 200 200 051 Pre-fail Always - 0
3 Spin_Up_Time 0x0027 167 162 021 Pre-fail Always - 4608
4 Start_Stop_Count 0x0032 099 099 000 Old_age Always - 1054
5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0
7 Seek_Error_Rate 0x002e 200 200 000 Old_age Always - 0
9 Power_On_Hours 0x0032 098 098 000 Old_age Always - 1494
10 Spin_Retry_Count 0x0032 100 100 000 Old_age Always - 0
11 Calibration_Retry_Count 0x0032 100 100 000 Old_age Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 574
192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 406
193 Load_Cycle_Count 0x0032 195 195 000 Old_age Always - 17202
194 Temperature_Celsius 0x0022 119 100 000 Old_age Always - 31
196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0
197 Current_Pending_Sector 0x0032 200 200 000 Old_age Always - 1
198 Offline_Uncorrectable 0x0030 100 253 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 0
200 Multi_Zone_Error_Rate 0x0008 100 253 000 Old_age Offline - 0
SMART Error Log Version: 1
No Errors Logged
SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Extended offline Completed: read failure 90% 1492 2048
# 2 Short offline Completed: read failure 90% 1492 2048
SMART Selective self-test log data structure revision number 1
SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
1 0 0 Not_testing
2 0 0 Not_testing
3 0 0 Not_testing
4 0 0 Not_testing
5 0 0 Not_testing
Selective self-test flags (0x0):
After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.
the hd has some securitly feature like password protection and encryption, and apparently its only for pc and mac. so i have not tried this at all, not even been curious. this page and ATA failure something in smartctl info hints the my hd might have locked down. but i dont understand why it would be just a partition. though i am going to rule out this possiblity in virtualbox.
i tried my friend's laptop which has win 8 enterprise with usb 3.0 connector.
so there was no password set on hd. but the software/win8 did something to it. now fdisk only gives one partition.
Code:
Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x03c92cce
Device Boot Start End Blocks Id System
/dev/sdb1 2048 1953536129 976767041 7 HPFS/NTFS/exFAT
so that was not fun because i have not made a backup yet.
i am going to ddrescue the hd as soon as i finish this post. what would you recommend to compress it as much as possible, may it take 24-30 hrs to complete ?
i tried my friend's laptop which has win 8 enterprise with usb 3.0 connector. (..) the software/win8 did something to it. now fdisk only gives one partition. (..) so that was not fun because i have not made a backup yet.
That indeed isn't funny. If only I had remembered earlier I would have suggested editing the registry before connecting the device. For future reference: open the registry editor on HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\StorageDevicePolicies, create a DWORD called WriteProtect and set it to "1". Close editor, then connect. While it's not as definitive as using an actual wrote blocker it "could do".
Quote:
Originally Posted by ununun
Code:
Device Boot Start End Blocks Id System
/dev/sdb1 2048 1953536129 976767041 7 HPFS/NTFS/exFAT
So Windows 8 basically partitioned the whole disk as one big NTFS partition. Now if it didn't offer to format the partition as NTFS then there's a (very) slight chance it changed the partition table only. If that is the case then you could manually recreate the partitions from the fdisk output in your OP or have Testdisk try and recover the partitions. Should you be able to recreate partitions then you should expect sdc1 not to be readable as the formatting process overlayed the ext4fs file system structure with the NTFS one. While formatting lowers chances of recovery dramatically Photorec should still be able to extract files if their format is complete (includes both header and footer).
Quote:
Originally Posted by ununun
i am going to ddrescue the hd as soon as i finish this post. what would you recommend to compress it as much as possible, may it take 24-30 hrs to complete ?
I would not take any more chances, split the case open and see if I could connect the hard disk to a machine without damaging it first. That's your choice but it would be the only way to overcome the SCSI layer errors you've seen, removing the extra USB layer by direct connection would be good for performance and the disk doesn't have to be mounted to be read by disk duplication tools. Asserting the disks hardware is OK otherwise you could use dd + bzip2 instead of ddrescue or dd_rescue (unless you experience or expect hardware errors already) because data acquisition tools like Linen or FTK Imager (HELIX or DEFT Live CD) do, but ddrescue nor dd_rescue compresses its output file. Given the fact you said 800+ GB worth of data you may not be getting a good compression ratio anyway if the oriiginal files were already compressed (music, movies, OpenOffice-like document formats) plus Photorec doesn't deal with compressed disk images as far as I know.
I would not take any more chances, split the case open and see if I could connect the hard disk to a machine without damaging it first. That's your choice but it would be the only way to overcome the SCSI layer errors you've seen, removing the extra USB layer by direct connection would be good for performance and the disk doesn't have to be mounted to be read by disk duplication tools.
ok, then let me google how to do that and also confirm if it void the warranty.
To put it simply a vendor would be insane it they don't: "(..) warranty does not cover products which have been received improperly packaged, altered, or physically damaged. Products will be inspected upon receipt." (http://support.wdc.com/warranty/policy.asp). Google for "open casing WD Passport Essential" and you'll find at least four YouTube videos.
i have opened the encloure but it seems it does not have sata connector instead there is 2 pin (..) and 12 pin ( :::::: ) on either side of the female plug. the plug is fixed to the green motherboard of internal hd. the model number for hd is WD10TMVW - 11ZSMS4. image https://lh3.ggpht.com/-BtzB-wE5mA8/T...0/P1000223.JPG
i was expecting, sata female plug like regular sata drives. is there any way i can bypass usb connection like unspawn suggested ?
well i did all this after my unsuccusfull attempt to clone the drive using dd + xz. frequent disconnection that happens now might prevent the cloning . i dont know if ddrescue is resilient of this.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.