Solution for ext4 failure to use a disk larger than 16 TB in centos

Source: Internet
Author: User

Solution for ext4 failure to use a disk larger than 16 TB in centos
System Environment: Centos6.7 x86_64 updte
Disk: 12*4 T raid5 + hot
Note: raid5 is used for both the operating system and archiving.

1. view the partition [fdisk-l]
[Root @ localhost sysadmin] # fdisk-l
WARNING: GPT (GUID Partition Table) detected on '/dev/sda '! The util fdisk doesn' t support GPT. Use GNU Parted.
Disk/dev/sda: 40000.0 GB, 39999997214720 bytes
255 heads, 63 sectors/track, 4863055 cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Sector size (logical/physical): 512 bytes/512 bytes
I/O size (minimum/optimal): 512 bytes/512 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/Dev/sda1 1 267350 2147483647 + ee GPT Description: At this time, the file system has exceeded 16 TB, and the OS converts it to the GPT format by default, therefore, you cannot view accurate partition information using fdisk. Ii. Use parted to view partition information [root @ localhost sysadmin] # parted
GNU parted2.1
Using/dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(Parted) p
Model: LSI AOC-USAS2LP-H8iR (scsi)
Disk/dev/sda: 40.0 TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 1049kB 525 MB 524 MB ext4
2 525 MB 263 GB 262 GB ext4
3 263 GB 284 GB 21.0 GB ext4
4 284 GB 288 GB 4295 MB linux-swap (v1) divides the remaining space into/archive as the archive root directory (parted) mkpart/archive 288 GB-1
(Parted) p
(Parted) p
Model: LSI AOC-USAS2LP-H8iR (scsi)
Disk/dev/sda: 40.0 TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 1049kB 525 MB 524 MB ext4
2 525 MB 263 GB 262 GB ext4
3 263 GB 284 GB 21.0 GB ext4
4 284 GB 288 GB 4295 MB linux-swap (v1)
5 288 GB 40.0 TB 39.7 TB/archive (parted) q 3. View partitions
[Root @ localhost ~] # Fdisk/dev/sda
Sda sda1 sda2 sda3 sda4 sda5 [root @ localhost ~] # Note: The new partition "sda5" has been found]
4. Modify/etc/mke2fd. conf
Shell # vim/etc/mke2fs. conf
[Fs_types]
Ext3 = {
Features = has_journal
}
Ext4 = {
Features = has_journal, extent, huge_file, flex_bg, uninit_bg, dir_nlink, extra_isize
Auto_64-bit_support = 1 # Add this line
Inode_size = 256
Download e2fsprogs-1.42.13.tar.gz shell # wget-c Release e2fsprogs-1.42.13] # pwd
/Home/sysadmin/e2fsprogs-1.42.13
[Root @ localhost e2fsprogs-1.42.13] # cd build/
[Root @ localhost build] # ../configure
....
[Root @ localhost build] # make & make install 6. format the partition [root @ localhost ~] # Mke2fs-O 64bit, has_journal, extents, huge_file, flex_bg, uninit_bg, dir_nlink, extra_isize-I 2048/dev/sda5
[Root @ localhost build] # blkid
/Dev/sda1: UUID = "908a3c8e-6d6a-4e01-8cad-2094ea99751f" TYPE = "ext4"
/Dev/sda3: UUID = "b533714f-4cb9-4394-907d-8d1ead424c85" TYPE = "ext4"
/Dev/sda2: UUID = "0a0ec20e-b50b-4d89-9fa6-65602e4e8a3d" TYPE = "ext4"
/Dev/sda4: TYPE = "swap" UUID = "b8e89719-670f-4b26-bbf3-86d13a1f935e"
/Dev/sda5: UUID = "3b5789ee-94c2-4296-bd99-5669200d826a" TYPE = "ext4" mke2fs format description:-B <block size>: Specifies the block size, in bytes;
-C; check for damaged blocks;
-F <size of discontinuous segments>: specify the size of discontinuous segments, in bytes;
-F: mke2fs is enforced regardless of the specified device;
-I <byte>: Specifies the ratio of "Byte/inode;
-N: specifies the number of inode to be created;
-L <File>: reads information about damaged blocks in the western part of a specified file;
-L <tag>: Set the tag name of the file system;
-M <percentage value>: Specifies the percentage of blocks reserved by the Administrator. The default value is 5%;
-M: records the last mounted directory.-q: No information is displayed during execution;
-R: Specifies the version of the ext2 file system to be created;
-R = <number of blocks>: Set disk array parameters;
-S: Write only superblock and group descriptors without changing inode able inode bitmap and block bitmap;
-V: detailed information is displayed during execution;
-V: displays version information.


7. Mount the corresponding partition.
[Root @ localhost build] # df-h
Filesystem Size Used Avail Use % Mounted on
/Dev/sda3 20g 2.4G 16G 14%/
Tmpfs 7.8G 0 7.8G 0%/dev/shm
/Dev/sda1 477 M 80 M 372 M 18%/boot
/Dev/sda2 241G 120 M 228G 1%/home
/Dev/sda5 36 T 20 KB 34 T 1%/archive
[Root @ localhost build] # df-I
Filesystem Inodes IUsed IFree IUse % Mounted on
/Dev/sda3 1281120 91214 1189906 8%/
Tmpfs 2040386 1 2040385 1%/dev/shm
/Dev/sda1 128016 46 127970 1%/boot
/Dev/sda2 16007168 1955 16005213 1%/home
/Dev/sda5 4293781536 11 4293781525 1%/archive view disk information [root @ localhost build] # tune2fs-l/dev/sda5
Tune2fs 1.42.13 (17-May-2015)
Filesystem volume name: <none>
Last mounted on: <not available>
Filesystem UUID: 3b5789ee-94c2-4296-bd99-5669200d826a
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr dir_index filetype needs_recovery extent 64bit flex_bg sparse_super huge_file uninit_bg dir_nlink extra_isize
Filesystem flags: signed_directory_hash
Default mount options: user_xattr acl
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 4293781536
Block count: 9695327232
Reserved block count: 484766361
Free blocks: 9426221107
Free inodes: 4293781525
First block: 0
Block size: 4096
Fragment size: 4096
Group descriptor size: 64
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 14512
Inode blocks per group: 907
Flex block group size: 16
Filesystem created: Thu Oct 15:27:56 2015
Last mount time: Thu Oct 15 15:33:50 2015
Last write time: Thu Oct 15 15:33:50 2015
Mount count: 1
Maximum mount count: 33
Last checked: Thu Oct 15:27:56 2015
Check interval: 15552000 (6 months)
Next check after: Tue Apr 12 15:27:56 2016
Lifetime writes: 202 MB
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 256
Required extra isize: 28
Desired extra isize: 28
Journal inode: 8
Default directory hash: half_md4
Directory Hash Seed: 56a5949a-5a49-4bc9-810d-9a9e2aa2109b
Journal backup: inode blocks

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.