after accidental power off when copying a file on a usb drive I started getting the error
error: unknown filesystem.
grub rescue>
I checked with ls and got that (hd0,msdos6)is ext2. All other options yielded Filesystem is unknown. I have only one physical HDD on the computer.
The output of parted (executed while everything was running fine) is:
sudo parted -l
Model: ATA ST320LT007-9ZV14 (scsi)
Disk /dev/sda: 320GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1049kB 106MB 105MB primary ntfs boot, type=07
2 106MB 126GB 126GB primary ntfs type=07
3 126GB 320GB 194GB extended lba, type=0f
5 126GB 174GB 48.3GB logical ext4 type=83
6 174GB 314GB 140GB logical ext4 type=83
7 314GB 320GB 6225MB logical linux-swap(v1) type=82
Since I can no fix this issue by myself, I decided to ask the experts here.
I would appreciate your help.
Thank you in advance
When it is already Grub that complains, I would suggest it is the root file system (probably sda5 guessing from the size) is the culprit.
I wonder how an unexpected power down can damage a file system in such a way that it is unrecognisable as an ext2/3/4 file system (or any other) The very first block(s) must have been overwritten…
BTW, you realy have no CD/DVD/USBstick to boot from. Where then did you install from?
Thank you for your reply.
I don’t have the live USB with me. I will be back home on Saturday and will use the live USB from Leap 42.3, I used for fixing grub last time.
The current grub problem is really strange indeed. I was copying to a usb, then the system shut down and all hell broke loose.
Here is what i did
From the boot options of the USB i chose Other “Rescue system”
Then as root I run I run the following two commands
fsck /dev/sda5
#the outut is
e2fsck 1.42.11 (09-Jul-2014)
fsck.ext2: Attempt to read block from filesystem resulted in short read while trying to open /dev/sda5
Could this be a zero-lenght partition?
On the contrary lsblk says that /dev/sda5 is 45G in size.
As feared. The file system on /devsda5 is completely broken.
Reading the error message I would even say that there is something rotten on the disk itself. Because it says that it can not read a (low level) block at all (let alone that the contents is wrong). And that is something more in ine with an unexpected power down then just overwriting.
To confirm, you could try a disk check program from the rescue system
smartctl -a /dev/sda
oe
badblocks -s /dev/sda
I am not very fluent with these, thus others may come with better/more precise advice.
/dev/sda5 is the windows partition :’(. I am also not able to mount it.
/dev/sdb6 is Leap 42.3 and that one works fine. I was able to mount it and look tat the files
I am sorry, the windows partition is sda2. sda5 is the root partition of linux and sda6 is where linux home is located.
Both linux home and windows are fine. I can mount them and look at the files. The broken one is linux root - sda5
I am sorry for the mistake.
OK then. IMHO at the start of sda5 there is a hardware problem of the disk.
That would be my best guess, too.
Is it possible to solve this by software means? Shrink and/or reinstall only the root, to avoid the bad sectors.
Alternatively if the above won’t work:
I was thinking about moving from hdd to msata. In this case I could fresh install the latest version 15.1.
I can imagine how to copy the data from the old user home. However I would like to somehow keep the old windows install.
I presume, that it is possible, while installing Suse 15.1, to create one partition of the same size as the windows partition on the broken hard drive and use dd to copy the contents of the old /dev/sda2 to it (the size of the windows partition now is about 118 GB). However, is it possible to make grub from 15.1 see this copy and boot windows from it?
I would try using ddrescue or dd_rescue from live media boot to clone the whole HDD to the SSD, disconnect the HDD, make sure Windows boots from it, then if successful, install 15.1 to a freshly formatted sda5 on the SSD.
I have not done this before, so I would need some guidance. I would like also to understand why cloning only the windows partition won’t work. My confusion is caused by the fact that the msata ssd will have twice the capacity of the old hdd. What will happen with the extra volume?
They are basically dd augmented to try to recover data from bad sectors. This summarizes the difference between the two. Anything more you need would be in the man page for the one you choose to use, and in ample search hits. I use one so infrequently I don’t remember which I chose to use last, so usually have to search to decide which to use. ATM I have both installed, packages dd_rescue and gnu_ddrescue.
I would like also to understand why cloning only the windows partition won’t work.
It might. The difference is reduced change in context that could make Windows object to the new surroundings, and the extra work involved to make a second try if it does. I do a lot of cloning, both whole disks and individual partitions, but it rarely involves Windows.
My confusion is caused by the fact that the msata ssd will have twice the capacity of the old hdd. What will happen with the extra volume?
You get to choose. You could move the existing sda6 and/or sda7 into it, allowing to expand sda5 and/or sda6 before installing 15.1. You could create one or more new partitions. You could leave it unallocated for use to be determined in the future. Or you could delete sda7, move sda6 into it and expand it, then create a new swap in the newly created space in front of it, optionally also expanding sda5.
You can not repair a broken disk (not functioning sectors). You can only try to save what is still readable, but that needs a lot of understanding how the file system is organised, etc. Normaly not worth the effort when compared to simply restore from the backup.