For example 1GiB disk with GPT:
echo ", +10M" | ./sfdisk -N 1 /dev/sdc ... Old situation: Device Start End Sectors Size Type /dev/sdc1 2048 206847 204800 100M Linux filesystem New situation: Device Start End Sectors Size Type /dev/sdc1 2048 227327 225280 110M Linux filesystemthe first partition (-N 1) has been enlarged from 100MiB to 110MiB.
You can also move begin of the partition:
echo "+2M" | ./sfdisk -N 1 /dev/sdc ... Old situation: Device Start End Sectors Size Type /dev/sdc1 2048 227327 225280 110M Linux filesystem New situation: Device Start End Sectors Size Type /dev/sdc1 6144 231423 225280 110M Linux filesystemand it's possible to enalarge as much as possible:
echo ", +" | ./sfdisk -N 1 /dev/sdc ... Old situation: Device Start End Sectors Size Type /dev/sdc1 6144 231423 225280 110M Linux filesystem New situation: Device Start End Sectors Size Type /dev/sdc1 6144 2047966 2041823 997M Linux filesystemthe '+' means "all available space". And vice-versa you can reduce the size of the partition; it's possioble to specify the size in absolute numbers (without +/- signs), or in sectors. The next example reduce size to 100MiB and move to old good offset 2048:
echo "2048,100M" | ./sfdisk -N 1 /dev/sdc ... Old situation: Device Start End Sectors Size Type /dev/sdc1 6144 2047966 2041823 997M Linux filesystem New situation: Device Start End Sectors Size Type /dev/sdc1 2048 206847 204800 100M Linux filesystemNote that fdisks are too low-level to care about filesystems when resize, it's all about partition tables only.
These features saved my life where I was unable to use any GUI tool. Thanks a lot.
ReplyDeleteBlog comments are very essential for all blogs. They make the blogs social in the real essence of the word social. Without these comments, a blog is somewhat boring just like an ordinary one-sided conversation on a website that talks at its audience rather than with its audience. To make your blog succeed, you should allow comments from the readers on all your blog posts. https://www.fiverr.com/seoservice35/make-390-dofollow-backlinks-manually-blog-comments-low-obl
ReplyDelete