Hello,

On Mon, Jan 31, 2022 at 05:57:45PM +0000, Gareth Evans wrote:
> > On 31 Jan 2022, at 17:37, Andy Smith <a...@strugglers.net> wrote:
> Hi Andy, I appreciate the data doesn't go anywhere, but...
> 
> >> then I delete P2 and then add a
> >> new partition which defaults to 2.
> 
> doesn't that at least result in the appearance of deletion (an empty 
> partition) if done after the resizing?

A partition table is just basically a list of start and end
positions of partitions.

When you "delete a partition" all you've done is removed the entry
in the table, but the data that belongs to the partition you just
deleted is still on the disk in the place where it always was.

If you then put back a partition the same as it was before (or
bigger), it will then show up as a valid partition again.

In the case of a grow, you then tell your FS or whatever to use the
empty space that's now at the end.

In the case of a shrink, you already told your FS (or whatever) to
create a gap between the end of the FS and the end of the partition,
so after deleting that partition you can add a "new" partition that
has an end position that matches the end of the shrunken FS.

If this does not make it clear that "deleting a partition" in fdisk
or parted or whatever is a perfectly normal thing to do that doesn't
in itself trash your data, I don't know how better to explain it and
you will have to elaborate as to where the confusion lies. I don't
know what "the appearance of deletion" means to you in this context
or why you think it harms any data that is on a disk.

Cheers,
Andy

-- 
https://bitfolk.com/ -- No-nonsense VPS hosting

Reply via email to