功能
归档
231
2018 年 06 月 16 日
CentOS 操作一块9T的硬盘

实验平台:CentOS 7.4
fdisk只能操作最大为2T容量的磁盘


操作步骤:


一、查看系统磁盘


$ fdisk -l

Disk /dev/vda: 42.9 GB, 42949672960 bytes, 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x0008de3e

   Device Boot      Start         End      Blocks   Id  System
/dev/vda1   *        2048    83884031    41940992   83  Linux

Disk /dev/sdc: 9896.9 GB, 9896849672960 bytes, 8323886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x0008de3e

二、操作磁盘


1.使用parted命令操作大于2T的磁盘

$ parted /dev/sdc
#操作/dev/sdc这块磁盘
GNU Parted 3.1
Using /dev/sdc
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel gpt
#选择gpt格式
(parted) mkpart p1
#选择磁盘格式
File system type?  [ext2]? ext3     
#选择为ext3格式
Start? 0             
#开始容量
End? 9T   
#结束容量
eg:(这里也可以使用unit TB;修改单位为TB)
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? Ignore                                                     
(parted) p  
#列出已有磁盘信息
Model: DELL MD38xxf (scsi)
Disk /dev/sdc: 9896GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name  Flags
 1      17.4kB  9000GB  9000GB               p1

2.格式化磁盘

$ mkfs.ext3 -T largefile /dev/sdc1 
#mkfs.ext3需要加参数才能操作超大磁盘,此操作磁盘越大需要时间越长
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
8583168 inodes, 2197265620 blocks
109863281 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
67056 block groups
32768 blocks per group, 32768 fragments per group
128 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

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

3.挂载磁盘

$ mount /dev/sdc1 /homt/ftp/upload

三、测试


$ fdisk -l

Disk /dev/vda: 42.9 GB, 42949672960 bytes, 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x0008de3e

   Device Boot      Start         End      Blocks   Id  System
/dev/vda1   *        2048    83884031    41940992   83  Linux

Disk /dev/sdc: 9896.9 GB, 9896849672960 bytes, 8323886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x0008de3e


   Device Boot      Start         End           Blocks      Id  System
/dev/sdc1   *        2048    9896849672960    41941230992   83   gpt
df -lh
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        40G  6.5G   31G  18% /
devtmpfs        911M     0  911M   0% /dev
tmpfs           920M   84K  920M   1% /dev/shm
tmpfs           920M  416K  920M   1% /run
tmpfs           920M     0  920M   0% /sys/fs/cgroup
tmpfs           184M     0  184M   0% /run/user/0
/dev/sdc1       9.0T    6M  8.9T   1% /home/ftp/upload

Over~

zhifubao_pay                weixin_pay

本站的发展离不开您的资助,金额随意,感谢来赏!


转载原创文章请注明,转载自: 林里克斯 » CentOS 操作一块9T的硬盘
留言
Loading...

发表评论

电子邮件地址不会被公开。 必填项已用*标注