![]() |
新闻中心
当前位置:网站首页 > 新闻中心
云服务器硬盘如何分区
云服务器硬盘如何分区?一般我们在安装云服务器操作系统的过程中,已经对系统硬盘进行了分区,但如果新添加了一块硬盘,想要正常使用,在 Linux 中有专门的分区命令 fdisk 和 parted。
其中 fdisk 命令较为常用,但不支持大于 2TB 的分区;如果需要支持大于 2TB 的分区,则需要使用 parted 命令,当然 parted 命令也能分配较小的分区。我们先来看看如何使用 fdisk 命令进行分区。
fdisk 命令的格式如下:
[root@localhost ~]# fdisk ~l#列出系统分区[root@localhost ~]# fdisk 设备文件名#给硬盘分区
注意,千万不要在当前的硬盘上尝试使用 fdisk,这会完整删除整个系统,一定要再找一块硬盘,或者使用虚拟机。
以硬盘 /dev/sdb 为例做练习,命令如下:
[root@localhost ~]# fdisk /dev/sdb#给/dev/sdb分区Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabelBuilding a new DOS disklabel with disk identifier 0xed7e8bc7.Changes will remain in memory only, until you decide to write them.After that, of course, the previous content wont be recoverable.Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)WARNING: DOS-compatible mode is deprecated.its strongly recommended to switch off the mode (command c) and change display units to sectors (command u).Command (m for help):m#交互界面的等待输入指令的位置,输入 m 得到帮助Command action#可用指令a toggle a bootable flagb edit bsd disklabelc toggle the dos compatibility flagd delete a partitionI list known partition types m print this menun add a new partitiono create a new empty DOS partition tablep print the partition tableq quit without saving changess create a new empty Sun disklabelt change a partitions system idu change display/entry unitsv verity the partition tablew write table to disk and exitx extra functionality (experts only)
注意这里的分区命令是 fdisk /dev/sdb,这是因为硬盘并没有分区,使用 fdisk 命令的目的就是建立分区。
飞帆软件云服务器简单易用,稳定可靠,主机vCPU、内存各项性能指标业界领先,满足不断变化的用户需求。云服务器产品链接 http://www.zbff.com?/cloudhost/
上一篇 移动互联网应用IPv6网络兼容性云测平台发布上线 下一篇 云服务器如何更换语言
|