The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. How to resize ext3 image files Ask Question. Asked 9 years, 9 months ago. Active 7 years, 1 month ago. Viewed 15k times.
I have created an MB ext3 using the following commands. Improve this question. Gilles 'SO- stop being evil' k gold badges silver badges bronze badges. Binoy Babu Binoy Babu 3 3 gold badges 10 10 silver badges 18 18 bronze badges. Add a comment. Next is extending the partition that contains LVM. In theory you can use fdisk directly on image files, but in this case it didn't work for me, so an easy solution was to attach the image to a loopback device:. Here you want to delete the existing partition and re-create a larger one in it's place.
It's important that the new partition starts in exactly the same place as the old one. For me, this was nice and easy - just delete the second partition and create a new one using the defaults, then save and quit.
My commands were I included a couple of "p"s to verify where I started and finished :. Now you want access to the partitions within the image file, so that you can get at LVM to resize it:. This should show each of the partitions within the image and which loopback device they've been mapped to.
There are a couple of bits that need resizing in LVM, the first is the physical volume. The default action of pvresize is to resize to consume all available space, so all that's needed is:. To resize the logical volume I looked up the number of extents that were now free and used this number in my lvresize command the number after -l.
Nearly there now. Note : Extending a filesystem is a moderately high-risk operation. So it is recommended to backup your entire partition to prevent data loss. For the purpose of this tutorial, we are using the Linux system with the following partition scheme:.
Type n and hit Enter to create a new partition:. Press Enter to create a primary partition :. Type w and hit Enter to apply the changes:. Once the partition has been created, format it with the ext4 filesystem using the following command:. Linux supports online partition resizing for filesystem mounted with ext3 and ext4. If you want to resize the partition mounted with ext2 filesystem, then you will need to unmount the partition before resizing it. Here, we are resizing ext4 partition so we don't need to unmount the partition.
If you are using ext2 filesystem, you can unmount it with the following command:. Type d and hit Enter to delete the partition:. Type p and hit Enter to print the partition table information:.
0コメント