{"id":922,"date":"2023-11-26T10:28:04","date_gmt":"2023-11-26T10:28:04","guid":{"rendered":"https:\/\/www.linuxsystems.ovh\/?p=922"},"modified":"2023-11-26T10:28:05","modified_gmt":"2023-11-26T10:28:05","slug":"powiekszenie-live-partycji-root-gpt-na-linuxie","status":"publish","type":"post","link":"https:\/\/www.linuxsystems.ovh\/?p=922","title":{"rendered":"Powi\u0119kszenie live partycji root GPT na linuxie"},"content":{"rendered":"\n<p>Aby powi\u0119kszy\u0107 partycj\u0119&nbsp;root na GPT live, nale\u017cy ( w przyk\u0142adzie pos\u0142u\u017c\u0119 si\u0119, \u017ce partycja root to partycja sda):<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>Nale\u017cy na pocz\u0105tku partycj\u0119 GPT przenie\u015b\u0107 na sam koniec za pomoc\u0105 polecenia:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sgdisk -e \/dev\/sda<\/code><\/pre>\n\n\n\n<p>usun\u0105\u0107 partycj\u0119\u00a0gdiskiem i utworzy\u0107 j\u0105 od nowa z tym samym pocz\u0105tkowym sektorem &#8211; tutaj mamy przyk\u0142ad gdzie na dysku jest partycja root oraz partycj\u0105 SWAP:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>root@SERVER:~# gdisk \/dev\/sda\nGPT fdisk (gdisk) version 0.8.8\n\nPartition table scan:\n  MBR: protective\n  BSD: not present\n  APM: not present\n  GPT: present\n\nFound valid GPT with protective MBR; using GPT.\n\nCommand (? for help): p\nDisk \/dev\/sda: 209715200 sectors, 100.0 GiB\nLogical sector size: 512 bytes\nDisk identifier (GUID): 06AD32B9-B564-4EED-B535-4F83F6708FAD\nPartition table holds up to 128 entries\nFirst usable sector is 34, last usable sector is 209715166\nPartitions will be aligned on 1-sector boundaries\nTotal free space is 104867836 sectors (50.0 GiB)\n\nNumber  Start (sector)    End (sector)  Size       Code  Name\n   1              63        88070143   42.0 GiB    8300  Linux filesystem\n   2        88070144       104847359   8.0 GiB     8200  Linux swap\n\nCommand (? for help): d\nPartition number (1-2): 2\n\nCommand (? for help): d\nUsing 1\n\nCommand (? for help): n\nPartition number (1-128, default 1): \nFirst sector (34-209715166, default = 34) or {+-}size{KMGTP}: 63\nLast sector (63-209715166, default = 209715166) or {+-}size{KMGTP}: +91G\nCurrent type is 'Linux filesystem'\nHex code or GUID (L to show codes, Enter = 8300): \nChanged type of partition to 'Linux filesystem'\n\nCommand (? for help): p\nDisk \/dev\/sda: 209715200 sectors, 100.0 GiB\nLogical sector size: 512 bytes\nDisk identifier (GUID): 06AD32B9-B564-4EED-B535-4F83F6708FAD\nPartition table holds up to 128 entries\nFirst usable sector is 34, last usable sector is 209715166\nPartitions will be aligned on 1-sector boundaries\nTotal free space is 18874301 sectors (9.0 GiB)\n\nNumber  Start (sector)    End (sector)  Size       Code  Name\n   1              63       190840894   91.0 GiB    8300  Linux filesystem\n\nCommand (? for help): n\nPartition number (2-128, default 2): \nFirst sector (34-209715166, default = 190840895) or {+-}size{KMGTP}: \nLast sector (190840895-209715166, default = 209715166) or {+-}size{KMGTP}: +8G\\\nCurrent type is 'Linux filesystem'\nHex code or GUID (L to show codes, Enter = 8300): 8200\nChanged type of partition to 'Linux swap'\n\nCommand (? for help): p\nDisk \/dev\/sda: 209715200 sectors, 100.0 GiB\nLogical sector size: 512 bytes\nDisk identifier (GUID): 06AD32B9-B564-4EED-B535-4F83F6708FAD\nPartition table holds up to 128 entries\nFirst usable sector is 34, last usable sector is 209715166\nPartitions will be aligned on 1-sector boundaries\nTotal free space is 2097085 sectors (1024.0 MiB)\n\nNumber  Start (sector)    End (sector)  Size       Code  Name\n   1              63       190840894   91.0 GiB    8300  Linux filesystem\n   2       190840895       207618110   8.0 GiB     8200  Linux swap\n\nCommand (? for help): w\n\nFinal checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING\nPARTITIONS!!\n\nDo you want to proceed? (Y\/N): y\nOK; writing new GUID partition table (GPT) to \/dev\/sda.\nWarning: The kernel is still using the old partition table.\nThe new table will be used at the next reboot.\nThe operation has completed successfully.\n\n<\/code><\/pre>\n\n\n\n<p>Nast\u0119pnie robimy partprobe, aby kernel rozpozna\u0142 nowy uk\u0142ad partycji:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>root@SERVER:~# partprobe<\/code><\/pre>\n\n\n\n<p>Nast\u0119pnie nale\u017cy powi\u0119kszy\u0107 filesystem:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>root@SERVER:~# resize2fs \/dev\/sda1<\/code><\/pre>\n\n\n\n<p>Teraz cieszymy si\u0119 powi\u0119kszonym filesystemem \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Aby powi\u0119kszy\u0107 partycj\u0119&nbsp;root na GPT live, nale\u017cy ( w przyk\u0142adzie pos\u0142u\u017c\u0119 si\u0119, \u017ce partycja root to partycja sda):<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38],"tags":[],"class_list":["post-922","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.linuxsystems.ovh\/index.php?rest_route=\/wp\/v2\/posts\/922","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.linuxsystems.ovh\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxsystems.ovh\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxsystems.ovh\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxsystems.ovh\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=922"}],"version-history":[{"count":3,"href":"https:\/\/www.linuxsystems.ovh\/index.php?rest_route=\/wp\/v2\/posts\/922\/revisions"}],"predecessor-version":[{"id":928,"href":"https:\/\/www.linuxsystems.ovh\/index.php?rest_route=\/wp\/v2\/posts\/922\/revisions\/928"}],"wp:attachment":[{"href":"https:\/\/www.linuxsystems.ovh\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=922"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxsystems.ovh\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=922"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxsystems.ovh\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=922"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}