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.
I booted into Knoppix and had just mounted an ext2 partition on my second harddrive (a Maxtor ~200GB, the partition occupying the last 45 GB or so), when the system froze (did not respond to mouse/keyboard) and I had to reboot with the reset button. Nota bene that I hadn't changed read/write mode to writeable yet! When Knoppix had started once more, the swap partition occured on the desktop (which it doesn't do normally) and when trying to mount it I got this error:
Could not mount device.
The reported error was:
mount: I could not determine the filesystem type, and none was specified
Trying to mount it manually returns:
#mount -t ext2 /dev/hdb1 /mnt/hdb1
mount: wrong fs type, bad option, bad superblock on /dev/hdb1
or to many mounted file systems
Testdisk doesn't find anything (says structure is OK) and neither does Acronis Disc Director.
I have lots of files that I was going to burn onto DVD next week, and I don't want to lose them. What should I do? I can't see that they have been overwritten as the partition was only mounted for a few seconds and then Knoppix froze, almost 100% because of my motherboard which freezes every once in a while when the CPU is in a specific temperature interval (a bug, to say the least). This thing has happened hundreds of times before, but I have never lost anything when running Linux from the harddrive, only when running Knoppix from LiveCD.
the swap partition ... when trying to mount it I got this error:
If you really mean that you are trying to mount a swap partition, the "-t ext2" is wrong, you want "-t swap" (I'd think) or something similar; see mount(8). If that doesn't work, just recreate the swap file system: `mkfs.swap /dev/hdb1' should do it. But for teh l0ve of g@wd don't do this if the partition in question is not a swap partition.
You might try expanding on this one. I've found that manually mounting ext2 doesn't like to work with the above syntax. Either use auto as the fs or add -o defaults at the end.
No, I did not try to mount the swap. What bugged me was the fact that the swap partition suddenly appeared as a normal partition on the Knoppix desktop, ie as hdb2. But neither hdb1 (an ext2) or hdb2 was mountable. I'll check fdisk -l when I get home.
But the thing is, I can't see that the partition should disappear just because the partition table is corrupt. There must be some way to scan for "partition headers" or something if I know where the partition is supposed to start. 200 GB disk, swap partition last (~1 GB), before that an ext2 partition (~45 GB). That partition must begin somewhere in the interval 150-160 GB from the beginning of the disk (200-45-1=154).
But the thing is, I can't see that the partition should disappear just because the partition table is corrupt.
Huh ???.
The partition table defines the partitions - the start and size. If you no longer have a pointer to the data, why wouldn't it disappear ???.
Quote:
There must be some way to scan for "partition headers" or something if I know where the partition is supposed to start.
There is, testdisk. It's on Knoppix. From a terminal, su to root (no password), and try running it - it won't actually update anything until you tell it to.
Huh ???.
The partition table defines the partitions - the start and size. If you no longer have a pointer to the data, why wouldn't it disappear ???
The data on the partitions, and the partitions themselves wouldn't disappear, would they? It isn't likely that 45 GB's worth of data can be erased and actually overwritten in a matter of a few seconds, is it?
Quote:
Originally Posted by syg00
There is, testdisk. It's on Knoppix. From a terminal, su to root (no password), and try running it - it won't actually update anything until you tell it to.
Quote:
Originally Posted by jagot
Testdisk doesn't find anything (says structure is OK) and neither does Acronis Disc Director.
Note: I've tried with testdisk 6.5 (latest stable).
Anyway, this is the output from fdisk -l regarding the harddisk in question:
Disk /dev/hdb: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hdb1 237274 235710 2134919109 0 Empty
Partition 1 does not end on cylinder boundary.
/dev/hdb2 ? 42814 40726 2130707177 ff BBT
Partition 2 does not end on cylinder boundary.
/dev/hdb3 ? 121600 121600 13+ ff BBT
Partition 3 does not end on cylinder boundary.
Is it possible to create a partition table manually from this data and place it on the harddisk?
Note that my harddisk was divided like this:
Missed the note about testdisk - that's a worry.
I am not aware of any backup partition table(s).
You can always update the partition table with [c]fdisk. The problem is to get the start of the partition correct so the filesystem metadata can be found, and the partition mounted. With your guesstimate of your old layout I'd create say a 150 Gig dummy to cover most of the previously "empty" then give the rest to a "real" partition, and start recovery on that. Making it bigger (both ends) makes sure you get all the relevant data.
Then try something like photorec or foremost. Will take days, weeks maybe, to sort out probably.
Good luck.
Note: I never said your data was erased, merely "disappeared" - if you can't see/find something, it has disappeared. Regardless of whether it is still there or not.
Same as turning the light off at night - everything disappears.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.