[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.
Well done!
I would just loop mount the partition and see if you can read it:
Code:
# Just to be safe:
chmod 0440 /path/to/p1
# Link the rescued partition to a loop device:
losetup /dev/loop3 /path/to/p1
# Create a temporary mount point:
mkdir /mnt/temp
# See if the mount works (probably not):
mount /dev/loop3 0t ext4 /mnt/temp -o ro,norecovery,noload
if that doesn't work (and not due to not recognizing "norecovery,noload") see if you can get the location of an alternative superblock (man 'fsck' wrt mke2fs; 'man mke2fs') and run fsck.ext4 on it with "-f -v -n" (but never with "-a" or "-p"!). If you have testdisk you could try
Code:
testdisk /debug /log /dev/loop3
and see if you can "browse" the file system: ( Proceed > Choose partition table type ("none" because its a partition) > Advanced > Undelete). If that doesn't work look at "testdisk.log" for clues.
mount /dev/loop3 0t ext4 /mnt/temp -o ro,norecovery,noload
fails with usual bad superblock | wrong fs type .
Quote:
If you have testdisk you could try
Code:
testdisk /debug /log /dev/loop3
and see if you can "browse" the file system: ( Proceed > Choose partition table type ("none" because its a partition) > Advanced > Undelete). If that doesn't work look at "testdisk.log" for clues.
after Advanced i dont get Undelete option but it does give my partition.it does gives alternate locations of the superblock.
there also a list option. and it works.
testdisk.log
Code:
Using locale 'C'.
Tue Nov 13 09:32:09 2012
Command line: TestDisk /debug /log p1
TestDisk 6.13, Data Recovery Utility, November 2011
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org
OS: Linux, kernel 3.4.5-1-ARCH (#1 SMP PREEMPT Mon Jul 16 21:35:54 CEST 2012) x86_64
Compiler: GCC 4.7
Compilation date: 2012-11-05T15:00:38
ext2fs lib: 1.42.4, ntfs lib: libntfs-3g, reiserfs lib: 0.3.0.5, ewf lib: none
Hard disk list
Disk p1 - 943 GB / 878 GiB - CHS 114734 255 63, sector size=512
Partition table type (auto): None
Disk p1 - 943 GB / 878 GiB
Partition table type: None
Interface Advanced
recover_EXT2: "e2fsck -b 98304 -B 4096 device" may be needed
P ext4 0 0 1 114733 227 54 1843200000 [wd]
EXT4 Large file Sparse superblock Backup superblock, 943 GB / 878 GiB
Interface Advanced
recover_EXT2: "e2fsck -b 98304 -B 4096 device" may be needed
P ext4 0 0 1 114733 227 54 1843200000 [wd]
EXT4 Large file Sparse superblock Backup superblock, 943 GB / 878 GiB
search_superblock
block_group_nr 1
recover_EXT2: "e2fsck -b 32768 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=1/7031, s_mnt_count=0/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 230399999
recover_EXT2: part_size 1843199992
Ext2 superblock found at sector 262144 (block=32768, blocksize=4096)
block_group_nr 3
recover_EXT2: "e2fsck -b 98304 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=3/7031, s_mnt_count=0/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 230399999
recover_EXT2: part_size 1843199992
Ext2 superblock found at sector 262144 (block=32768, blocksize=4096)
block_group_nr 3
recover_EXT2: "e2fsck -b 98304 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=3/7031, s_mnt_count=0/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 230399999
recover_EXT2: part_size 1843199992
Ext2 superblock found at sector 786432 (block=98304, blocksize=4096)
block_group_nr 5
recover_EXT2: "e2fsck -b 163840 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=5/7031, s_mnt_count=0/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 230399999
recover_EXT2: part_size 1843199992
Ext2 superblock found at sector 1310720 (block=163840, blocksize=4096)
block_group_nr 7
recover_EXT2: "e2fsck -b 229376 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=7/7031, s_mnt_count=0/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 230399999
recover_EXT2: part_size 1843199992
Ext2 superblock found at sector 1835008 (block=229376, blocksize=4096)
block_group_nr 9
recover_EXT2: "e2fsck -b 294912 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=9/7031, s_mnt_count=0/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 230399999
recover_EXT2: part_size 1843199992
Ext2 superblock found at sector 2359296 (block=294912, blocksize=4096)
block_group_nr 25
recover_EXT2: "e2fsck -b 819200 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=25/7031, s_mnt_count=0/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 230399999
recover_EXT2: part_size 1843199992
Ext2 superblock found at sector 6553600 (block=819200, blocksize=4096)
block_group_nr 27
recover_EXT2: "e2fsck -b 884736 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=27/7031, s_mnt_count=0/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 230399999
recover_EXT2: part_size 1843199992
Ext2 superblock found at sector 7077888 (block=884736, blocksize=4096)
block_group_nr 49
recover_EXT2: "e2fsck -b 1605632 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=49/7031, s_mnt_count=0/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 230399999
recover_EXT2: part_size 1843199992
Ext2 superblock found at sector 12845056 (block=1605632, blocksize=4096)
block_group_nr 81
recover_EXT2: "e2fsck -b 2654208 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=81/7031, s_mnt_count=0/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 230399999
recover_EXT2: part_size 1843199992
Ext2 superblock found at sector 21233664 (block=2654208, blocksize=4096)
block_group_nr 125
recover_EXT2: "e2fsck -b 4096000 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=125/7031, s_mnt_count=0/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 230399999
recover_EXT2: part_size 1843199992
Ext2 superblock found at sector 32768000 (block=4096000, blocksize=4096)
ext4 0 0 1 114733 227 46 1843199992 [wd]
superblock 32768, blocksize=4096 [wd]
superblock 98304, blocksize=4096 [wd]
superblock 163840, blocksize=4096 [wd]
superblock 229376, blocksize=4096 [wd]
superblock 294912, blocksize=4096 [wd]
superblock 819200, blocksize=4096 [wd]
superblock 884736, blocksize=4096 [wd]
superblock 1605632, blocksize=4096 [wd]
superblock 2654208, blocksize=4096 [wd]
superblock 4096000, blocksize=4096 [wd]
To repair the filesystem using alternate superblock, run
fsck.ext4 -p -b superblock -B blocksize device
SIGINT detected! TestDisk has been killed.
Quote:
if that doesn't work (and not due to not recognizing "norecovery,noload") see if you can get the location of an alternative superblock (man 'fsck' wrt mke2fs; 'man mke2fs') and run fsck.ext4 on it with "-f -v -n" (but never with "-a" or "-p"!).
i am bit confused here.
should i run mke2fs or e2fsck (fsck.ext4 does not have all these options) ? or both if yes in what order ?
anyway i did run e2fsk. it just keep outputing lots of dash seprated numbers .
i am bit confused here.
should i run mke2fs or e2fsck (fsck.ext4 does not have all these options) ? or both if yes in what order ?
My reply was in this order:
- try loop mounting, or else
- find an alternative superblock (using 'mke2fs -n') and
- run fsck "-v -t -n", or else
- run testdisk.
Quote:
Originally Posted by ununun
anyway i did run e2fsk. it just keep outputing lots of dash seprated numbers .
Did you mount the partiton read-only? What was the fsck command line you used? Did you run fsck with the arguments that testdisk.log suggested?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.