A moment ago I unmounted my 1TB HDD with 400GB of content and I partition it into two different partitions, obviously keeping the space that was already occupied. I did because I don't care if the content get corrupted, but after I did it everything is still working perfectly, when I thought everything would be corrupted.

I am possibly a complete ignorant on this subject, but due to the nature of the HDD and how it writes and reads data I expected it to corrupt everything, why didn't it happen? On an SSD on the other hand I would not consider that possible because it is not even a mechanical part where the information is stored.

  • Discover5164@lemm.ee
    ·
    9 months ago

    when you resize a partition with data, gparted will move the data inside the partition to fit the new size.

    imagine you have a 100gb partition with 50gb occupied. now you want to shrink it to 80, if there is stuff in the last 20gb, gparted will move them to available space in the first 80gb, and then make the partition.

    still i definitely will not trust it and have backups

    • Xirup@lemmy.dbzer0.com
      hexagon
      ·
      9 months ago

      It is incredible that it does all that in a matter of seconds, I mean, it moves so much data without problem in jusr seconds, although in fact that is something curious that I have noticed in Linux. If I move something to the same storage even if it is in a different partition, it makes it instantaneous.

  • aebletrae [she/her]
    ·
    9 months ago

    If you had a book which had on its Contents page:

    Chapter 1 . . . . . . . . . . page 1

    and you crossed it out, then wrote:

    Chapter 1 . . . . . . . . . . page 1

    Chapter 2 . . . . . . . . . . page 50

    someone looking for Chapter 1 is still going to find all the text in the right place (as long as it was less than 50 pages).

    Changing the partitition table is like changing the Contents page; it doesn't mess with the rest of the data. And if the new table points to the same place it did before, the data can still be found.

    That said, if the filesystem still thinks it's 1TB, you may end up with future problems unless you resize it to fit the reduced partition.

  • blobjim [he/him]
    ·
    9 months ago

    Maybe there's just wasn't any data written past the partition point yet?