{"id":9,"date":"2012-03-18T15:04:01","date_gmt":"2012-03-18T07:04:01","guid":{"rendered":"http:\/\/www.datarelab.com\/blog\/?p=9"},"modified":"2012-03-18T15:04:01","modified_gmt":"2012-03-18T07:04:01","slug":"linux%20--%20parted%20%e5%88%86%e5%8c%ba%e5%b7%a5%e5%85%b7%e4%bd%bf%e7%94%a8","status":"publish","type":"post","link":"https:\/\/www.datarelab.com\/blog\/Technical_literature\/9.html","title":{"rendered":"Linux -- parted \u5206\u533a\u5de5\u5177\u4f7f\u7528"},"content":{"rendered":"<p><span style=\"color:#4C33E5;\">\u4ece\u4e32\u884c\u6280\u672f\u51fa\u73b0\u4ee5\u6765\uff0c\u8d8a\u6765\u8d8a\u591a\u5ba2\u6237\u9009\u62e9\u4f7f\u7528\u5927\u5bb9\u91cf\u7684SATA\u786c\u76d8\u521b\u5efa\u78c1\u76d8\u9635\u5217\uff1b\u7279\u522b\u662fMD1000\/MD3000\uff0c\u5f88\u8f7b\u6613\u5c31\u7a81\u78342T\u7684LUN\uff0c\u6545\u5728\u6b64\u7ed9\u5927\u5bb6\u4e00\u4e9b\u6307\u5f15\u3002<\/span><br \/>\n<span style=\"color:#E53333;\">\u7ea2\u5e3d\u4f01\u4e1a Linux 4 Update 4\u4f9b\u5bf9\u5927\u4e8e 2 terabytes\uff08TB\uff09\u7684\u78c1\u76d8\u8bbe\u5907\u7684\u652f\u6301\u3002<\/span><\/p>\n<p><span style=\"color:#4C33E5;\">\u8bf7\u53c2\u8003\u4ee5\u4e0b\u64cd\u4f5c\u6b65\u9aa4\uff1a&nbsp;<\/span><br \/>\n<span style=\"color:#4C33E5;\"> \u6ce8\uff1a&nbsp;<\/span><br \/>\n<span style=\"color:#4C33E5;\"> \u84dd\u8272\u4ee3\u8868\u4f60\u9700\u8981\u4f7f\u7528\u7684\u547d\u4ee4&nbsp;<\/span><br \/>\n<span style=\"color:#4C33E5;\"> \u7ea2\u8272\u4ee3\u8868\u4f60\u9700\u8981\u6ce8\u610f\u5230\u7684\u8f93\u51fa\u4fe1\u606f\uff0c\u5728\u540e\u7eed\u9700\u8981\u4f7f\u7528&nbsp;<\/span><\/p>\n<p>[root@as4 ~]# <span style=\"color:#4C33E5;\">fdisk -l<\/span><br \/>\nDisk \/dev\/sda: 35.8 GB, 35862976512 bytes&nbsp;<br \/>\n255 heads, 63 sectors\/track, 4360 cylinders&nbsp;<br \/>\nUnits = cylinders of 16065 * 512 = 8225280 bytes<br \/>\n&nbsp; &nbsp;Device Boot &nbsp; &nbsp; &nbsp;Start &nbsp; &nbsp; &nbsp; &nbsp; End &nbsp; &nbsp; &nbsp;Blocks &nbsp; Id &nbsp;System&nbsp;<br \/>\n\/dev\/sda1 &nbsp; * &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;13 &nbsp; &nbsp; &nbsp;104391 &nbsp; 83 &nbsp;Linux&nbsp;<br \/>\n\/dev\/sda2 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;14 &nbsp; &nbsp; &nbsp; &nbsp; 144 &nbsp; &nbsp; 1052257+ &nbsp;82 &nbsp;Linux swap&nbsp;<br \/>\n\/dev\/sda3 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 145 &nbsp; &nbsp; &nbsp; &nbsp;4360 &nbsp; &nbsp;33865020 &nbsp; 83 &nbsp;Linux<br \/>\nDisk \/dev\/sdb: 2147 MB, 2147483648 bytes&nbsp;<br \/>\n255 heads, 63 sectors\/track, 261 cylinders&nbsp;<br \/>\nUnits = cylinders of 16065 * 512 = 8225280 bytes<br \/>\n<span style=\"color:#E53333;\">Disk \/dev\/sdb doesn't contain a valid partition table&nbsp;<\/span><br \/>\n[root@as4 ~]# <span style=\"color:#4C33E5;\">parted \/dev\/sdb&nbsp;<\/span><br \/>\nGNU Parted 1.6.19&nbsp;<br \/>\nCopyright (C) 1998 - 2004 Free Software Foundation, Inc.&nbsp;<br \/>\nThis program is free software, covered by the GNU General Public License.<br \/>\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY&nbsp;<br \/>\nWARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A&nbsp;<br \/>\nPARTICULAR PURPOSE. &nbsp;See the GNU General Public License for more details.<br \/>\n\u4f7f\u7528 \/dev\/sdb&nbsp;<br \/>\n(parted) <span style=\"color:#4C33E5;\">mklabel gpt&nbsp;<\/span><br \/>\n(parted) <span style=\"color:#4C33E5;\">print&nbsp;<\/span><br \/>\n\/dev\/sdb \u7684\u78c1\u76d8\u51e0\u4f55\u7ed3\u6784\uff1a<span style=\"color:#E53333;\">0.000-2048.000 \u5146<\/span>\u5b57\u8282&nbsp;<br \/>\n\u78c1\u76d8\u6807\u7b7e\u7c7b\u578b\uff1a<span style=\"color:#E53333;\">gpt&nbsp;<\/span><br \/>\nMinor &nbsp; &nbsp;\u8d77\u59cb\u70b9 &nbsp; &nbsp; &nbsp; &nbsp;\u7ec8\u6b62\u70b9 &nbsp;\u6587\u4ef6\u7cfb\u7edf &nbsp; &nbsp;\u540d\u79f0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\u6807\u5fd7&nbsp;<br \/>\n(parted) <span style=\"color:#4C33E5;\">mkpart primary 0 2048<\/span>&nbsp;<br \/>\n(parted) <span style=\"color:#4C33E5;\">print&nbsp;<\/span><br \/>\n\/dev\/sdb \u7684\u78c1\u76d8\u51e0\u4f55\u7ed3\u6784\uff1a0.000-2048.000 \u5146\u5b57\u8282&nbsp;<br \/>\n\u78c1\u76d8\u6807\u7b7e\u7c7b\u578b\uff1a<span style=\"color:#E53333;\">gpt&nbsp;<\/span><br \/>\nMinor &nbsp; &nbsp;\u8d77\u59cb\u70b9 &nbsp; &nbsp; &nbsp; &nbsp;\u7ec8\u6b62\u70b9 &nbsp;\u6587\u4ef6\u7cfb\u7edf &nbsp; &nbsp;\u540d\u79f0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\u6807\u5fd7&nbsp;<br \/>\n<span style=\"color:#E53333;\">1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0.017 &nbsp; 2047.983&nbsp;<\/span><br \/>\n(parted) <span style=\"color:#4C33E5;\">quit&nbsp;<\/span><br \/>\n\u4fe1\u606f: \u5982\u679c\u5fc5\u8981\uff0c\u4e0d\u8981\u5fd8\u8bb0\u66f4\u65b0 \/etc\/fstab\u3002<br \/>\n[root@as4 ~]# <span style=\"color:#4C33E5;\">fdisk -l<\/span><br \/>\nDisk \/dev\/sda: 35.8 GB, 35862976512 bytes&nbsp;<br \/>\n255 heads, 63 sectors\/track, 4360 cylinders&nbsp;<br \/>\nUnits = cylinders of 16065 * 512 = 8225280 bytes<br \/>\n&nbsp; &nbsp;Device Boot &nbsp; &nbsp; &nbsp;Start &nbsp; &nbsp; &nbsp; &nbsp; End &nbsp; &nbsp; &nbsp;Blocks &nbsp; Id &nbsp;System&nbsp;<br \/>\n\/dev\/sda1 &nbsp; * &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;13 &nbsp; &nbsp; &nbsp;104391 &nbsp; 83 &nbsp;Linux&nbsp;<br \/>\n\/dev\/sda2 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;14 &nbsp; &nbsp; &nbsp; &nbsp; 144 &nbsp; &nbsp; 1052257+ &nbsp;82 &nbsp;Linux swap&nbsp;<br \/>\n\/dev\/sda3 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 145 &nbsp; &nbsp; &nbsp; &nbsp;4360 &nbsp; &nbsp;33865020 &nbsp; 83 &nbsp;Linux<br \/>\n<span style=\"color:#E53333;\">WARNING: GPT (GUID Partition Table) detected on '\/dev\/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.<\/span><br \/>\n<span style=\"color:#E53333;\"> &nbsp;<\/span><br \/>\n<span style=\"color:#E53333;\"> Disk \/dev\/sdb: 2147 MB, 2147483648 bytes&nbsp;<\/span><br \/>\n<span style=\"color:#E53333;\"> 255 heads, 63 sectors\/track, 261 cylinders&nbsp;<\/span><br \/>\n<span style=\"color:#E53333;\"> Units = cylinders of 16065 * 512 = 8225280 bytes<\/span><br \/>\n<span style=\"color:#E53333;\"> &nbsp; &nbsp;Device Boot &nbsp; &nbsp; &nbsp;Start &nbsp; &nbsp; &nbsp; &nbsp; End &nbsp; &nbsp; &nbsp;Blocks &nbsp; Id &nbsp;System&nbsp;<\/span><br \/>\n<span style=\"color:#E53333;\"> \/dev\/sdb1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1 &nbsp; &nbsp; &nbsp; &nbsp; 262 &nbsp; &nbsp; 2097151+ &nbsp;ee &nbsp;EFI GPT&nbsp;<\/span><br \/>\n<span style=\"color:#E53333;\"> Partition 1 has different physical\/logical beginnings (non-Linux?):&nbsp;<\/span><br \/>\n<span style=\"color:#E53333;\"> &nbsp; &nbsp; &nbsp;phys=(0, 0, 1) logical=(0, 0, 2)&nbsp;<\/span><br \/>\n<span style=\"color:#E53333;\"> Partition 1 has different physical\/logical endings:&nbsp;<\/span><br \/>\n<span style=\"color:#E53333;\"> &nbsp; &nbsp; &nbsp;phys=(1023, 254, 63) logical=(261, 21, 16)&nbsp;<\/span><br \/>\n[root@as4 ~]# <span style=\"color:#4C33E5;\">mkfs.ext3 \/dev\/sdb1<\/span>&nbsp;<br \/>\nmke2fs 1.35 (28-Feb-2004)&nbsp;<br \/>\nFilesystem label=&nbsp;<br \/>\nOS type: Linux&nbsp;<br \/>\nBlock size=4096 (log=2)&nbsp;<br \/>\nFragment size=4096 (log=2)&nbsp;<br \/>\n262144 inodes, 524279 blocks&nbsp;<br \/>\n26213 blocks (5.00%) reserved for the super user&nbsp;<br \/>\nFirst data block=0&nbsp;<br \/>\nMaximum filesystem blocks=536870912&nbsp;<br \/>\n16 block groups&nbsp;<br \/>\n32768 blocks per group, 32768 fragments per group&nbsp;<br \/>\n16384 inodes per group&nbsp;<br \/>\nSuperblock backups stored on blocks:&nbsp;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; 32768, 98304, 163840, 229376, 294912<br \/>\nWriting inode tables: done&nbsp;<br \/>\nCreating journal (8192 blocks): done&nbsp;<br \/>\nWriting superblocks and filesystem accounting information: done<br \/>\nThis filesystem will be automatically checked every 28 mounts or&nbsp;<br \/>\n180 days, whichever comes first. &nbsp;Use tune2fs -c or -i to override.&nbsp;<br \/>\n[root@as4 ~]# <span style=\"color:#4C33E5;\">mount \/dev\/sdb1 \/mnt&nbsp;<\/span><br \/>\n[root@as4 ~]# <span style=\"color:#4C33E5;\">df -h&nbsp;<\/span><br \/>\nFilesystem &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\u5bb9\u91cf &nbsp;\u5df2\u7528 \u53ef\u7528 \u5df2\u7528% \u6302\u8f7d\u70b9&nbsp;<br \/>\n\/dev\/sda3 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;32G &nbsp;2.6G &nbsp; 28G &nbsp; 9% \/&nbsp;<br \/>\n\/dev\/sda1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;99M &nbsp; 12M &nbsp; 82M &nbsp;13% \/boot&nbsp;<br \/>\nnone &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;252M &nbsp; &nbsp; 0 &nbsp;252M &nbsp; 0% \/dev\/shm&nbsp;<br \/>\n<span style=\"color:#E53333;\">\/dev\/sdb1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2.0G &nbsp; 36M &nbsp;1.9G &nbsp; 2% \/mnt<\/span><\/p>\n<div style=\"white-space:nowrap;\">\n\t\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u4ece\u4e32\u884c\u6280\u672f\u51fa\u73b0\u4ee5\u6765\uff0c\u8d8a\u6765\u8d8a\u591a\u5ba2\u6237\u9009\u62e9\u4f7f\u7528\u5927\u5bb9\u91cf\u7684SATA\u786c\u76d8\u521b\u5efa\u78c1\u76d8\u9635\u5217\uff1b\u7279\u522b\u662fMD1000\/MD3000\uff0c\u5f88 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[14,16],"class_list":["post-9","post","type-post","status-publish","format-standard","hentry","category-Technical_literature","tag-linux","tag-parted"],"views":1449,"_links":{"self":[{"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/posts\/9","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/comments?post=9"}],"version-history":[{"count":0,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/posts\/9\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/media?parent=9"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/categories?post=9"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/tags?post=9"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}