That will create a new mapping on /dev/loop0 pointing just at partition 2 - for reference 512 is the sector-size you can see in the first fdisk output. Remember the start offset you noted and used above - we'll use it again: sudo losetup -d /dev/loop0 # delete the old loop setup You can delete that loopback device, we'll make another for the second partition. Steps 2-3 - delete partition 2, Steps 4-8 - recreate partition 2 with new end point (default is end of image), Step 9 - print out the new table.Īssuming your newly printed table is identical to the original table except for the End value and Blocks value (ie the size has changed) you're ready to commit.Įnter w to commit your change, then enter q to quit. sudo fdisk /dev/loop0Įnter the following - they are safe to enter - nothing permanent happens until you've read my explanation that follows: So make note of the "Start" column for loop0p2 (partition 2 - the Linux partition) - we'll use it later - its 122880 here. Now we'll remake the last partition by deleting it, then recreating it at the same start location, same type but different end location. I/O size (minimum/optimal): 512 bytes / 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes image.imgįor future reference lets dump it: sudo fdisk -l /dev/loop0 Next map the whole image as a loop device so we can poke at the partition table sudo losetup /dev/loop0. This is a synthesis of the answers above and elsewhere that worked for me - back up your image in case you make a mistake:įirstly make the image file bigger (here we're adding 1GB to the end): truncate -s +1G.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |