Discover what filesystem(s) are on a disk/partition?

  • humbletech99
  • Proficient
  • Proficient
  • User avatar
  • Joined: Mar 09, 2006
  • Posts: 300
  • Status: Offline

Post February 2nd, 2008, 10:55 am

Is there any really good linux program to definitively tell you what filesystem(s) are on a disk/partitions?

When you do mount /dev/sda1, for example, the mount program detects the filesystem type and then mounts the partition as that filesystem so you can use it. I am looking for a program to just run the check of what filesystem it is without mounting the filesystem. I suspect that "mount" does this detection by looking for signatures in the first by bytes of the partition in order to identify it, so there should be some other program that can do this too, right?

EDIT: as I was typing this, I realized that fdisk and parted must be able to do this and they seem to, although I haven't tried them on any random disks yet. If anyone knows of any other good programs for file system detection, could you please post them here?
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post February 2nd, 2008, 10:55 am

  • dyefade
  • Expert
  • Expert
  • User avatar
  • Joined: May 22, 2004
  • Posts: 712
  • Loc: UK
  • Status: Offline

Post February 2nd, 2008, 11:02 am

You're going to kick yourself.

Try typing "mount" with no args.
  • humbletech99
  • Proficient
  • Proficient
  • User avatar
  • Joined: Mar 09, 2006
  • Posts: 300
  • Status: Offline

Post February 2nd, 2008, 11:06 am

No, that just tells you what you have mounted. I specifically stated the requirement to not mount the disk.

I want to be able to plug in a random disk and detect the filesystems on it without trying to mount it. I think fdisk and parted are ok for this, but am open to ideas on other programs.
  • dyefade
  • Expert
  • Expert
  • User avatar
  • Joined: May 22, 2004
  • Posts: 712
  • Loc: UK
  • Status: Offline

Post February 2nd, 2008, 11:28 am

Oh. OK, my bad.
No, I don't know then. I just let the Gnome automount everything. Comment seems a little patronising now, sorry about that.
  • kc0tma
  • o|||||||o
  • Web Master
  • User avatar
  • Joined: Jul 20, 2007
  • Posts: 3318
  • Loc: Trout Creek, MT
  • Status: Offline

Post February 2nd, 2008, 2:28 pm

I just tried parted, and once you get into the parted prompt, do a 'print all' and that told me what all I've got. I don't have a spare drive to plug in to see if it tells you unmounted disks, but if you've got one you should be able to try it just that easy. It didn't like my regular account, so you will have to sudo or su into a privelaged (spelling?) account.
Like Mr Spork, I also write about my interest in alcoholic beverages.
  • this213
  • Guru
  • Guru
  • User avatar
  • Joined: Mar 01, 2004
  • Posts: 1242
  • Loc: ./
  • Status: Offline

Post February 3rd, 2008, 8:57 am

file -s /dev/sdaN

* you have to be root
http://www.disabo.com
  • dyefade
  • Expert
  • Expert
  • User avatar
  • Joined: May 22, 2004
  • Posts: 712
  • Loc: UK
  • Status: Offline

Post February 3rd, 2008, 9:01 am

Huh, didn't know that. Mind you, not something you often need in a home situation. Worth remembering though I guess.
  • Janrocks
  • Graduate
  • Graduate
  • User avatar
  • Joined: Jun 15, 2005
  • Posts: 165
  • Loc: between
  • Status: Offline

Post February 4th, 2008, 1:08 am

Gparted or cfdisk run from a live cd distro anybody?

I assume if you boot into the OS on the drive it will mount at least 2 partitions.

DSL has cfdisk at runlevel 2, and puppy has a really nice gparted gui implementation.

Post Information

  • Total Posts in this topic: 8 posts
  • Users browsing this forum: No registered users and 50 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.