VectorLinux
November 24, 2014, 11:56:03 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to http://vectorlinux.com/forum1. The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
 
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: [1]
  Print  
Author Topic: [SOLVED] how to detect hard drive filesystem  (Read 5687 times)
forbajato
Packager
Member
****
Posts: 46


« on: May 31, 2007, 04:39:03 am »

I have an old hard drive that I have put in an external, usb box.  I can't recall its structure I am afraid.  I know it had one windows partition, one partition for linux and one for data to be used by other OS's.  The windows partition will mount fine but I keep getting filesystem type errors when I try to mount the other two partitions.

I tried doing e2fsck on each of the other partition to see if one is ext2 or 3 but got bad superblock errors.  I thought perhaps reiser was a possible fs for one of the partitions but got a similar bad superblock error.  Is there a way to know for sure what the fs type is on unknown partitions?  Is there a way to recover data from unknown partitions without finding out the fs type?

forbajato
« Last Edit: June 07, 2007, 08:38:45 am by JohnB316 » Logged
lagagnon
Global Moderator
Vectorian
*****
Posts: 1922



WWW
« Reply #1 on: May 31, 2007, 06:36:43 am »

Well you could mount the filesystem, navigate to the system and type "stat -f filename" on any file in that system and that command wil tell you the filesystem type.
Logged

"As people become more intelligent they care less for preachers and more for teachers". Robert G. Ingersoll
MikeCindi
Tester
Vectorian
****
Posts: 1073


« Reply #2 on: May 31, 2007, 10:49:55 am »

Another option would be to boot GParted's live CD and if the drive is attached and powered then gparted does a pretty good job of finding and listing the partitions (and their fs type) in its GUI.
HTH,
Mike
Logged

The plans of the diligent lead to profit...Pro. 21:5
VL64 7.1b3                                     RLU 486143
GrannyGeek
Packager
Vectorian
****
Posts: 2567


« Reply #3 on: May 31, 2007, 07:42:55 pm »

Attach and turn on the external drive, su to root and run
fdisk -l
at the terminal prompt. The file system should be listed. I don't know how reliable fdisk's report is, but it's worth a try.

Or once you know what /dev/sdx the drive is seen as, su to root and type
cfdisk /dev/sdx
at the terminal prompt. cfdisk lists the file type on a device's partitions. Substitute the proper /dev/sda or /dev/sdb or whatever it is for /dev/sdx.

I'm not an expert. Someone please correct me if these suggestions wouldn't work.
--GrannyGeek
Logged

Registered Linux User #397786

Happily running VL 7 Gold on  a Sempron LE-1300 desktop (2.3 GHz), 4 G RAM,  GeForce 6150 SE onboard graphics and on an HP Pavilion dv7 i7, 6 gigs, Intel 2nd Generation Integrated Graphics Controller
Joe1962
Administrator
Vectorian
*****
Posts: 2499



WWW
« Reply #4 on: May 31, 2007, 08:19:38 pm »

Like Granny says, as root, get the devices with "fdisk -l", then run "disktype devicename".
Logged

O'Neill (RE the Asgard): "Usually they ask nicely before they ignore us and do what they damn well please."
http://joe1962.bigbox.info
Running: VL 7 Std 64 + self-cooked XFCE-4.10
GrannyGeek
Packager
Vectorian
****
Posts: 2567


« Reply #5 on: May 31, 2007, 08:42:07 pm »

"disktype" is a new one for me. It looks pretty handy. Thanks! (Yes, it's now in my Tuxcards Linux tips file. Smiley )
--GrannyGeek
Logged

Registered Linux User #397786

Happily running VL 7 Gold on  a Sempron LE-1300 desktop (2.3 GHz), 4 G RAM,  GeForce 6150 SE onboard graphics and on an HP Pavilion dv7 i7, 6 gigs, Intel 2nd Generation Integrated Graphics Controller
forbajato
Packager
Member
****
Posts: 46


« Reply #6 on: June 05, 2007, 03:21:06 pm »

What a fantastic community!

OK, so now I have some data but am not sure what to make of it.  Running fdisk -l gives the following relevant portion:

Code:
# fdisk -l
Disk /dev/sda: 81.9 GB, 81964302336 bytes
255 heads, 63 sectors/track, 9964 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         164     1312042    7  HPFS/NTFS
/dev/sda2            2220        2322      820384    2  XENIX root
/dev/sda3              35          35         153   83  Linux

Partition table entries are not in disk order

The disktype output is as follows:

Code:
# disktype /dev/sda


--- /dev/sda
Block device, size 76.34 GiB (81964302336 bytes)
DOS partition map
Partition 1: 1.251 GiB (1343531008 bytes, 2624084 sectors from 63, bootable)
  Type 0x07 (HPFS/NTFS)
  NTFS file system
    Volume size 9.767 GiB (10487197696 bytes, 20482808 sectors)
Partition 2: 801.2 MiB (840073216 bytes, 1640768 sectors from 35657238)
  Type 0x02 (XENIX root)
Partition 3: 153 KiB (156672 bytes, 306 sectors from 559379)
  Type 0x83 (Linux)

I can't be sure but this seems to be saying that I have a badly messed up disk.  It looks like there is a Linux partition overlaying an NTFS partition (that can't be good!) and then a leftover partition at the end of the disk.  Is there a safe way to try and address those blocks in the middle (from 164 to 2220)?
Logged
rbistolfi
Packager
Vectorian
****
Posts: 2290


« Reply #7 on: June 05, 2007, 03:55:26 pm »

Quote
I can't be sure but this seems to be saying that I have a badly messed up disk.  It looks like there is a Linux partition overlaying an NTFS partition (that can't be good!) and then a leftover partition at the end of the disk.  Is there a safe way to try and address those blocks in the middle (from 164 to 2220)?
hmm, I hope you dont have important data on that disk. Job for our experts. Just courious: Is that a SCO Openserver partition? I read somewhere XENIX partitions cant have more than 512mb, so I guess is an Openserver one.
I think you could claim the empty space between those sectors with gparted, but I am not sure if you can mount a XENIX filesystem on Linux, as I said, nice challenge for our experts.
BTW, The sector 35 looks like an oasis in a sea of madness  Grin (sorry for the joke, I cant resist them).

EDIT-- could be that a hole disk managed by SCO OS? It can make more than one filesystem in one partition, so that could explain that sector 35. Is possible linux cant understand a partition table made under the SCO plataform? Just an idea. Here are my sources:

http://aplawrence.com/Bofcusm/2645.html
http://aplawrence.com/Linux/scolindiff.html
« Last Edit: June 05, 2007, 04:15:29 pm by rbistolfi » Logged

"There is a concept which corrupts and upsets all others. I refer not to Evil, whose limited realm is that of ethics; I refer to the infinite."
Jorge Luis Borges, Avatars of the Tortoise.

--
Jumalauta!!
Joe1962
Administrator
Vectorian
*****
Posts: 2499



WWW
« Reply #8 on: June 05, 2007, 05:03:14 pm »

That is one messed up HDD! Partition 3 is a 153 KB Linux type, with no filesystem (couldn't fit one in 153 KB, I dare say). Partition 1 is a 1.251 GB NTFS partition, with a 9.767 GB NTFS filesystem!!!... Shocked. No idea about the Xenix partition, which has no recognizable filesystem, either. You could try testdisk on it, but if it were mine, I'd be repartitioning and formatting it by now, then testing it well before any real use.
Logged

O'Neill (RE the Asgard): "Usually they ask nicely before they ignore us and do what they damn well please."
http://joe1962.bigbox.info
Running: VL 7 Std 64 + self-cooked XFCE-4.10
MikeCindi
Tester
Vectorian
****
Posts: 1073


« Reply #9 on: June 05, 2007, 07:06:04 pm »

If you have data that you need on the disk then using testdisk might be helpful. I don't really trust the output reported to you by fdisk and disktype. You mentioned that you could mount the windows partition so I'd start there and if possible copying any data that you need to another storage device (e.g. HD). Then I (this is my approach, one of obviously many) would use GParted's Live CD to see if it's partition detection was the same as you already have and if copying (not moving as you don't want to write to this disk yet) a partition to your alternate storage device was possible. If that doesn't work then I would try using testdisk which you can get from various sources (here is a wiki page http://www.cgsecurity.org/wiki/TestDisk). The source that I prefer is System Rescue CD (http://www.sysresccd.org/Main_Page). If all the above fails then there is not much else to use that you have direct control over and/or doesn't cost a great deal of money.
HTH,
Mike
Logged

The plans of the diligent lead to profit...Pro. 21:5
VL64 7.1b3                                     RLU 486143
forbajato
Packager
Member
****
Posts: 46


« Reply #10 on: June 06, 2007, 06:15:45 am »

Wow, Gparted and testdisk are an amazing set of tools.  I had a really messed up HDD with lots of space available not being detected by fdisk and disktype.  I booted into Gparted LiveCD, ran testdisk and it figured out what that huge amount of space was - an old FAT32 partition with loads of data.  Save the revised partition table, reload /dev/sda into gparted and Voila - functional disk again.

After repair here is the results of the fdisk -l:

Code:
Disk /dev/sda: 81.9 GB, 81964302336 bytes

255 heads, 63 sectors/track, 9964 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes



   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1        1275    10241406    7  HPFS/NTFS

/dev/sda2            1276        2550    10241437+  83  Linux

/dev/sda3            2551        9964    59552955    f  W95 Ext'd (LBA)

/dev/sda5            2551        9964    59552923+   c  W95 FAT32 (LBA)


And here is the results of the disktype /dev/sda:

Code:
--- /dev/sda

Block device, size 76.34 GiB (81964302336 bytes)

DOS partition map

Partition 1: 9.767 GiB (10487199744 bytes, 20482812 sectors from 63, bootable)

  Type 0x07 (HPFS/NTFS)

  NTFS file system

    Volume size 9.767 GiB (10487197696 bytes, 20482808 sectors)

Partition 2: 9.767 GiB (10487232000 bytes, 20482875 sectors from 20482875)

  Type 0x83 (Linux)

  Ext3 file system

    UUID B95DE2A7-E1BB-4AF4-B146-A6ADF12BBB1D (DCE, v4)

    Volume size 9.767 GiB (10487230464 bytes, 2560359 blocks of 4 KiB)

Partition 3: 56.79 GiB (60982225920 bytes, 119105910 sectors from 40965750)

  Type 0x0F (Win95 Ext'd (LBA))

  Partition 5: 56.79 GiB (60982193664 bytes, 119105847 sectors from 40965750+63)

    Type 0x0C (Win95 FAT32 (LBA))

    FAT32 file system (hints score 5 of 5)

      Volume size 56.74 GiB (60922650624 bytes, 7436847 clusters of 8 KiB)


Thanks so much to everyone for your pointers!  Thanks especially to Granny, Joe and Mike for pointing me to the tools that solved the problem.
Logged
Joe1962
Administrator
Vectorian
*****
Posts: 2499



WWW
« Reply #11 on: June 06, 2007, 07:57:48 am »

That's great news forbajato!
Logged

O'Neill (RE the Asgard): "Usually they ask nicely before they ignore us and do what they damn well please."
http://joe1962.bigbox.info
Running: VL 7 Std 64 + self-cooked XFCE-4.10
MikeCindi
Tester
Vectorian
****
Posts: 1073


« Reply #12 on: June 06, 2007, 09:39:06 am »

Patience and persistence are necessary but the right tools make life so much better. Wink
Logged

The plans of the diligent lead to profit...Pro. 21:5
VL64 7.1b3                                     RLU 486143
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!