LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 08-20-2002, 11:01 AM   #1
sykkn
Member
 
Registered: Apr 2001
Location: Texas
Distribution: Mandrake 8.0, RedHat 7.1
Posts: 48

Rep: Reputation: 15
How do I find filesystem type


Does anyone know of a command that would return the fs type if given the device name.
Example:
===============
# whatfs /dev/hda1
ext3
===============

I know that I can do 'fdisk -l /dev/hda' and I can then look for /dev/hda1, but that complicates
what I am doing. I would appreciate any help.
 
Old 08-20-2002, 03:03 PM   #2
notsoevil
Member
 
Registered: May 2001
Location: Louisville, Kentucky, USA
Distribution: RedHat ES
Posts: 120

Rep: Reputation: 15
# cat /proc/mounts | grep /dev/hda1
 
Old 08-20-2002, 03:11 PM   #3
Malicious
Member
 
Registered: Jan 2002
Location: Galveston Island
Distribution: suse, redhat
Posts: 208

Rep: Reputation: 30
Try: fsck -N /dev/hda1

Executes and shows the internal command
used to fire up the appropriate file system
checker. Should display something like:

fsck 1.27 (8-Mar-2002)
[/sbin/fsck.ext3 (1) -- /boot] fsck.ext3 /dev/hda1

Shows the fsck version, checker executable, command
number, file system label and the command to start
the checker. I ran this on RedHat 7.3 with my hda1
labeled as /boot and mounted as /boot.

Oh... the file system is ext3. The file system
type for the device is the extension of fsck.xxxx.

Last edited by Malicious; 08-20-2002 at 03:14 PM.
 
Old 08-21-2002, 12:50 AM   #4
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
and here the type would be ntfs



fsck -N /dev/hda1
fsck 1.24a (02-Sep-2001)
fsck: fsck.ntfs: not found
 
Old 08-21-2002, 01:10 AM   #5
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
I see what your trying to do,
maybe an easier way


some variation of this may work

cat /proc/mounts | grep /dev/hda1 | cut -d "a" -f2- | cut -d "/" -f2- | cut -d " " -f2



this returned

ntfs


play around with it
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Filesystem Type dj_dubbbz Linux - Newbie 6 03-13-2005 01:11 AM
Grub cannot find the filesystem type of my hd0 drive JimmyGourd Linux - Newbie 9 09-25-2004 12:28 PM
Filesystem Type praveenv Linux - General 1 08-10-2004 09:53 AM
root (hd 0,0)Filesystem type unknown, partition type 0x7chainloader +1 ece30675 Linux - Distributions 5 07-20-2004 09:04 AM
how to mount without the filesystem type mascon Linux - General 7 05-01-2004 05:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration