{"id":5233,"date":"2017-06-27T17:47:25","date_gmt":"2017-06-27T14:47:25","guid":{"rendered":"http:\/\/skeletor.org.ua\/?p=5233"},"modified":"2024-10-03T17:42:18","modified_gmt":"2024-10-03T14:42:18","slug":"linux-resize-%d0%ba%d0%be%d1%80%d0%bd%d0%b5%d0%b2%d0%be%d0%b3%d0%be-%d1%80%d0%b0%d0%b7%d0%b4%d0%b5%d0%bb%d0%b0-%d0%b1%d0%b5%d0%b7-%d0%bf%d0%be%d1%82%d0%b5%d1%80%d0%b8-%d0%b4%d0%b0%d0%bd%d0%bd%d1%8b","status":"publish","type":"post","link":"https:\/\/skeletor.org.ua\/?p=5233","title":{"rendered":"[Linux] Resize \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0433\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0430 \u0431\u0435\u0437 \u043f\u043e\u0442\u0435\u0440\u0438 \u0434\u0430\u043d\u043d\u044b\u0445"},"content":{"rendered":"<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u044b \u0435\u0433\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u043b\u0438, \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e\u0431 \u044d\u0442\u043e\u043c \u0424\u0421. \u0418 \u0442\u0430\u043a, \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 <strong>32Gb<\/strong><\/p>\n<p><!--more--><\/p>\n<pre># df -h\nFilesystem      Size  Used Avail Use% Mounted on\nudev            2.0G     0  2.0G   0% \/dev\ntmpfs           396M   41M  356M  11% \/run\n\/dev\/sda1        32G  1.3G   29G   5% \/\ntmpfs           2.0G     0  2.0G   0% \/dev\/shm\ntmpfs           5.0M     0  5.0M   0% \/run\/lock\ntmpfs           2.0G     0  2.0G   0% \/sys\/fs\/cgroup\ntmpfs           396M     0  396M   0% \/run\/user\/0\n<\/pre>\n<p>\u0414\u043b\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0443\u0442\u0438\u043b\u0438\u0442\u0443 <strong>parted<\/strong> (\u043d\u0430 \u0441\u0442\u0430\u0440\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 \u0434\u043e <strong>3.0<\/strong> \u0432\u043c\u0435\u0441\u0442\u043e <strong>resizepart<\/strong> \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <strong>resize<\/strong>):<\/p>\n<pre># parted \/dev\/sda\nGNU Parted 3.2\nUsing \/dev\/sda\nWelcome to GNU Parted! Type 'help' to view a list of commands.\n(parted) p\nModel: QEMU QEMU HARDDISK (scsi)\nDisk \/dev\/sda: 107GB\nSector size (logical\/physical): 512B\/512B\nPartition Table: msdos\nDisk Flags: \n\nNumber  Start   End     Size    Type     File system  Flags\n 1      1049kB  34.4GB  34.4GB  primary  ext4         boot\n\n(parted) resizepart 1\nWarning: Partition \/dev\/sda1 is being used. Are you sure you want to continue?\nYes\/No? Yes                                                               \nEnd?  [34.4GB]? 107G                                                      \n(parted) p                                                                \nModel: QEMU QEMU HARDDISK (scsi)\nDisk \/dev\/sda: 107GB\nSector size (logical\/physical): 512B\/512B\nPartition Table: msdos\nDisk Flags: \n\nNumber  Start   End    Size   Type     File system  Flags\n 1      1049kB  107GB  100GB  primary  ext4         boot                                                                   \n(parted) quit                                                             \n<\/pre>\n<p>\u0422\u0430\u043c \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c, \u043d\u0430 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u0440\u0430\u0437\u0434\u0435\u043b (\u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0430 \u043f\u0440\u0438 \u0432\u044b\u0432\u043e\u0434\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u043e\u0432: \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 <strong>107Gb<\/strong>)<\/p>\n<p>\u0414\u0435\u043b\u0430\u0435\u043c <strong>resize<\/strong> \u0424\u0421:<\/p>\n<pre># resize2fs \/dev\/sda1\nresize2fs 1.42.13 (17-May-2015)\nFilesystem at \/dev\/sda1 is mounted on \/; on-line resizing required\nold_desc_blocks = 6, new_desc_blocks = 7\nThe filesystem on \/dev\/sda1 is now 26855212 (4k) blocks long.\n<\/pre>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c (\u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043d\u0435 \u043d\u0443\u0436\u043d\u0430):<\/p>\n<pre># df -h\nFilesystem      Size  Used Avail Use% Mounted on\nudev            2.0G     0  2.0G   0% \/dev\ntmpfs           396M  5.6M  390M   2% \/run\n\/dev\/sda1        98G  1.3G   93G   2% \/\ntmpfs           2.0G     0  2.0G   0% \/dev\/shm\ntmpfs           5.0M     0  5.0M   0% \/run\/lock\ntmpfs           2.0G     0  2.0G   0% \/sys\/fs\/cgroup\ntmpfs           396M     0  396M   0% \/run\/user\/0\n<\/pre>\n<p>\u041d\u0430\u0448\u0451\u043b \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0440\u0430\u0445 \u0441\u0435\u0442\u0438, \u0435\u0449\u0451 \u0442\u0430\u043a\u043e\u0439 <a href=\"https:\/\/github.com\/amarao\/ptmax\">\u043f\u0440\u043e\u0435\u043a\u0442<\/a>, \u043d\u043e \u043d\u0435 \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b.<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #ff6600;\"><em><strong>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435.<\/strong><\/em><\/span><\/p>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u043d\u0430\u043b\u0435\u0442\u0443 \u043d\u0435 \u0443\u0434\u0430\u0435\u0442\u0441\u044f \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440, \u0430 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0435\u043b\u044c\u0437\u044f \u0438 \u0443 \u0432\u0430\u0441 <strong>SCSI<\/strong>-\u0434\u0438\u0441\u043a, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c <strong>rescan<\/strong>. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u0434\u0438\u0441\u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0447\u0435\u0440\u0435\u0437 <strong>lsscsi<\/strong> (\u0441\u0442\u0430\u0432\u0438\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u043e\u0432) \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0434\u043b\u044f \u043d\u0435\u0433\u043e <strong>rescan<\/strong> (\u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <strong>\/dev\/sdd<\/strong>):<\/p>\n<pre># lsscsi -s\n[0:0:0:0]    cd\/dvd  NECVMWar VMware IDE CDR00 1.00  \/dev\/sr0        -\n[2:0:0:0]    disk    VMware   Virtual disk     1.0   \/dev\/sda   32.2GB\n[2:0:1:0]    disk    VMware   Virtual disk     1.0   \/dev\/sdb    107GB\n[3:0:0:0]    disk    VMware   Virtual disk     1.0   \/dev\/sdc    107GB\n[3:0:1:0]    disk    VMware   Virtual disk     1.0   \/dev\/sdd    214GB\n[3:0:2:0]    disk    VMware   Virtual disk     1.0   \/dev\/sde   53.6GB\n[3:0:3:0]    disk    VMware   Virtual disk     1.0   \/dev\/sdf   53.6GB\n[3:0:4:0]    disk    VMware   Virtual disk     1.0   \/dev\/sdg    161GB\n# echo 1 &gt; \/sys\/bus\/scsi\/devices\/3\\:0\\:1\\:0\/rescan\n<\/pre>\n<p>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u0442\u0430\u043a\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b:<br \/>\n<code><br \/>\n# partprobe<br \/>\n# hdparm -z \/dev\/sda<br \/>\n# blockdev --rereadpt \/dev\/sda<br \/>\n# echo 1 > \/sys\/block\/sda\/device\/rescan<br \/>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u044b \u0435\u0433\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u043b\u0438, \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e\u0431 \u044d\u0442\u043e\u043c \u0424\u0421. \u0418 \u0442\u0430\u043a, \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 32Gb<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-5233","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/5233","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5233"}],"version-history":[{"count":8,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/5233\/revisions"}],"predecessor-version":[{"id":6495,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/5233\/revisions\/6495"}],"wp:attachment":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5233"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5233"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5233"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}