Linux之让ext4分区支持大于16TB的格式化和挂载

  • A+
所属分类:Linux  Linux中级  Linux基础
[root@xenserver-DS-TestServer08 ~]# mkdir -p /tmp/e2fsprogs/build
[root@xenserver-DS-TestServer08 ~]# curl -Lk $(URL="https://sourceforge.net/projects/e2fsprogs/files/?source=navbar" && URL1=$(awk -F'/' '{print $3}' <<< $URL) && curl -Lks $URL|awk -F'"' '/tar.gz/{print "https://'$URL1'"$2;exit}') | tar xz -C /tmp/e2fsprogs --strip-components=1
[root@xenserver-DS-TestServer08 ~]# cd /tmp/e2fsprogs/build
[root@xenserver-DS-TestServer08 build]# yum -y install make gcc gcc-c++ automake
[root@xenserver-DS-TestServer08 build]# ../configure && make -j$(getconf _NPROCESSORS_ONLN) && make install
[root@xenserver-DS-TestServer08 build]# sed -i 'N;N;/ext4 =/a \\t\tauto_64-bit_support = 1' /etc/mke2fs.conf
[root@xenserver-DS-TestServer08 build]# mke2fs -O 64bit,has_journal,extents,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize -i 4194304 /dev/sdd1
mke2fs 1.43.4 (31-Jan-2017)
Creating filesystem with 732566385 4k blocks and 715424 inodes
Filesystem UUID: fda8888d-c512-4aaf-b38e-785c80d0283a
Superblock backups stored on blocks: 
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
        4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
        102400000, 214990848, 512000000, 550731776, 644972544

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information: done       

[root@xenserver-DS-TestServer08 build]# mount /dev/sdd1 /backup/
[root@xenserver-DS-TestServer08 build]# df -hP
Filesystem                                                                                                 Size  Used Avail Use% Mounted on
/dev/sdb1                                                                                                   18G  2.2G   15G  14% /
devtmpfs                                                                                                   2.0G     0  2.0G   0% /dev
tmpfs                                                                                                      2.0G  132K  2.0G   1% /dev/shm
tmpfs                                                                                                      2.0G  1.5M  2.0G   1% /run
tmpfs                                                                                                      2.0G     0  2.0G   0% /sys/fs/cgroup
xenstore                                                                                                   2.0G     0  2.0G   0% /var/lib/xenstored
/dev/loop0                                                                                                  55M   55M     0 100% /var/xen/xc-install
/dev/sdb5                                                                                                  4.0G  240M  3.6G   7% /var/log
tmpfs                                                                                                      394M     0  394M   0% /run/user/0
/dev/mapper/XSLocalEXT--aecd19e7--4f23--9b30--5bcc--b38fdb955423-aecd19e7--4f23--9b30--5bcc--b38fdb955423  1.8T  820G  921G  48% /run/sr-mount/aecd19e7-4f23-9b30-5bcc-b38fdb955423
/dev/sdd1                                                                                                  2.8T   89M  2.6T   1% /backup

参考链接:https://www.unix-ninja.com/p/Formatting_Ext4_volumes_beyond_the_16TB_limit

lookback

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: