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

  • humbletech99
  • Proficient
  • Proficient
  • User avatar
  • Posts: 300

Post 3+ Months Ago

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
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • dyefade
  • Expert
  • Expert
  • User avatar
  • Posts: 712
  • Loc: UK

Post 3+ Months Ago

You're going to kick yourself.

Try typing "mount" with no args.
  • humbletech99
  • Proficient
  • Proficient
  • User avatar
  • Posts: 300

Post 3+ Months Ago

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
  • Posts: 712
  • Loc: UK

Post 3+ Months Ago

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
  • Posts: 3318
  • Loc: Trout Creek, MT

Post 3+ Months Ago

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.
  • this213
  • Guru
  • Guru
  • User avatar
  • Posts: 1260
  • Loc: ./

Post 3+ Months Ago

file -s /dev/sdaN

* you have to be root
  • dyefade
  • Expert
  • Expert
  • User avatar
  • Posts: 712
  • Loc: UK

Post 3+ Months Ago

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
  • Posts: 165
  • Loc: between

Post 3+ Months Ago

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 69 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
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.