云服务器硬盘如何分区?一般在安装云服务器操作系统的过程中,我们已经对系统硬盘进行了分区,但是如果你添加了一个新的硬盘,想要正常使用,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 disklabel Building 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 won't be recoverable. Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) WARNING: DOS-compatible mode is deprecated.it's 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 flag b edit bsd disklabel c toggle the dos compatibility flag d delete a partition I list known partition types m print this menu n add a new partition o create a new empty DOS partition table p print the partition table q quit without saving changes s create a new empty Sun disklabel t change a partition's system id u change display/entry units v verity the partition table w write table to disk and exit x extra functionality (experts only)
注意这里的分区命令是“fdisk /dev/sdb”。这是因为硬盘没有分区。使用 fdisk 命令的目的是创建一个分区。
西数云服务器简单易用,稳定可靠,主机vCPU和内存性能指标行业领先,满足不断变化的用户需求。云服务器产品链接
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/dianqi/article-380277-1.html
你如果在伊拉克对美国说“关你鸟事”
它仍然会嬉皮笑脸的试探
自己一不留神成为首富就不知道话怎么讲了