LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   HDD parition corrupted? (https://www.linuxquestions.org/questions/linux-newbie-8/hdd-parition-corrupted-4175571813/)

mikeb1986 02-09-2016 01:10 PM

HDD parition corrupted?
 
Turned my PC on this morning and got

error: no such device ...
grub rescue>

I have booted into my other HDD, hoping to recover a few files from my usual HDD and go for a fresh install, but it doesnt appear on file explorer. The other parition on the drive does, but not the boot partition. Disk utility sees it as
Partition 1 629Gb Unknown (should be Ext4)

The other (working) partition appears as
Filesystem Partition 3 1.4Tb Ext4

I have run testdisk on the drive and a search of the disk shows the 2 partitions, the swap and the extended, when I try to explore files on the suspect partition it says "No file found, filesystem may be damaged". the partition I use for storage shows up the files there OK

I am unsure where to go next, I'm not bothered about the OS on there, I would just like to recover a handful of files that I know are only on that drive and I will go for a re-install, but if I could get it back to how it was that would be even better. Any help much appreciated.

For the record I am running on Linux Mint 17.1 on the second HDD, that is what should be on the broken partition too if it helps. thanks

MrTux 02-09-2016 01:16 PM

For it to appear you need to mount it manually.

mikeb1986 02-09-2016 01:39 PM

I dont know how to do that as a command. But in Disk utitlity its not there as an option. A lot of the options are greyed out and theres no filesystem listed for it. Where the other say Ext4 or Swap for example, this says unknown

MrTux 02-09-2016 02:03 PM

have you tried doing blkid and find if your "corrupted" hard drive shows up?


if so try mounting it.

mount /dev/sdX /mnt

not sure if ubuntu has a /mnt if not make it

mkdir /mnt


NOTE: I assume you are using root.

IF it happens to show up, I would backup all important data right away!!!!!!

rknichols 02-09-2016 02:12 PM

If testdisk can't find any evidence of an ext4 filesystem, that's pretty bad. It suggests that not only is the primary super block destroyed but the backup super blocks as well. Another possibility is that the partition table entry for that partition has been damaged. What is the output from "fdisk -lu /dev/sda" (substituting the correct device if it is not "sda")? What happens if you try to run "fsck.ext4 -n /dev/sda1"? (Again, substitute the correct device, and do not leave out the "-n". At this point you do not want fsck to try to "fix" anything. That could be disasterous.)

When you post output, please include the actual command you ran, and wrap it all in [CODE] ... [/CODE] tags to preserve formatting.

jefro 02-09-2016 09:32 PM

Might be worth it to make a dd or partimage or gparted partition image of it before you play with it too much.


I've seen deals like this where you might try to manually edit partition information.

mikeb1986 02-10-2016 12:52 AM

Thank you everyone for replies.
I don't know what I did if anything, other than scanning it with test disk, but this morning I have a different error on startup.

On another note I can now mount the disk when I startup on another HDD and it is showing as Ext4, and have backed up what I need, so far it all seems to be uncorrupt.

While I would like to know what happened, I think I'm just going to go for a format and reinstall on the drive and see if anything unusual happens. The only bit I'm not sure about in the commands suggested is the "partition 2 does not start on a physical sector boundary" or is this normal? sdb1 is the partition that wasn't working, sdb3 is the "storage" partition with no OS

Code:

mike-study mike # fdisk -lu /dev/sdb

Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x000238e5

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1            2048  1227923455  613960704  83  Linux
/dev/sdb2      3890325502  3907028991    8351745    5  Extended
Partition 2 does not start on physical sector boundary.
/dev/sdb3      1227923456  3890323455  1331200000  83  Linux
/dev/sdb5      3890325504  3907028991    8351744  82  Linux swap / Solaris

Partition table entries are not in disk order

mike-study mike # fsck.ext4 -n /dev/sdb1
e2fsck 1.42.9 (4-Feb-2014)
/dev/sdb1: clean, 297309/38379520 files, 29420213/153490176 blocks

Thanks again for replies

rknichols 02-10-2016 09:04 AM

Quote:

Originally Posted by mikeb1986 (Post 5497940)
The only bit I'm not sure about in the commands suggested is the "partition 2 does not start on a physical sector boundary" or is this normal? sdb1 is the partition that wasn't working, sdb3 is the "storage" partition with no OS

Code:

mike-study mike # fdisk -lu /dev/sdb

Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x000238e5

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1            2048  1227923455  613960704  83  Linux
/dev/sdb2      3890325502  3907028991    8351745    5  Extended
Partition 2 does not start on physical sector boundary.
/dev/sdb3      1227923456  3890323455  1331200000  83  Linux
/dev/sdb5      3890325504  3907028991    8351744  82  Linux swap / Solaris

Partition table entries are not in disk order


For the extended partition that physical sector alignment does not matter. What matters is that all of your other partitions are properly aligned. Misalignment severely affects write performance in drives with physical sectors larger than the logical sector size, but the only thing misaligned here is the header on that extended partition. The only time that header is written is when you are repartitioning the disk. (For that matter, the only time it is read is during booting or when you run commands like fdisk that read partition information from the disk.)

jefro 02-10-2016 08:08 PM

Controller on drive?

BW-userx 02-10-2016 08:18 PM

Quote:

Originally Posted by mikeb1986 (Post 5497657)
Turned my PC on this morning and got

error: no such device ...
grub rescue>

I have booted into my other HDD, hoping to recover a few files from my usual HDD and go for a fresh install, but it doesnt appear on file explorer. The other parition on the drive does, but not the boot partition. Disk utility sees it as
Partition 1 629Gb Unknown (should be Ext4)

The other (working) partition appears as
Filesystem Partition 3 1.4Tb Ext4

I have run testdisk on the drive and a search of the disk shows the 2 partitions, the swap and the extended, when I try to explore files on the suspect partition it says "No file found, filesystem may be damaged". the partition I use for storage shows up the files there OK

I am unsure where to go next, I'm not bothered about the OS on there, I would just like to recover a handful of files that I know are only on that drive and I will go for a re-install, but if I could get it back to how it was that would be even better. Any help much appreciated.

For the record I am running on Linux Mint 17.1 on the second HDD, that is what should be on the broken partition too if it helps. thanks

\
soory wrong post LoL removed what I had and put in right post ...


All times are GMT -5. The time now is 09:14 AM.