{"id":2868,"date":"2020-05-27T15:14:30","date_gmt":"2020-05-27T07:14:30","guid":{"rendered":"http:\/\/learn-house.idv.tw\/?p=2868"},"modified":"2021-03-10T23:05:21","modified_gmt":"2021-03-10T15:05:21","slug":"%e8%bd%89linux-%e5%bb%ba%e7%ab%8b%e5%a4%a7%e9%81%8e-2tb-%e7%9a%84%e7%a1%ac%e7%a2%9f%e5%88%86%e5%89%b2%e5%8d%80","status":"publish","type":"post","link":"https:\/\/learn-house.idv.tw\/?p=2868","title":{"rendered":"Linux \u5efa\u7acb\u5927\u904e 2TB \u7684\u786c\u789f\u5206\u5272\u5340\u8207ext4\u683c\u5f0f\u5316"},"content":{"rendered":"<p>\u8cc7\u6599\u4f86\u6e90\uff1ahttps:\/\/www.opencli.com\/linux\/linux-create-larger-2tb-partition<\/p>\n<p>fdisk \u662f\u5341\u5206\u5e38\u7528\u7684\u786c\u789f\u5206\u5272\u5de5\u5177, \u4f46 fdisk \u6700\u5927\u554f\u984c\u662f, \u5efa\u7acb\u7684\u5206\u5272\u5340\u4e0a\u9650\u662f 2TB, \u6240\u4ee5\u4e0d\u80fd\u5efa\u7acb\u5927\u904e 2TB \u7684\u5206\u5272\u5340\u3002<\/p>\n<p>\u9019\u6642\u53ef\u4ee5\u4f7f\u7528\u53e6\u4e00\u500b parted \u6307\u4ee4, \u5b83\u53ef\u4ee5\u5efa\u7acb\u5927\u65bc 2TB \u7684\u5206\u5272\u5340\u3002\u4ee5\u4e0b\u662f parted \u7684\u4f7f\u7528\u65b9\u6cd5\u3002<\/p>\n<p>p.s. \u5982\u679c\u672a\u4f7f\u7528\u904e parted \u6307\u4ee4, \u5efa\u8b70\u5148\u5728\u4e00\u53f0\u6c92\u6709\u7684\u96fb\u8166\u4e0a\u8a66\u7528, \u56e0\u70ba parted \u6307\u4ee4\u6703\u5c0d\u57f7\u884c\u7acb\u5373\u5beb\u5165\u786c\u789f.<\/p>\n<p>\u672c\u7bc7\u9664\u4e86\u6559\u4f60\u5982\u4f55\u5206\u5272\uff0c\u4e5f\u6703\u5728\u5206\u5272\u5b8c\u5f8c\u9032\u884c\u683c\u5f0f\u5316\uff0c\u4e26\u9032\u884cmount\u6e2c\u8a66\uff0c\u540c\u6642\u82e5\u6709\u958b\u6a5f\u5c31mount\u9700\u6c42\u4e5f\u6703\u4e00\u4f75\u544a\u8a34\u4f60\u8a72\u600e\u9ebc\u505a<!--more--><\/p>\n<p><b>\u5b89\u88dd parted<\/b><\/p>\n<p>RHEL, CentOS, Fedora:<\/p>\n<blockquote>\n<div class=\"shell\">$ sudo yum install parted<\/div>\n<\/blockquote>\n<p>Debian, Ubuntu, Linux Mint:<\/p>\n<blockquote>\n<div class=\"shell\">$ sudo apt-get install parted<\/div>\n<\/blockquote>\n<p>Fedora 22:<\/p>\n<blockquote>\n<div class=\"shell\">$ dnf install parted<\/div>\n<\/blockquote>\n<p>\u57f7\u884c\u4ee5\u4e0a\u6307\u4ee4\u5b89\u88dd\u597d parted \u5f8c, \u53ef\u4ee5\u7528\u4ee5\u4e0b\u65b9\u6cd5\u4f7f\u7528 parted:<\/p>\n<p>\u64cd\u4f5c\u7684\u786c\u789f\u8981\u6839\u64da\u4f60\u7684\u8a2d\u5b9a\u66f4\u6539, \u4ee5\u4e0b\u5047\u8a2d\u9078\u64c7\u786c\u789f \/dev\/sdb \u5efa\u7acb\u4e00\u500b 3TB \u7684\u5206\u5272\u5340:<\/p>\n<blockquote>\n<div class=\"shell\"># parted \/dev\/sdb<\/div>\n<\/blockquote>\n<p>\u78ba\u8a8d\u9078\u64c7\u7684\u786c\u789f\u6c92\u6709\u932f:<\/p>\n<blockquote>\n<div class=\"shell\">(parted) print<\/div>\n<\/blockquote>\n<p>\u5efa\u7acb\u786c\u789f\u5206\u5272\u8868<\/p>\n<blockquote>\n<div class=\"shell\">(parted) mklabel gpt<br \/>\nWarning: The existing disk label on \/dev\/sdb will be destroyed and all data on this disk will be lost. Do you want to continue?<br \/>\nYes\/No?<\/div>\n<\/blockquote>\n<p>\u4e0a\u9762\u6703\u986f\u793a \/dev\/sdb \u7684\u6240\u6709 label \u53ca\u8cc7\u6599\u6703\u522a\u9664, \u78ba\u5b9a\u9078\u64c7\u6b63\u78ba\u7684\u786c\u789f\u5f8c\u8f38\u5165 yes.<\/p>\n<p>\u73fe\u5728\u8f38\u5165\u4ee5\u4e0b\u6307\u4ee4\u5efa\u7acb 3TB \u7684\u5206\u5272\u5340:<\/p>\n<blockquote>\n<div class=\"shell\">(parted) mkpart primary 0.00TB 3.00TB<\/div>\n<\/blockquote>\n<p>\u7136\u5f8c\u53ef\u4ee5\u7528\u4ee5\u4e0b\u6307\u4ee4\u6aa2\u8996\u5206\u5272\u5340\u5efa\u7acb\u662f\u5426\u6b63\u78ba:<\/p>\n<blockquote>\n<div class=\"shell\">(parted) print<\/div>\n<\/blockquote>\n<p>\u6703\u770b\u5230\u985e\u4f3c\u4ee5\u4e0b\u7684\u8a0a\u606f:<\/p>\n<div class=\"shell\">\n<blockquote><p>Partition Table: gptNumber Start End Size File system Name Flags<br \/>\n1 0.00TB 3.00TB 3.00TB ext4 primary<\/p><\/blockquote>\n<\/div>\n<p>\u73fe\u5728\u53ef\u4ee5\u96e2\u958b parted:<\/p>\n<blockquote>\n<div class=\"shell\">(parted) quit<br \/>\nInformation: You may need to update \/etc\/fstab.<\/div>\n<\/blockquote>\n<p>\u5efa\u7acb\u4e86\u5206\u5272\u5340\u5f8c, \u53ef\u4ee5\u7528 mkfs.ext3 \u6216 mkfs.ext4 \u5c07\u65b0\u5206\u5272\u5340\u683c\u5f0f\u5316<\/p>\n<blockquote>\n<div class=\"shell\"># mkfs.ext3 \/dev\/sdb1<\/div>\n<\/blockquote>\n<p>\u6216<\/p>\n<blockquote>\n<div class=\"shell\"># mkfs.ext4 \/dev\/sdb1<\/div>\n<\/blockquote>\n<p>\u6700\u5f8c\u628a\u65b0\u5206\u5272\u5340\u639b\u8f09:<\/p>\n<blockquote>\n<div class=\"shell\"># mkdir \/data<br \/>\n# mount \/dev\/sdb1 \/data<\/div>\n<\/blockquote>\n<p>\u82e5\u60f3\u958b\u6a5f\u5c31\u639b\u8f09\uff0c\u53ef\u5148\u900f\u904e\u4e0b\u5217\u6307\u4ee4\u627e\u51fa\u5132\u5b58\u88dd\u7f6e\u7684UUID:<\/p>\n<blockquote>\n<div class=\"shell\"># ls -l \/dev\/disk\/by-uuid<br \/>\nlrwxrwxrwx 1 root root 15  3\u6708 10 21:51 0c7dd739-8547-4b6f-9bf6-4588b007ebc -> ..\/..\/mmcblk0p2<br \/>\nlrwxrwxrwx 1 root root 10  3\u6708 10 22:14 43ed97e1-6ff7-434b-8d4b-407c765d93be -> ..\/..\/sda1<br \/>\nlrwxrwxrwx 1 root root 10  3\u6708 10 22:48 684035ce-934b-4b2f-a3e3-a8c1fc8b452b -> ..\/..\/sdb1<br \/>\nlrwxrwxrwx 1 root root 15  3\u6708 10 21:51 887C-3F88 -> ..\/..\/mmcblk0p1\n<\/div>\n<\/blockquote>\n<p>\u518d\u4f86\u5c31\u53ef\u5728fstab\u88e1\u6dfb\u589e\u5982\u4e0b\u6307\u4ee4<\/p>\n<blockquote>\n<div class=\"shell\"># vi \/etc\/fstab<br \/>\nUUID=684035ce-934b-4b2f-a3e3-a8c1fc8b213b \/home3          ext4    errors=remount-ro 0       1\n<\/div>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>\u8cc7\u6599\u4f86\u6e90\uff1ahttps:\/\/www.opencli.com\/linux\/linux-create-larger-<span class=\"post-excerpt-end\">&hellip;<\/span><\/p>\n<p class=\"more-link\"><a href=\"https:\/\/learn-house.idv.tw\/?p=2868\" class=\"themebutton\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-2868","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/2868","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2868"}],"version-history":[{"count":0,"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/2868\/revisions"}],"wp:attachment":[{"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2868"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2868"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2868"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}