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

Posted John08

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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:
Number  Start  End  Size  File system  Name  Flags

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:

Number  Start   End     Size    File system  Name  Flags
 1      17.4kB  4799GB  4799GB               data
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, 644972544

Allocating 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
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda5       1.1T  990M  1.1T   1% /
devtmpfs        189G     0  189G   0% /dev
tmpfs           189G     0  189G   0% /dev/shm
tmpfs           189G  9.0M  189G   1% /run
tmpfs           189G     0  189G   0% /sys/fs/cgroup
/dev/sda2       976M   86M  824M  10% /boot
tmpfs            38G     0   38G   0% /run/user/0
/dev/sdb1       4.4T   89M  4.2T   1% /data

5、完成

 

以上是关于Linux下大容量磁盘分区格式化的主要内容,如果未能解决你的问题,请参考以下文章

Linux磁盘系统——管理磁盘的命令

Linux 分区 磁盘分区与格式化

Linux如何创建并挂载虚拟磁盘

linux------磁盘分区,格式化,检验与挂载

VMware下Linux根分区磁盘扩容

为虚拟机下的linux扩容了硬盘的容量,怎么分区啊?