Plug in the hard drive to the computer and open a terminal.
Become root:
shell$ su -
Password:
root#
See which drive was recently attached, in case you're unsure
root# dmesg
...
...
...
[1144639.292844] sd 24:0:0:0: [sde] No Caching mode page present
[1144639.292855] sd 24:0:0:0: [sde] Assuming drive cache: write through
[1144639.356633] sde: sde1
shell#
Unless you know what you're doing with filesystem fragments and the like (I do not), you probably just want this up and working rather than trying to recover tiny parts of files. We see the above 'dmesg' output telling us the newest attached partition is 'sde1' so we'll run a filesystem check against that partition.
First, make sure the drive isn't mounted or you can cause issues:
WARNING!!! The filesystem is mounted. If you continue you ***WILL*** cause ***SEVERE*** filesystem damage.
If you're sure the drive isn't mounted (run as root 'umount /dev/sde1'), let's proceed:
Run the auto repair (-p) first, then we'll force (-f) a second run and auto-answer Yes (-y) to any questions:
root# fsck -p /dev/sde1
...
root# fsck -f -y /dev/sde1
fsck from util-linux 2.20.1e2
fsck 1.42 (29-Nov-2011)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Free blocks count wrong (721019450, counted=301927649).Fix? yes
Free inodes count wrong (183148533, counted=183148043).Fix? yes
DriveName: ***** FILE SYSTEM WAS MODIFIED *****
DriveName: 501/183148544 files (3.4% non-contiguous), 430638623/732566272 blocks
root#
If you have 'bad blocks' errors you may want to run a 'bad block check' and we'll answer 'yes' to these questions as well:
root# fsck -c -y /dev/sde1
Did this work out for you? Let us know in the comments!
1 comments:
that worked awesomely.
Post a Comment