Tuesday, May 17, 2011

Steps to create and mount ext4 filesystem

Syntax: 

mkfs.ext4  "Device Name"

(or)

mke2fs -t ext4 "Device Name"


Example:
[root@hostxyz bin]# mkfs.ext4 /dev/sda3

mke4fs 1.41.9 (22-Aug-2009)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
67108864 inodes, 268435456 blocks
13421772 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
8192 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
        102400000, 214990848

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

[root@hostxyz ~]# mkdir /ext4_filesystem

[root@hostxyz ~]# mount -t ext4 /dev/sda3  /ext4_filesystem


[root@hostxyz ~]# file -sL /dev/sda3
/dev/sda3: Linux rev 1.0 ext4 filesystem data (needs journal recovery) (extents) (large files) (huge files)
[root@hostxyz ~]#

Note: Ext4 filesystem is available starting from Kernel 2.6.19. Incase your server don't have the "ext4" package installed, you can avail it by installing the latest version of "e4fsprogs" rpm.
(URL to download for CentOS: http://pkgs.org/package/e4fsprogs ).
However it is recommended to use the Ext4 filesystem from the kernel version mentioned above to get the full advantage of it.

2 comments:

  1. Hey! I just wanted to ask if you ever have any trouble with hackers?
    My last blog (wordpress) was hacked and I ended up losing a
    few months of hard work due to no back up. Do you have any methods to
    prevent hackers?
    Here is my web site - Work from home

    ReplyDelete
  2. The other day, while I was at work, my cousin stole my iPad and tested to see if it can survive a 25 foot drop, just so she
    can be a youtube sensation. My iPad is now destroyed and she has 83 views.
    I know this is completely off topic but I had
    to share it with someone!
    My webpage: how To lose Man boobs

    ReplyDelete