码迷,mamicode.com
首页 > 系统相关 > 详细

linux大于2T的磁盘格式化

时间:2019-01-29 10:56:01      阅读:255      评论:0      收藏:0      [点我收藏+]

标签:yum   comm   info   ack   int   linux   using   hdp   sdi   

fdisk默认只能格式小于2T的磁盘,我们经常会碰到大于2T的磁盘,我们不能fdisk 格式化。

我们得用parted 来的格式化

parted 命令可能没有,yum install -y parted 

真实例子:

[root@ES-TY01 ~]# lsblk 
NAME                        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sdb                           8:16   0   9.1T  0 disk 
└─sdb1                        8:17   0   9.1T  0 part 
sdc                           8:32   0   9.1T  0 disk 
└─sdc1                        8:33   0   9.1T  0 part 
sdf                           8:80   0   9.1T  0 disk 
└─sdf1                        8:81   0   9.1T  0 part 
sde                           8:64   0   9.1T  0 disk 
└─sde1                        8:65   0   9.1T  0 part 
sdg                           8:96   0   9.1T  0 disk 
└─sdg1                        8:97   0   9.1T  0 part 
sda                           8:0    0 446.6G  0 disk 
├─sda1                        8:1    0   700M  0 part /boot/efi
├─sda2                        8:2    0   100M  0 part 
├─sda3                        8:3    0     2G  0 part 
├─sda4                        8:4    0   500M  0 part /boot
└─sda5                        8:5    0 443.4G  0 part 
  ├─VolGroup-lv_root (dm-0) 253:0    0    50G  0 lvm  /
  ├─VolGroup-lv_swap (dm-1) 253:1    0     4G  0 lvm  [SWAP]
  └─VolGroup-lv_home (dm-2) 253:2    0 389.4G  0 lvm  /home
sdh                           8:112  0   9.1T  0 disk 
└─sdh1                        8:113  0   9.1T  0 part 
sdd                           8:48   0   9.1T  0 disk 
sdi                           8:128  0   9.1T  0 disk 
└─sdi1                        8:129  0   9.1T  0 part 
sdj                           8:144  0   9.1T  0 disk 
└─sdj1                        8:145  0   9.1T  0 part 
sdk                           8:160  0   9.1T  0 disk 
└─sdk1                        8:161  0   9.1T  0 part 
sdl                           8:176  0   9.1T  0 disk 
└─sdl1                        8:177  0   9.1T  0 part 
sdm                           8:192  0   9.1T  0 disk 
└─sdm1                        8:193  0   9.1T  0 part 

我们看到sdd还没格式化:

[root@ES-TY01 ~]# parted /dev/sdd
GNU Parted 2.1
Using /dev/sdd
Welcome to GNU Parted! Type help to view a list of commands.
(parted) p                                                                
Model: DELL PERC H730P Mini (scsi)
Disk /dev/sdd: 10.0TB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start  End  Size  File system  Name  Flags

(parted) mkpart                                                           
Partition name?  []? sdd1                                                 
File system type?  [ext2]? ext4                                           
Start? 0                                                                  
End? 10.0TB                                                               
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? Ignore                                                     
(parted) p                                                                
Model: DELL PERC H730P Mini (scsi)
Disk /dev/sdd: 10.0TB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start   End     Size    File system  Name  Flags
 1      17.4kB  10.0TB  10.0TB               sdd1

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

 

[root@ES-TY02 ~]# mkfs.ext4 /dev/sde1
mke2fs 1.41.12 (17-May-2010)
/dev/sde1 alignment is offset by 3072 bytes.
This may result in very poor performance, (re)-partitioning suggested.
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=1 blocks, Stripe width=0 blocks
610369536 inodes, 2441478135 blocks
122073906 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
74508 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, 1934917632

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

This filesystem will be automatically checked every 22 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

 

 

 

一个10T的磁盘,最终大小的SIZE 大约是9T,Avail SIZE 是8.5T,所以相当于损失1.5T,可用率是85%。

[root@hdp08 ~]# df -Th
Filesystem           Type   Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
                     ext4    50G  6.5G   41G  14% /
tmpfs                tmpfs  127G   36K  127G   1% /dev/shm
/dev/sda4            ext4   477M   40M  413M   9% /boot
/dev/sda1            vfat   696M  304K  696M   1% /boot/efi
/dev/mapper/VolGroup-lv_home
                     ext4   384G   67M  364G   1% /home
/dev/sdb1            ext4   9.0T   29G  8.5T   1% /cloud/data01
/dev/sdc1            ext4   9.0T   29G  8.5T   1% /cloud/data02
/dev/sdd1            ext4   9.0T   30G  8.5T   1% /cloud/data03
/dev/sde1            ext4   9.0T   28G  8.5T   1% /cloud/data04
/dev/sdf1            ext4   9.0T   32G  8.5T   1% /cloud/data05
/dev/sdg1            ext4   9.0T   32G  8.5T   1% /cloud/data06
/dev/sdh1            ext4   9.0T   32G  8.5T   1% /cloud/data07
/dev/sdi1            ext4   9.0T   32G  8.5T   1% /cloud/data08
/dev/sdj1            ext4   9.0T   33G  8.5T   1% /cloud/data09
/dev/sdk1            ext4   9.0T   30G  8.5T   1% /cloud/data10
/dev/sdl1            ext4   9.0T   26G  8.5T   1% /cloud/data11
/dev/sdm1            ext4   9.0T   28G  8.5T   1% /cloud/data12

 

linux大于2T的磁盘格式化

标签:yum   comm   info   ack   int   linux   using   hdp   sdi   

原文地址:https://www.cnblogs.com/shanhua-fu/p/10332618.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!