![]() ![]() Resizing the filesystem on /dev/sdb to 262144 (4k) blocks. ![]() If it is absent, the file system is grown as much as the underlying device allows: # umount /ext4ĮXT4: 11/65536 files (0.0% noncontiguous), 12955/230400 blocks We can also grow it with or without the size parameter. ![]() The filesystem on /dev/sdb is now 230400 blocks long. Resizing the filesystem on /dev/sdb to 230400 (4k) blocks. Pass 1: Checking inodes, blocks, and sizes We can shrink an ext4 filesystem but first we have to umount it and run e2fsck on it: # df /ext4 # tune2fs -U random /dev/sdd3 → regenerate the UUID # tune2fs -L OSVAR /dev/sda4 → relabel the filesystem The tune2fs command can also be used to change some of the parameters above (check man tune2fs): # tune2fs -E stride=16,stripewidth=64 /dev/sdb4 → change stride & stripesize Journal features: journal_incompat_revoke Journal backup: inode blocks root:~> dumpe2fs -h /dev/sdb1įilesystem created: Wed Apr 29 21:43:41 2015 We can use the commands tune2fs or dumpe2fs to check the characteristics of an ext4 file system: root:~> tune2fs -l /dev/sdbįilesystem UUID: 92b72a5998134406aa66ab140ead30a7įilesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery extent 64bit flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isizeįilesystem created: Sun Apr 5 11:56:14 2015ĭirectory Hash Seed: 368f137a36be4932850c74c024b671f5 If our needs are a bit more esoteric than that we should check man mkfs.ext4 for an exhaustive list of options. The -D flag indicates that I/O on this filesystem should not use the OS buffer and use direct I/O instead. The -b option sets the OS block size to a value (1024, 2048 or 4096) other than its default of 512 bytes. There are 2 additional options we might use: # mkfs -t ext4 -b 4096 -D /dev/sda3 We set the stride size to 16KB and stripe-width to 64KB so we’re dealing with a group of 4 disk drives. The command above would create an ext4 filesystem meant to be included in a RAID or LVM setup. # mkfs -t ext4 -E stride=16,stripe-width=64 /dev/sda2 ![]() If we explicitly set any of the them, it will probably be stride and stripe-width. Most of the options will rarely need changing. We can look at the configuration file /etc/nf to see what the default values are for newly created ext4 file systems (and ext3). Writing superblocks and filesystem accounting information: doneįilesystem Size Used Avail Use% Mounted on The ext4 filesystem is the 4th version of ext file systems and adds some improvements over ext3: use of extents (as opposed to 512 byte OS blocks), pre-allocation, delayed allocation, stripe-aware allocation, capable of handling more and bigger files and directories, etc.Ĭreating an ext4 file system is simple provided the disk has already been labeled and partitioned: # mkfs -t ext4 /dev/sda1Ģ4934 blocks (5.00%) reserved for the super userĨ192 blocks per group, 8192 fragments per groupĨ193, 24577, 40961, 57345, 73729, 204801, 221185, 401409 ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |