masterzorag's Activity

Friday, October 26, 2012


busy with many stuff, random list:
no ps3, no OpenCL
no code, no bruteforge
badblock, e2fsck, mkfs.ext4, dumpe2fs and a couple of HDD to recover
code aes-cbc-256
test AMD E2-1800 and E350/ATI6310
laptop become headless: recover work and use it as a server
ssh, sshfs, x11 forwarding, rdp

* Here is how I've recovered a corrupted HDD and use it as EXT4 *

# unmount device, at first
umount /dev/sdc1

# read about checking program
-v verbose
-d debugging output
-c call badblocks to add newly badblocks to blacklisted list
-k When combined with the -c option, any existing bad blocks in the bad blocks list are preserved, and any new bad blocks found by running badblocks(8) will be added to the existing bad blocks list.

e2fsck -v -d -c -k /dev/sdc1
# this method should work, but I'm used to do my own, so go deeper:

# know the blocksize and pass it at every tool, here 4096

# read and write the badblock list, get total
dumpe2fs -b -o blocksize=4096 /dev/sdc1 > badlist
wc -l badlist

# scan for badblocks, skipping already known in badlist
badblocks -b 4096 -s -v -o badblocks.out -i badlist /dev/sdc1

# manually add badblocks
e2fsck -B 4096 -v -d -k -l badblocks.out /dev/sdc1
# verify
e2fsck -B 4096 -v -d -f /dev/sdc1

# badblocks count should reflect wc output:
dumpe2fs -b -o blocksize=4096 /dev/sdc1 > total_badblock
wc -l total_badblock

# format passing the badblock list, large_file needs CONFIG_LBDAF into kernel
mkfs.ext4 -l total_badblock -b 4096 -m 0 -O dir_index,extent,large_file,sparse_super,flex_bg -v /dev/sdc1

# (manually excluding large_file and huge_file can be done at format time as this:)
# mkfs.ext4 ... -O ^large_file,^huge_file ...

# once you've done, mount your device.
# as usual, reading man pages can help you a lot!

1 comment:

  1. Very good!
    Please take a look also at this