LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-11-2009, 06:10 AM   #1
EmrldDrgn
Member
 
Registered: Oct 2008
Posts: 40

Rep: Reputation: 16
Check file system type of a partition


I'm trying to check the type of file system (ntfs, ext2, xfs, etc.) on a partition. I cannot guarantee that the partition will be mounted when I do this. fdisk -l on the disk gets me closest of the options I have found, but it only says "Linux" for ext3, "Linux/Solaris" for swap, and various other non-specific descriptions. How can I do this?

Thanks
 
Old 07-11-2009, 06:11 AM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
try
mount
 
Old 07-11-2009, 06:20 AM   #3
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
For unmounted linux partitions you can try
Code:
file -s <device name>
where the device name is /dev/sda1, /dev/sda2, /dev/hda1 and so on. You can determine the actual device from the output of fdisk.

For mounted partitions you can use
Code:
df -T
or the mount command without arguments, as suggested by repo above.
 
Old 07-11-2009, 07:56 AM   #4
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Hi,

'parted' is another great utility that can be used to identify or work with partitions.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
An error Occurred during the file system check. Dropping you to shell; the system wil aneikei Linux - Newbie 3 02-11-2010 07:38 PM
PCLOS: Boot error: file system type is ext2fs; partition is 0x83, and error 13 dpeirce Linux - Distributions 3 09-29-2008 10:48 PM
file system type ust Linux - Software 5 04-08-2008 03:09 PM
How to know partition file system type? Hondro Slackware 4 11-28-2006 03:28 AM
help! system halts while partition check during startup xak Linux - Hardware 3 08-28-2003 09:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:12 PM.

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