> On 31 Jan 2022, at 23:36, Andy Smith <a...@strugglers.net> wrote: > 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.
Hi Andy, I'm afraid I replied before I'd thought through what I had in mind, which was, wrongly, that deleting a partition unlinks the files it contains. "Appearance of deletion" was a poor choice of words. I meant that unlinked files could be recovered (if not first overwritten), although deletion is indeed the appropriate term. Thinking of testdisk/photorec reminded me that I was thinking (and writing) wrongly in the first place. Thanks anyway for your explanation. Gareth > > Cheers, > Andy > > -- > https://bitfolk.com/ -- No-nonsense VPS hosting >