LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 04-14-2007, 12:15 PM   #1
flycast
Member
 
Registered: Jul 2006
Posts: 87

Rep: Reputation: 15
Find out how a disk was partitioned


I have a disk that I know nothing about except that it was partitioned with EXT2 or EXT3. How can I determine if it was EXT2 or EXT3?
 
Old 04-14-2007, 12:26 PM   #2
cmnorton
Member
 
Registered: Feb 2005
Distribution: Ubuntu, CentOS
Posts: 585

Rep: Reputation: 35
/etc/fstab

Look in /etc/fstab
 
Old 04-14-2007, 01:29 PM   #3
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Milwaukee, WI
Distribution: Mint
Posts: 6,642

Rep: Reputation: 69
Also just run
Code:
fdisk -l
Not all partitions on a drive may be listed in fstab
 
Old 04-14-2007, 01:43 PM   #4
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
I think that fdisk will respond with 83 for ext2, ext3 and even Reiserfs.

First, if necessary use fdisk -l to check if the partition is a Linux partition. Then use "sudo file -s /dev/<dev>".

For example:
Code:
jschiwal@hpamd64:~> sudo /sbin/fdisk -l /dev/hda
root's password:

Disk /dev/hda: 100.0 GB, 100030242816 bytes
255 heads, 63 sectors/track, 12161 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
...
/dev/hda5            3983        3994       96358+  83  Linux
...

jschiwal@hpamd64:~> sudo file -s /dev/hda5
/dev/hda5: Linux rev 1.0 ext3 filesystem data (needs journal recovery)
You could also use the "dumpe2fs" program to print out information on the filesystem. If it indicates a journal and journal size, it is ext3. If you have an ext2 filesystem, you can use tune2fs to add journaling, making it ext3.

Just some trivia. After the ext2 filesystem support was included in the kernel, Linus decided that any new features would be included in a new version instead of having different versions of ext2 to deal with. This made ext2 universally compatible. Now that ext3 support is included in the kernel, any new features will go in ext4 which is under development.
This way, an ext3 filesystem will be able to be mounted in an older kernel even if it was created on a newer one.

Last edited by jschiwal; 04-14-2007 at 01:56 PM.
 
Old 04-14-2007, 08:04 PM   #5
flycast
Member
 
Registered: Jul 2006
Posts: 87

Original Poster
Rep: Reputation: 15
Thanks jschiwal,
That is exactly what I needed. I was setting up a drive that was not in the fstab file. Turned out that I ran it as a ext2 for a while and it was powered down by my son and his foot (accidentally) on the power cord. Now that I have it properly identified as Ext3 hopefully I can prevent some damage!

Thanks again!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
easy way to resize dual-boot partitioned hard disk? bjharker Linux - Newbie 5 07-11-2006 11:38 PM
Disk is already fully (1) partitioned with XP, how can I squeeze a new partition in? garvey Linux - Software 7 11-03-2005 03:02 PM
external partitioned usb hard disk mr_a_ali Linux - Hardware 2 08-14-2004 10:22 AM
Problem with boot loaders in a partitioned disk! tolis Linux - General 1 03-01-2004 02:01 PM
remounting a lvm partitioned disk on new box seastar Linux - Software 5 01-21-2004 11:21 PM


All times are GMT -5. The time now is 07:56 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration