本文发布时间: 2019-Mar-22
查看系统信息[[email protected] ~]# cat /etc/redhat-releaseRed Hat Enterprise Linux Server release 5.5 (Tikanga)[[email protected] ~]# uname -r2.6.18-194.el5[[email protected] ~]# uname -aLinux localhost.localdomain 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:43 EDT 2010 i686 i686 i386 GNU/Linux[[email protected] log]# uname -r2.6.18-194.el5 //最小也的是2.6.18.24查看磁盘情况[[email protected] ~]# fdisk -lDisk /dev/sda: 21.4 GB, 21474836480 bytes255 heads, 63 sectors/track, 2610 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesDevice Boot Start End Blocks Id System/dev/sda1 * 1 65 522081 83 Linux/dev/sda2 66 196 1052257+ 82 Linux swap / Solaris/dev/sda3 197 2610 19390455 83 LinuxDisk /dev/sdb: 2190.4 GB, 2190433320960 bytes //已经是2T左右了255 heads, 63 sectors/track, 266305 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesDisk /dev/sdb doesn't contain a valid partition table[[email protected] ~]# rpm -qf /sbin/parted //安装工具包parted-1.8.1-27.el5[[email protected] ~]# parted /dev/sdb //开始对大容量的磁盘操作[[email protected] ~]# parted /dev/sdbGNU Parted 1.8.1使用/dev/sdbWelcome to GNU Parted! Type 'help' to view a list of commands.(parted) print free //第一次是打印不了信息的,因为没有错误:无法打开/dev/sdb -无法识别的磁盘标签。(parted) help //显示帮助信息check NUMBER do a simple check on the file systemcp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another partitionhelp [COMMAND] prints general help, or help on COMMANDmklabel,mktable LABEL-TYPE create a new disklabel (partition table)mkfs NUMBER FS-TYPE make a FS-TYPE file system on partititon NUMBERmkpart PART-TYPE [FS-TYPE] START END make a partitionmkpartfs PART-TYPE FS-TYPE START END make a partition with a file systemmove NUMBER START END move partition NUMBERname NUMBER NAME name partition NUMBER as NAMEprint [free|NUMBER|all] display the partition table, a partition, or all devicesquit exit programrescue START END rescue a lost partition near START and ENDresize NUMBER START END resize partition NUMBER and its file systemrm NUMBER delete partition NUMBERselect DEVICE choose the device to editset NUMBER FLAG STATE change the FLAG on partition NUMBERtoggle [NUMBER [FLAG]] toggle the state of FLAG on partition NUMBERunit UNIT set the default unit to UNITversion displays the current version of GNU Parted and copyright information(parted) mklabel //改变分区表的格式新的磁盘标签类型?gpt //设置为gpt的分区格式(parted) mkpart分区名称? []? /dev/sdb1 //填写分区名称文件系统类型? [ext2]? ext3 //填写格式化类型起始点?0//0代表是从第一个磁道开始的结束点?-1//-1是代表到最后一个磁道(parted) print freeModel: VMware, VMware Virtual S (scsi)Disk /dev/sdb: 2190GBSector size (logical/physical): 512B/512BPartition Table: gpt //修改为gpt格式Number Start End Size File system Name 标志1 17.4kB 2190GB 2190GB /dev/sdb1(parted)quit //退出2.6.24[[email protected] ~]# mkfs.ext3 -b 8192 /dev/sdb1[[email protected] ~]# mkfs.ext3 -F /dev’sdb1[[email protected] ~]# mount -t ext3 /dev/sdb1 /01-F是强制的意思-b 8192(8M)是指定块大小,8M只能支持到16TB的空间,如果还是比较大的话就多指定点就行了格式化会很长时间[[email protected] log]# mount -t ext3 /dev/sdb1 /01mount: wrong fs type, bad option, bad superblock on /dev/sdb1,missing codepage or other errorIn some cases useful info is found in syslog - trydmesg | tail or so[[email protected] log]# mkfs.ext3 -F /dev/sdb1 //添加-F参数就能解决这个问题mke2fs 1.39 (29-May-2006)Filesystem label=OS type: LinuxBlock size=4096 (log=2)Fragment size=4096 (log=2)267386880 inodes, 534773751 blocks26738687 blocks (5.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=016320 block groups32768 blocks per group, 32768 fragments per group16384 inodes per groupSuperblock backups stored on blocks:32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,102400000, 214990848, 512000000Writing inode tables: doneCreating journal (32768 blocks): doneWriting superblocks and filesystem accounting information: doneThis filesystem will be automatically checked every 30 mounts or180 days, whichever comes first. Use tune2fs -c or -i to override.[[email protected] log]#[[email protected] log]# mount -t ext3 /dev/sdb1 /01[[email protected] log]# df -h文件系统容量已用可用已用%挂载点/dev/sda3 18G 3.8G 14G 23% //dev/sda1 494M 17M 453M 4% /boottmpfs 506M 0 506M 0% /dev/shm/dev/sdb1 2.0T 199M 1.9T 1% /01就可以了


2019-May-25 12:57pm