0

I have a partition /dev/sda that uses 18GB out of 250GB It has an operating system data that I would keep, even if I dont boot it again.

I'm interested to know if I start parted and create a new partition in the free space left, would it destroy previous data ?

1

To utilize the free space you first need to shrink the filesystem. Even though it's only using a subset of the space available, data could be scattered anywhere within the partition. Shrinking the filesystems compacts it.

Next, you'll need to shrink the partition containing the filesystem while making sure you don't shrink it too far.

Luckily, parted has support for shrinking (some) filesystems. So as long as the filesystem in question is one of those supported, you can use parted to shrink the filesystem and the partition in one go.

  • thank you very much. I tried a test with an SD card but I failed to keep the data. I think its much easier with Gparted if I dont want to loose data. – user1861388 May 11 '18 at 20:41
  • 1
    The answer here is correct (parted has builtin support for resizing/splitting partitions). But I just wanted to add that you should still back up your data before altering the partition table. The data is not destroyed by resizing partitions with parted, during normal operation. But in the case of errors, it is possible to cause corruption/breakage. So if the data is important, make a backup first! – J. Taylor May 11 '18 at 20:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.