Linux下大容量磁盘分区格式化

万事须己运,他得非我贤。这篇文章主要讲述Linux下大容量磁盘分区格式化相关的知识,希望能为你提供帮助。
【Linux下大容量磁盘分区格式化】本文介绍使用parted给大容量磁盘分区格式化。
1、标记磁盘分区表类型

[root@vertica-bk ~]# parted /dev/sdb GNU Parted 3.1 Using /dev/sdb Welcome to GNU Parted! Type \'help\' to view a list of commands. (parted) mklabel gpt Warning: The existing disk label on /dev/sdb will be destroyed and all data on this disk will be lost. Do you want to continue? Yes/No? y (parted) p Model: DELL PERC H730P (scsi) Disk /dev/sdb: 4799GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags: NumberStartEndSizeFile systemNameFlags

2、分区
(parted) mkpart Partition name?[]? data File system type?[ext2]? ext4 Start? 0 End? 100% Warning: The resulting partition is not properly aligned for best performance. Ignore/Cancel? ignore (parted) p Model: DELL PERC H730P (scsi) Disk /dev/sdb: 4799GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags:NumberStartEndSizeFile systemNameFlags 117.4kB4799GB4799GBdata quit

3、格式化
[root@vertica-bk ~]# mkfs.ext4 /dev/sdb1 mke2fs 1.42.9 (28-Dec-2013) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 146440192 inodes, 1171521527 blocks 58576076 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=3319791616 35752 block groups 32768 blocks per group, 32768 fragments per group 4096 inodes per group 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, 644972544Allocating group tables: done Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done

4、挂载
[root@vertica-bk ~]# blkid /dev/sda2: UU TYPE="ext4" /dev/sda3: UU TYPE="swap" /dev/sda5: UU TYPE="ext4" /dev/sdb1: UU TYPE="ext4" PARTLABEL="data" PARTUU [root@vertica-bk ~]# vim /etc/fstab -bash: vim: command not found [root@vertica-bk ~]# vi /etc/fstab [root@vertica-bk ~]# mount -a [root@vertica-bk ~]# df -h FilesystemSizeUsed Avail Use% Mounted on /dev/sda51.1T990M1.1T1% / devtmpfs189G0189G0% /dev tmpfs189G0189G0% /dev/shm tmpfs189G9.0M189G1% /run tmpfs189G0189G0% /sys/fs/cgroup /dev/sda2976M86M824M10% /boot tmpfs38G038G0% /run/user/0 /dev/sdb14.4T89M4.2T1% /data

5、完成

    推荐阅读