{"id":192,"date":"2012-03-21T15:25:33","date_gmt":"2012-03-21T07:25:33","guid":{"rendered":"http:\/\/www.eumz.com\/?p=192"},"modified":"2012-03-21T15:25:33","modified_gmt":"2012-03-21T07:25:33","slug":"linux%e7%9a%84parted%e5%91%bd%e4%bb%a4%e7%9a%84%e7%94%a8%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.wxcn.com\/?p=192","title":{"rendered":"linux\u7684parted\u547d\u4ee4\u7684\u7528\u6cd5"},"content":{"rendered":"<p>[root@libftp ~]# <span style=\"color: #99cc00;\">fdisk -l<\/span><\/p>\n<p>Disk \/dev\/cciss\/c0d0: 1000.1 GB, 1000171331584 bytes<br \/>\n255 heads, 63 sectors\/track, 121597 cylinders<br \/>\nUnits = cylinders of 16065 * 512 = 8225280 bytes<\/p>\n<p>Device Boot&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Start&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Blocks&nbsp;&nbsp; Id System<br \/>\n\/dev\/cciss\/c0d0p1&nbsp;&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;33&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;265041&nbsp;&nbsp; 83 Linux<br \/>\n\/dev\/cciss\/c0d0p2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;34&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;116105&nbsp;&nbsp; 932348340&nbsp;&nbsp; 83 Linux<br \/>\n\/dev\/cciss\/c0d0p3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;116106&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;118655&nbsp;&nbsp;&nbsp;&nbsp;20482875&nbsp;&nbsp; 83 Linux<br \/>\n\/dev\/cciss\/c0d0p4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;118656&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;121597&nbsp;&nbsp;&nbsp;&nbsp;23631615&nbsp;&nbsp;&nbsp;&nbsp;5 Extended<br \/>\n\/dev\/cciss\/c0d0p5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;118656&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;120567&nbsp;&nbsp;&nbsp;&nbsp;15358108+ 83 Linux<br \/>\n\/dev\/cciss\/c0d0p6&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;120568&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;121587&nbsp;&nbsp;&nbsp;&nbsp; 8193118+ 82 Linux swap \/ Solaris<\/p>\n<p>WARNING: GPT (GUID Partition Table) detected on &#8216;\/dev\/cciss\/c0d1&#8217;! The util fdisk doesn&#8217;t support GPT. Use GNU Parted.<\/p>\n<p>Disk \/dev\/cciss\/c0d1: 4000.6 GB, 4000684662784 bytes<br \/>\n255 heads, 63 sectors\/track, 486388 cylinders<br \/>\nUnits = cylinders of 16065 * 512 = 8225280 bytes<\/p>\n<p>Device Boot&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Start&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Blocks&nbsp;&nbsp; Id System<br \/>\n\/dev\/cciss\/c0d1p1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;267350 2147483647+ ee EFI GPT<br \/>\n\u4f7f\u7528parted\u547d\u4ee4\uff1a<br \/>\n[root@libftp ~]# <span style=\"color: #99cc00;\">parted<\/span> \/dev\/cciss\/c0d1<br \/>\nGNU Parted 1.8.1<br \/>\nUsing \/dev\/cciss\/c0d1<br \/>\nWelcome to GNU Parted! Type &#8216;help&#8217; to view a list of commands.<br \/>\n(parted) mklabel gpt<br \/>\nWarning: The existing disk label on \/dev\/cciss\/c0d1 will be destroyed and all data on this disk will be lost. Do you want to<br \/>\ncontinue?<br \/>\nYes\/No? y<br \/>\nNew disk label type? [gpt]? gpt<br \/>\n\u4e0b\u4e00\u6b65\uff1a\u7531MBR\u8f6c\u4e3aGPT\u78c1\u76d8<br \/>\n(parted) <span style=\"color: #99cc00;\">mkpart primary 0<\/span> 4000GB<br \/>\nprint\uff1a<br \/>\n(parted) print&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n<p>Model: Compaq Smart Array (cpqarray)<br \/>\nDisk \/dev\/cciss\/c0d1: 4001GB<br \/>\nSector size (logical\/physical): 512B\/512B<br \/>\nPartition Table: gpt<\/p>\n<p>Number Start&nbsp;&nbsp; End&nbsp;&nbsp;&nbsp;&nbsp; Size&nbsp;&nbsp;&nbsp;&nbsp;File system Name&nbsp;&nbsp;&nbsp;&nbsp; Flags<br \/>\n1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;17.4kB 4001GB 4001GB&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; primary&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n<p>(parted) quit<br \/>\nInformation: Don&#8217;t forget to update \/etc\/fstab, if necessary.<br \/>\n\u4e0b\u4e00\u6b65\uff1a\u683c\u5f0f\u5316<br \/>\n[root@libftp ~]# <span style=\"color: #99cc00;\">mkfs.ext3 -F<\/span> \/dev\/cciss\/c0d1<br \/>\nmke2fs 1.39 (29-May-2006)<br \/>\nFilesystem label=<br \/>\nOS type: Linux<br \/>\nBlock size=4096 (log=2)<br \/>\nFragment size=4096 (log=2)<br \/>\n488374272 inodes, 976729654 blocks<br \/>\n48836482 blocks (5.00%) reserved for the super user<br \/>\nFirst data block=0<br \/>\nMaximum filesystem blocks=0<br \/>\n29808 block groups<br \/>\n32768 blocks per group, 32768 fragments per group<br \/>\n16384 inodes per group<br \/>\nSuperblock backups stored on blocks:<br \/>\n32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,<br \/>\n4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,<br \/>\n102400000, 214990848, 512000000, 550731776, 644972544<\/p>\n<p>Writing inode tables: done<br \/>\nCreating journal (32768 blocks): done<br \/>\nWriting superblocks and filesystem accounting information: done<\/p>\n<p>This filesystem will be automatically checked every 22 mounts or<br \/>\n180 days, whichever comes first. Use tune2fs -c or -i to override.<br \/>\n\u6b64\u65f6\u6ce8\u610f\u4e8b\u9879\uff1amkfs.ext3 -F&nbsp;&nbsp; \u540e\u9762\u8981\u8ddf\u4e0a -F<br \/>\n\u4e0b\u4e00\u6b65 \uff1a\u6302\u8f7d<br \/>\n[root@libftp ~]# mkdir -p \/mnt\/cciss\/c0d1<br \/>\n[root@libftp ~]#<span style=\"color: #99cc00;\"> mount<\/span> \/dev\/cciss\/c0d1 \/mnt\/cciss\/c0d1<br \/>\n\u67e5\u770b\uff1a<br \/>\n[root@libftp ~]# df -h<br \/>\nFilesystem&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Size Used Avail Use% Mounted on<br \/>\n\/dev\/cciss\/c0d0p5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;15G 1.8G&nbsp;&nbsp; 12G 13% \/<br \/>\n\/dev\/cciss\/c0d0p3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;19G 173M&nbsp;&nbsp; 18G&nbsp;&nbsp; 1% \/usr\/local<br \/>\n\/dev\/cciss\/c0d0p2&nbsp;&nbsp;&nbsp;&nbsp; 862G 200M 817G&nbsp;&nbsp; 1% \/else<br \/>\n\/dev\/cciss\/c0d0p1&nbsp;&nbsp;&nbsp;&nbsp; 251M&nbsp;&nbsp; 21M 218M&nbsp;&nbsp; 9% \/boot<br \/>\ntmpfs&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2.0G&nbsp;&nbsp;&nbsp;&nbsp; 0 2.0G&nbsp;&nbsp; 0% \/dev\/shm<br \/>\n\/dev\/cciss\/c0d1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3.6T 197M 3.4T&nbsp;&nbsp; 1% \/mnt\/cciss\/c0d1<\/p>\n<p>\u5f00\u673a\u81ea\u52a8\u6302\u8f7d\u8fd9\u5757\u786c\u76d8\uff1avi \/etc\/rc.local\u52a0\u4e0a\uff1a<br \/>\nmount \/dev\/cciss\/c0d1 \/mnt\/cciss\/c0d1<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[root@libftp ~]# fdisk -l Disk \/dev\/cciss\/c0d0: 1000.1  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[183,216,376],"class_list":["post-192","post","type-post","status-publish","format-standard","hentry","category-operating-system","tag-linux-2","tag-parted","tag-376"],"_links":{"self":[{"href":"https:\/\/www.wxcn.com\/index.php?rest_route=\/wp\/v2\/posts\/192","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wxcn.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wxcn.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wxcn.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wxcn.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=192"}],"version-history":[{"count":0,"href":"https:\/\/www.wxcn.com\/index.php?rest_route=\/wp\/v2\/posts\/192\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wxcn.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=192"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wxcn.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=192"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wxcn.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=192"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}