Recent Changes - Search:


Code:


Social:


My journals will take the place of a blog. If you go to the Journal page there is an RSS feed to subscribe with.

« July 2017 
SunMonTueWedThuFriSat
      1
2345678
9101112131415
16171819202122
23242526272829
3031     

Sites I take responsibility for

West Volusia, Florida

Documents

Technical

General

Me

Living

Places I frequent

Hobbies

Humor

Items for sale:


Clipboard

edit SideBar

Linux Filesystems

Include our styles below Infobox - invoke as >>infobox<< ... >><<

Codebox: - invoke as >>codebox<< ... >><<

warnbox: - invoke as >>codebox<< ... >><<

editingbox: - invoke as >>codebox<< ... >><<

noticebox: - invoke as >>codebox<< ... >><<

Page bread crumbs: Welcome to ke3vin.org! - My Public Technical Notes - Software And Operating Systems - Linux - Howtos - Linux Filesystems

Pages by tags: (:listtags:)
Subscribe to this wiki: RSS Feed RSS or subscribe to this page for changes: RSS Feed RSS
496 articles have been published so far. Recent changes
Share

2016-03-22: This site is being moved to my main site at https://kevininscoe.com/wiki as part of a consolidation to one domain.


How to identify filesystem type:

Method 1: Use df -T Command

The -T option in the df command displays the file system type.

 # df -T | awk '{print $1,$2,$NF}' | grep "^/dev"
 /dev/sda1 ext2 /
 /dev/sdb1 ext3 /home
 /dev/sdc1 ext3 /u01

Method 2: Use Mount Command

Use the mount command as shown below.

 # mount | grep "^/dev"
 /dev/sda1 on / type ext2 (rw)
 /dev/sdb1 on /home type ext3 (rw)
 /dev/sdc1 on /u01 type ext3 (rw)

Method 3: Use file Command

As root, use the file command as shown below. You need to pass the individual device name to the file command.

 # file -sL /dev/sda1
 /dev/sda1: Linux rev 1.0 ext2 filesystem data (mounted or unclean) (large files)

 # file -sL /dev/sdb1
 /dev/sda1: Linux rev 1.0 ext3 filesystem data (needs journal recovery)(large files)

 # file -sL /dev/sdc1
 /dev/sda1: Linux rev 1.0 ext3 filesystem data (needs journal recovery)(large files)

Note: You should execute the file command as root user. If you execute as non-root user, you’ll still get some output. But, that will not display the file system type as shown below.

 $ file -sL /dev/sda1
 /dev/sda1: writable, no read permission

Method 4: Use fsck Command

Execute the fsck command as shown below. This will display the file system type of a given device.

 # fsck -N /dev/sda1
 fsck 1.39 (29-May-2006)
 [/sbin/fsck.ext2 (1) -- /] fsck.ext2 /dev/sda1

 # fsck -N /dev/sdb1
 fsck 1.39 (29-May-2006)
 [/sbin/fsck.ext3 (1) -- /home] fsck.ext3 /dev/sdb1

 # fsck -N /dev/sdc1
 fsck 1.39 (29-May-2006)
 [/sbin/fsck.ext3 (1) -- /u01] fsck.ext3 /dev/sdc1

ext2:

Ext2 stands for second extended file system. It was introduced in 1993. Developed to overcome the limitation of the original ext file system. Ext2 does not have journaling feature. On flash drives, usb drives, ext2 is recommended, as it doesn’t need to do the over head of journaling.

Maximum individual file size can be from 16 GB to 2 TB.
Overall ext2 file system size can be from 2 TB to 32 TB

Create an ext2 file system:

 # mke2fs /dev/sda1

ext3:

Ext3 stands for third extended file system. It was introduced in 2001. From Linux Kernel 2.4.15 ext3 was available. The main benefit of ext3 is that it allows journaling. Journaling has a dedicated area in the file system, where all the changes are tracked. When the system crashes, the possibility of file system corruption is less because of journaling.

Maximum individual file size can be from 16 GB to 2 TB.
Overall ext3 file system size can be from 2 TB to 32 TB

There are three types of journaling available in ext3 file system.

  1. Journal – Metadata and content are saved in the journal.
  2. Ordered – Only metadata is saved in the journal. Metadata are journaled only after writing the content to disk. This is the default.
  3. Writeback – Only metadata is saved in the journal. Metadata might be journaled either before or after the content is written to the disk.

You can convert a ext2 file system to ext3 file system directly (without backup/restore).

Create an ext3 file system:

 # mkfs.ext3 /dev/sda1

or

 # mke2fs –j /dev/sda1

Converting ext2 to ext3

For example, if you are upgrading /dev/sda2 that is mounted as /home, from ext2 to ext3, do the following.

 # umount /dev/sda2
 # tune2fs -j /dev/sda2
 # mount /dev/sda2 /home

Note: You really don’t need to umount and mount it, as ext2 to ext3 conversion can happen on a live file system. But, I feel better doing the conversion offline.

ext4:

Ext4 stands for fourth extended file system. It was introduced in 2008 starting from Linux Kernel 2.6.19. Supports huge individual file size and overall file system size.

Maximum individual file size can be from 16 GB to 16 TB.
Overall maximum ext3 file system size is 1 EB (exabyte).
1 EB = 1024 PB (petabyte).\\ 1 PB = 1024 TB (terabyte).

Directory can contain a maximum of 64,000 subdirectories (as opposed to 32,000 in ext3). You can also mount an existing ext3 fs as ext4 fs (without having to upgrade it). Several other new features are introduced in ext4: multiblock allocation, delayed allocation, journal checksum. fast fsck, etc. All you need to know is that these new features have improved the performance and reliability of the filesystem when compared to ext3. In ext4, you also have the option of turning the journaling feature off.

Create an ext4 file system:

 # mkfs.ext4 /dev/sda1

or

 # mke2fs -t ext4 /dev/sda1

Converting ext3 to ext4:

If you are upgrading /dev/sda2 that is mounted as /home, from ext3 to ext4, do the following.

 # umount /dev/sda2
 # tune2fs -O extents,uninit_bg,dir_index /dev/sda2
 # e2fsck -pf /dev/sda2
 # mount /dev/sda2 /home

Kevin's Public Wiki maintained and created by Kevin P. Inscoe is licensed under a
Creative Commons Attribution 3.0 United States License.

Back to my web site - http://kevininscoe.com

Edit - History - Print - Recent Changes - Search
Page last modified on May 16, 2011, at 07:27 AM EST