parted分区
[root@localhost ~]# parted /dev/sdb
GNU Parted 3.1
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mktable 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) print
Model: ATA ST1000NM0055-1V4 (scsi)
Disk /dev/sdb: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
(parted) mkpart 创建分区
Partition name? []? sdb1
File system type? [ext2]? ext4
Start? 0
End? 1000GB
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? i
(parted) print
Model: ATA ST1000NM0055-1V4 (scsi)
Disk /dev/sdb: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 17.4kB 1000GB 1000GB sdb1
(parted) quit
Information: You may need to update /etc/fstab.
[root@localhost ~]#
格式化磁盘
[root@localhost ~]# 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
61054976 inodes, 244190637 blocks
12209531 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2392850432
7453 block groups
32768 blocks per group, 32768 fragments per group
8192 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
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
[root@localhost ~]#
临时挂载
[root@localhost ~]# mkdir /PGtest
[root@localhost ~]# mount /dev/sdb1 /PGtest/
[root@localhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda6 295G 152G 129G 55% /
devtmpfs 32G 0 32G 0% /dev
tmpfs 32G 20K 32G 1% /dev/shm
tmpfs 32G 9.4M 32G 1% /run
tmpfs 32G 0 32G 0% /sys/fs/cgroup
/dev/sda2 477M 138M 311M 31% /boot
/dev/sda3 493G 6.8G 461G 2% /mnt/syncdata
/dev/sda4 99G 267M 94G 1% /var/log/imoslog
tmpfs 6.3G 0 6.3G 0% /run/user/1000
tmpfs 6.3G 0 6.3G 0% /run/user/0
/dev/sdb1 917G 77M 871G 1% /PGtest
[root@localhost ~]#
永久挂载
vim /etc/fstab 增加一行记录
/dev/sdb1 /PGtest ext4 defaults 0 0
磁盘坏道检查
badblocks -v /dev/sda1
分区信息查看
https://www.cnblogs.com/youbiyoufang/p/7607174.html