linux ext4无法使用超过16T磁盘的解决办法推荐

系统环境:Centos6.7 x86_64 己updte磁盘:12*4T raid5 +hot说明:操作系统与归档都使用同一个raid5

应用环境:邮局系统【文件大小从1K到100K不等,除附件】

一、查看分区 【fdisk -l】

[root@localhostsysadmin]#fdisk-lWARNING:GPT(GUIDPartitionTable)detectedon'/dev/sda'!Theutilfdiskdoesn'tsupportGPT.UseGNUParted.Disk/dev/sda:40000.0GB,39999997214720bytes255heads,63sectors/track,4863055cylindersUnits=cylindersof16065*512=8225280bytesSectorsize(logical/physical):512bytes/512bytesI/Osize(minimum/optimal):512bytes/512bytesDiskidentifier:0x00000000DeviceBootStartEndBlocksIdSystem/dev/sda112673502147483647+eeGPT

说明:此时文件系统己经超过16T,OS默认将其转换成了GPT格式的,所以使用fdisk无法查看到准确的分区信息。

二、使用parted 查看分区信息

[root@localhostsysadmin]#partedGNUParted2.1Using/dev/sdaWelcometoGNUParted!Type'help'toviewalistofcommands.(parted)pModel:LSIAOC-USAS2LP-H8iR(scsi)Disk/dev/sda:40.0TBSectorsize(logical/physical):512B/512BPartitionTable:gptNumberStartEndSizeFilesystemNameFlags11049kB525MB524MBext42525MB263GB262GBext43263GB284GB21.0GBext44284GB288GB4295MBlinux-swap(v1)

三、将余下的空间都分为/archive 作为归档的根目录

(parted)mkpart/archive288G-1(parted)pModel:LSIAOC-USAS2LP-H8iR(scsi)Disk/dev/sda:40.0TBSectorsize(logical/physical):512B/512BPartitionTable:gptNumberStartEndSizeFilesystemNameFlags11049kB525MB524MBext42525MB263GB262GBext43263GB284GB21.0GBext44284GB288GB4295MBlinux-swap(v1)5288GB40.0TB39.7TB/archive(parted)q

四、查看分区

[root@localhost~]#fdisk/dev/sdasdasda1sda2sda3sda4sda5[root@localhost~]#

说明:此时己经找到新的分区【sda5】

五、修改/etc/mke2fd.conf

#vim/etc/mke2fs.conf[fs_types]ext3={features=has_journal}ext4={features=has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isizeauto_64-bit_support=1#添加这一行inode_size=256}

六、下载e2fsprogs-1.42.13.tar.gz

[root@localhost~]#wget-chttp://jaist.dl.sourceforge.net/project/e2fsprogs/e2fsprogs/v1.42.8/e2fsprogs-1.42.13.tar.gz[root@localhoste2fsprogs-1.42.13]#pwd/home/sysadmin/e2fsprogs-1.42.13[root@localhoste2fsprogs-1.42.13]#cdbuild/[root@localhostbuild]#../configure[root@localhostbuild]#make makeinstall

七、格式化分区

[root@localhost~]#mke2fs-O64bit,has_journal,extents,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize-i2048/dev/sda5[root@localhostbuild]#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格式说明:

-b 区块大小 :指定区块大小,单位为字节; -c;检查是否有损坏的区块; -f 不连续区段大小 :指定不连续区段的大小,单位为字节; -F:不管指定的设备为何,强制执行mke2fs; -i 字节 :指定”字节/inode”的比例; -N:指定要建立的inode数目; -l 文件 :从指定的文件中,读取文件西中损坏区块的信息; -L 标签 :设置文件系统的标签名称; -m 百分比值 :指定给管理员保留区块的比例,预设为5%; -M:记录最后一次挂入的目录; -q:执行时不显示任何信息; -r:指定要建立的ext2文件系统版本; -R= 区块数 :设置磁盘阵列参数; -S:仅写入superblock与group descriptors,而不更改inode able inode bitmap以及block bitmap; -v:执行时显示详细信息; -V:显示版本信息。

八、将对应的分区挂载即可以使用

[root@localhostbuild]#df-hFilesystemSizeUsedAvailUse%Mountedon/dev/sda320G2.4G16G14%/tmpfs7.8G07.8G0%/dev/shm/dev/sda1477M80M372M18%/boot/dev/sda2241G120M228G1%/home/dev/sda536T20K34T1%/archive[root@localhostbuild]#df-iFilesystemInodesIUsedIFreeIUse%Mountedon/dev/sda312811209121411899068%/tmpfs2040386120403851%/dev/shm/dev/sda1128016461279701%/boot/dev/sda2160071681955160052131%/home/dev/sda542937815361142937815251%/archive

九、查看磁盘信息

[root@localhostbuild]#tune2fs-l/dev/sda5tune2fs1.42.13(17-May-2015)Filesystemvolumename: none Lastmountedon: notavailable FilesystemUUID:3b5789ee-94c2-4296-bd99-5669200d826aFilesystemmagicnumber:0xEF53Filesystemrevision#:1(dynamic)Filesystemfeatures:has_journalext_attrdir_indexfiletypeneeds_recoveryextent64bitflex_bgsparse_superhuge_fileuninit_bgdir_nlinkextra_isizeFilesystemflags:signed_directory_hashDefaultmountoptions:user_xattraclFilesystemstate:cleanErrorsbehavior:ContinueFilesystemOStype:LinuxInodecount:4293781536Blockcount:9695327232Reservedblockcount:484766361Freeblocks:9426221107Freeinodes:4293781525Firstblock:0Blocksize:4096Fragmentsize:4096Groupdescriptorsize:64Blockspergroup:32768Fragmentspergroup:32768Inodespergroup:14512Inodeblockspergroup:907Flexblockgroupsize:16Filesystemcreated:ThuOct1515:27:562015Lastmounttime:ThuOct1515:33:502015Lastwritetime:ThuOct1515:33:502015Mountcount:1Maximummountcount:33Lastchecked:ThuOct1515:27:562015Checkinterval:15552000(6months)Nextcheckafter:TueApr1215:27:562016Lifetimewrites:202MBReservedblocksuid:0(userroot)Reservedblocksgid:0(grouproot)Firstinode:11Inodesize:256Requiredextraisize:28Desiredextraisize:28Journalinode:8Defaultdirectoryhash:half_md4DirectoryHashSeed:56a5949a-5a49-4bc9-810d-9a9e2aa2109bJournalbackup:inodeblocks

捕捉最后的流星,坐在最高的山顶上,可以听音乐,聊电影,

linux ext4无法使用超过16T磁盘的解决办法推荐

相关文章:

你感兴趣的文章:

标签云: