this post was submitted on 19 Oct 2023
39 points (93.3% liked)

Linux

47952 readers
2565 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

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.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 57 points 1 year ago (3 children)

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

[–] [email protected] 19 points 1 year ago (1 children)

Didn't know gparted did that, good to know.

[–] [email protected] 23 points 1 year ago

That's the main advantage of parted over fdisk + mkfs, really.

[–] [email protected] 8 points 1 year ago (2 children)

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.

[–] [email protected] 17 points 1 year ago

Essentially it only moves the borders of the partitions and "repairs" the filesystem inside each affected partition.

If there is data in an area inside the partion you are manipulating gparted has to move the data to an area inside the partition that is unaffected or move it to the new parts of the partition. This can take a long time even if modern PCs easily move 100MB/s

Also, even if gparted is mature software and the devs probably have implemented a lot of security measures you should always backup your data before manipulating the partitions. Especially when you're playing around with filesystems that aren't native like NTFS or more complicated filesystems like ZFS. I know people often nag about this but trust me... Blow 2TB of your data and you really really regret not spending 10 minutes backing up the essentials.

I've been using gparted for as long as I can remember and only once or twice has it caused dats loss. Since I'm very old school (started playing with PCs when 386DX 16MHz was fairly hot and RLL disks were a thing) and nerdy I was able to use data rescue software that looked for filesystems over the whole disk and guessed where partition borders should be.

Avoid this type of anxiety by backing up all data or at least backing up the data you can't live without.

Also, if you have a spare disk, it's faster and much safer to partition the spare one and just clone each partition. Sometimes it's even faster to clone the disk this way and then clone it back.

[–] [email protected] 5 points 1 year ago

Yes, Linux file systems are superior in every single aspect except compatibility

[–] [email protected] 1 points 1 year ago

kinda it is only supported on specific fses iirc btrfs is not happy with it