<p><a href="http://www.chinabyte.com/keyword/Linux/" rel="noopener noreferrer" target="_blank"><span style="color:rgb(51,51,51)">Linux</span></a><span style="color:rgb(85,85,85)">下分区详解之-Parted</span></p>
<p><span style="color:rgb(85,85,85)"> 通常我们用的比较多的一般都是fdisk工具来进行分区,但是现在由于</span><a href="http://www.chinabyte.com/keyword/%E7%A3%81%E7%9B%98/" rel="noopener noreferrer" target="_blank"><span style="color:rgb(51,51,51)">磁盘</span></a><span style="color:rgb(85,85,85)">越来越廉价,而且磁盘空间越来越大;而fdisk工具他对分区是有大小限制的,它只能划分小于2T的磁盘。但是现在的磁盘空间很多都已经是远远大于2T了,甚至达到2.5T和3T,那要怎么办能,有两个方法,其一是通过卷管理来实现,其二就是通过我们今天谈到的Parted工具来实现对GPT磁盘进行分区操作。</span></p>
<p><span style="color:rgb(85,85,85)"> GPT格式的磁盘相当于原来MBR磁盘中原来保留4个partition table的4*16个字节,只留第一个16个字节,类似于扩展分区,真正的partitiontable在512字节之后,GPT磁盘没有四个主分区的限制。</span></p>
<p><span style="color:rgb(85,85,85)"> 1、 Parted工具详解:</span></p>
<p><span style="color:rgb(85,85,85)"> 1.1 进入Parted的方法(在命令行输入Parted命令即可)</span></p>
<p><span style="color:rgb(85,85,85)"> [root@jetsen ~]# partet</span></p>
<p><span style="color:rgb(85,85,85)"> Warning: Unable to open/dev/hdc read-write (Read-only file system)。 /dev/hdc has been</span></p>
<p><span style="color:rgb(85,85,85)"> opened read-only.</span></p>
<p><span style="color:rgb(85,85,85)"> GNU Parted 1.8.1</span></p>
<p><span style="color:rgb(85,85,85)"> Using /dev/hdc</span></p>
<p><span style="color:rgb(85,85,85)"> Welcome to GNU Parted! Type'help' to view a</span><a href="http://www.chinabyte.com/keyword/List/" rel="noopener noreferrer" target="_blank"><span style="color:rgb(51,51,51)">list</span></a><span style="color:rgb(85,85,85)"> of commands.</span></p>
<p><span style="color:rgb(85,85,85)"> (parted)</span></p>
<p><span style="color:rgb(85,85,85)"> 1.2 获取parted工具帮助的方法:(只需输入help即可)</span></p>
<p><span style="color:rgb(85,85,85)"> (parted) help</span></p>
<p><span style="color:rgb(85,85,85)"> check NUMBER do a simple checkon the file system</span></p>
<p><span style="color:rgb(85,85,85)"> cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another partition</span></p>
<p><span style="color:rgb(85,85,85)"> help [COMMAND] prints general help,or help on COMMAND</span></p>
<p><span style="color:rgb(85,85,85)"> mklabel,mktable LABEL-TYPE create a new disklabel(partition table)</span></p>
<p><span style="color:rgb(85,85,85)"> mkfs NUMBER</span><a href="http://www.chinabyte.com/keyword/fs/" rel="noopener noreferrer" target="_blank"><span style="color:rgb(51,51,51)">FS</span></a><span style="color:rgb(85,85,85)">-TYPE make a FS-TYPE filesystem on partititon</span></p>
<p><span style="color:rgb(85,85,85)"> NUMBER</span></p>
<p><span style="color:rgb(85,85,85)"> mkpart PART-TYPE [FS-TYPE] START END make a partition</span></p>
<p><span style="color:rgb(85,85,85)"> mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system</span></p>
<p><span style="color:rgb(85,85,85)"> move NUMBER START END move partition NUMBER</span></p>
<p><span style="color:rgb(85,85,85)"> name NUMBER NAME name partition NUMBERas NAME</span></p>
<p><span style="color:rgb(85,85,85)"> print [free|NUMBER|all] display the partition table,a partition, or</span></p>
<p><span style="color:rgb(85,85,85)"> all devices</span></p>
<p><span style="color:rgb(85,85,85)"> quit exit program</span></p>
<p><span style="color:rgb(85,85,85)"> rescue START END rescue a lostpartition near START and END</span></p>
<p><span style="color:rgb(85,85,85)"> resize NUMBER START END resize partition NUMBER andits file system</span></p>
<p><span style="color:rgb(85,85,85)"> rm NUMBER deletepartition NUMBER</span></p>
<p><span style="color:rgb(85,85,85)"> select DEVICE choose the deviceto edit</span></p>
<p><span style="color:rgb(85,85,85)"> set NUMBER FLAG STATE change the FLAG onpartition NUMBER</span></p>
<p><span style="color:rgb(85,85,85)"> toggle [NUMBER [FLAG]] toggle the state of FLAG onpartition NUMBER</span></p>
<p><span style="color:rgb(85,85,85)"> unit UNIT set the defaultunit to UNIT</span></p>
<p><span style="color:rgb(85,85,85)"> version displays thecurrent version of GNU Parted</span></p>
<p><span style="color:rgb(85,85,85)"> and copyright information</span></p>
<p><span style="color:rgb(85,85,85)"> (parted)</span></p>
<p><span style="color:rgb(85,85,85)"> 或</span></p>
<p><span style="color:rgb(85,85,85)"> [root@jetsen ~]# parted--help</span></p>
<p><span style="color:rgb(85,85,85)"> Usage: parted [OPTION]…[DEVICE [COMMAND [PARAMETERS]…]…]</span></p>
<p><span style="color:rgb(85,85,85)"> Apply COMMANDs withPARAMETERS to DEVICE. If no COMMAND(s)are given, run in</span></p>
<p><span style="color:rgb(85,85,85)"> interactive mode.</span></p>
<p> |
|