6

I need to increase the partition using the empty space located before the partition starts without data loss. As far as I know to resize the partition and to leave data intact one should start the new partition from the same disk sector as before. Is it possible to find a solution in this case using fdisk? Moreover the partition has a filesystem. Will the resizing with fdisk damage filesystem and data?

1 Answer 1

2

Do you need to make the partition larger or smaller?

Maybe this helps: https://geekpeek.net/resize-filesystem-fdisk-resize2fs/

Any method would suggest that you back up the data anyway. Thus, backing up the data, changing the size, and restoring is a likely course of action.

There are toolsets like PartedMagic that contain tools like clonezilla and other formatting, partitioning, sizing, and such.

3
  • Lager. The first article still describes the procedure when the free space is located after the partition, but I have before it starts. I know, there is an option to use Gparted as well, but I was curious if it is possible to do just right from terminal with fdisk or something similar.
    – Anna
    Mar 8, 2019 at 2:01
  • Based on (limited) knowledge, the start of a partition is not something that seems to be able to be changed on just about any OS/filesystem. Might not be an option, but backup to something, setup how you want, and restore. My current favorite is to use ZFS for disks (mirrored, of course). No concern about partition size, since it is all virtual.
    – MikeP
    Mar 27, 2019 at 5:09
  • @Anna There is NO way to change partition size, you must delete it and create a new one, and creating new partition does not change allocated space, you must use resize2fs to shrink or expand allocated space. Also make sure to backup everything and to reinstall bootloader if you 'resized' partition containing the bootloader. It doesn't matter if free space is at end or beginning of partition.
    – knoftrix
    May 6, 2020 at 20:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .