how to find out which is the underlying filesystem
Dear fellows,
I am trying to help a friend of mine which has a defective disk with information he wants to recover from. He replaced this disk for a new one, several months ago, and reinstalled the system in the new disk and never used the old disk again. He is not an expert in linux, and he is not sure what filesystem was installed in the old disk. The disk is damaged, I don't know how bad, but at least I can say the first superblock is damaged. So, running reiserfsck on this disk I got "reiserfs superblock cannot be found on /dev/hdd1~ and running e2fsck, "e2fsck: Bad magic number in super-block while trying to open /dev/hdd1" The question is: How to find which is the underlying filesystem on this partition ? Whith the right answer, I could use the proper tools to try to fix it, but I don't know which is: reiser v3, reiser v4, ext2, ext3, xfs, who knows ? Any ideas ? |
how about
Code:
fdisk -l |
You missed the point. I don't want to know what partition type it is. It is Linux 83. I want to know what filesystem type it has.
|
Code:
#cat /etc/fstab Code:
#cat /proc/mounts Code:
#parted /dev/hdb print |
I can't read the the disk, because I can't mount it, because I can't fix it. So reading /etc/fstab is not a option. reading /proc/mounts neither because the disk won't mount. And type 83 is not only for reiser. Type 83 is good for ext2, ext3, reiser, xfs...
|
Quote:
Code:
root@musasa:~ # parted /dev/hdb print |
Hey reddazz ! thanks for your time !
Sorry, parted provides nothing. Code:
[root@iron ~]# parted /dev/hdd print I think it make sanity checks on the filesystem and only display information if has a minimum of integrity. I was thinking if we could guess the filesystem type, based on a magic number in partition, much like the file command does..... |
I am sure if the filesystem was corrupt, parted would at least tell you what type it is. I think your drive is severely damaged and there may be a very low chance of retrieving any data on it. If it has really important data, then maybe some disk repair specialists maybe able to help you.
|
Solved
And the answer is....."file" !
For my surprise, the command "file" could identify a file system by its magic number, no matter how bad is the filesystem structure. (of course, it can not be so damaged that the magic number is corrupted) The only trick is to use the "s" flag, otherwise it will tell you it is a block device. Code:
[root@gold ~]# file /dev/hdd1 |
Good for you. I didn't know that command could be used with disks. I will have to remember it since it may come in handy one day.
|
That's pretty good info from both of you! I definitely could have used that a few days ago... Instead I just fdisk'd mkfs'd and installed a new distro on the drive since I figured it was a toasted filesystem, and the data wasn't *that* important. Oh well, the upside is that I was able to juggle data around and change all my / partitions to ext3, and then all the 'extra' partitions (home, var..) to xfs across my entire network (all what, 4 PC's :D ). Thanks, I'll definitely use this info at some point.
Cool |
Try the Suse-partitioner and see if you can see and mount the HDD.
|
All times are GMT -5. The time now is 07:33 AM. |