linux 格式化大于2T的硬盘

2T以下的硬盘,分区类型多为MBR,但MBR的最大容量大约是2.15T,超过3T的硬盘必须用GPT格式。

1  选择要格式化的硬盘

[root@quanzidian /]# parted /dev/sdb
GNU Parted 2.1
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted)

2  选择GPT类型

(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?

3  然后输入yes

(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? yes
(parted)

4  将硬盘分成一个分区  

(parted) mkpart  prinmary 1  -1
(parted)

5  查看分区 

(parted) print
Model: ATA HGST HUS724040AL (scsi)
Disk /dev/sdb: 4001GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name      Flags
 1      1049kB  4001GB  4001GB  ext2         prinmary

(parted)

6  退出分区

(parted) quit
Information: You may need to update /etc/fstab.

7  格式化文件系统为ext4

[root@quanzidian /]# mkfs.ext4 /dev/sdb1
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
244195328 inodes, 976754176 blocks
48837708 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
29809 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, 512000000, 550731776, 644972544

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 26 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@quanzidian /]#

8  查看分区

[root@quanzidian /]# parted /dev/sdb print
Model: ATA HGST HUS724040AL (scsi)
Disk /dev/sdb: 4001GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name      Flags
 1      1049kB  4001GB  4001GB  ext4         prinmary

[root@quanzidian /]#

9  创建目录

[root@quanzidian /]# mkdir /video

10  给目录赋权限

[root@quanzidian /]# chmod 755 /video/

11  挂载硬盘

[root@quanzidian /]# mount /dev/sdb1 /video/

12  查看分区

[root@quanzidian /]# df -Hl
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_quanzidian-lv_root
                       53G  3.8G   47G   8% /
tmpfs                 2.0G   78k  2.0G   1% /dev/shm
/dev/sda2             500M   44M  430M  10% /boot
/dev/sda1             210M  271k  210M   1% /boot/efi
/dev/mapper/vg_quanzidian-lv_home
                      927G   76M  880G   1% /home
/dev/sdb1             4.0T   72M  3.8T   1% /video
[root@quanzidian /]#

13  设置开机启动

[root@quanzidian /]# vi /etc/fstab

加入

/dev/sdb1               /video                  ext4    defaults        0 0

wq  保存退出

 

转载于:https://my.oschina.net/ailoveai5521/blog/737359

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值