public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Removing LVM from disk, or disks, and being like new drives again.
@ 2025-05-19  4:47 Dale
  2025-05-19  7:02 ` byte.size226
  0 siblings, 1 reply; 3+ messages in thread
From: Dale @ 2025-05-19  4:47 UTC (permalink / raw
  To: gentoo-user

Howdy,

As most likely know, I use LVM a lot.  I'm about to rework a set of
drives and when done, I need to remove everything from the drives and
reset them to like new.  No data, no LVM, no partitions or anything on
them.  I'm not necessarily needing to use shred or dd everything to make
sure data can never be recovered, just reset to like new so I can start
clean with a fresh new setup.  I think I tried dd in the past but it
lead to issues because it appears something was still trying to see LVM
on the drive. 

What is the fastest way to do this when on a single drive or when on
more than one drive, if it requires a different process?  I figure
someone here has done this before and found a quick and easy way to
accomplish the goal. 

Thanks. 

Dale

:-)  :-) 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-user] Removing LVM from disk, or disks, and being like new drives again.
  2025-05-19  4:47 [gentoo-user] Removing LVM from disk, or disks, and being like new drives again Dale
@ 2025-05-19  7:02 ` byte.size226
  2025-05-28  5:36   ` Dale
  0 siblings, 1 reply; 3+ messages in thread
From: byte.size226 @ 2025-05-19  7:02 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1425 bytes --]

Dale wrote:
> I'm not necessarily needing to use shred or dd everything to make
> sure data can never be recovered, just reset to like new so I can start
> clean with a fresh new setup.
> <<snip>>> 
> What is the fastest way

In that scenario I would simply use gdisk (sys-apps/
gptfdisk).

When you open the drive (e.g. "gdisk /dev/sda") under the "extra 
functionality (experts only)" menu there is the option:

     z       zap (destroy) GPT data structures and exit

Note that the drive does not need to be GPT formatted. Zapping it will 
also ask to remove MBR structures too.

This will give you a clean slate. Of course, since the actual data of 
each partition has not been removed if you then create the exact same 
partition table with the exact same offsets you will still be able to 
mount the filesystems. Notably, if the start offset is the same, e.g. 
"2048" and you try to run mkfs it will warn of existing signature having 
been found.

LVM signatures will s
till remain in place and the same would be 
possible. If that's not a desirable outcome you can use LVM's "vgremove" 
and "pvremove" first to remove the VG/PV signatures.

None of this really matters much though since the data at these 
locations would eventually be overwritten. And if you plan to do have 
exact same layout, at the exact same offsets, then creating a new 
filesystem or PV/VG/LV will inherently overwrite any existing signatures.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 928 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-user] Removing LVM from disk, or disks, and being like new drives again.
  2025-05-19  7:02 ` byte.size226
@ 2025-05-28  5:36   ` Dale
  0 siblings, 0 replies; 3+ messages in thread
From: Dale @ 2025-05-28  5:36 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 2346 bytes --]

byte.size226@simplelogin.com wrote:
> Dale wrote:
>> I'm not necessarily needing to use shred or dd everything to make
>> sure data can never be recovered, just reset to like new so I can start
>> clean with a fresh new setup.
>> <<snip>>> What is the fastest way
>
> In that scenario I would simply use gdisk (sys-apps/
> gptfdisk).
>
> When you open the drive (e.g. "gdisk /dev/sda") under the "extra
> functionality (experts only)" menu there is the option:
>
>     z       zap (destroy) GPT data structures and exit
>
> Note that the drive does not need to be GPT formatted. Zapping it will
> also ask to remove MBR structures too.
>
> This will give you a clean slate. Of course, since the actual data of
> each partition has not been removed if you then create the exact same
> partition table with the exact same offsets you will still be able to
> mount the filesystems. Notably, if the start offset is the same, e.g.
> "2048" and you try to run mkfs it will warn of existing signature
> having been found.
>
> LVM signatures will s
> till remain in place and the same would be possible. If that's not a
> desirable outcome you can use LVM's "vgremove" and "pvremove" first to
> remove the VG/PV signatures.
>
> None of this really matters much though since the data at these
> locations would eventually be overwritten. And if you plan to do have
> exact same layout, at the exact same offsets, then creating a new
> filesystem or PV/VG/LV will inherently overwrite any existing signatures.


Sorry so long to reply.  I had some things to do before using this
method.  I moved data from 4 drives to 3 larger drives.  Now I'm
resetting those 4 drives to use for other things.  Given the new drive
set is at 86%, I may have to move one of those 4 drives to the new drive
set. 

Given that I have used this method, it does work.  It resets the drives
to no partition table at all.  I also used shred for the first 40GBs or
so just to be sure nothing could be recovered setup wise.  Data may
still be there but likely take some work to recover.  Thing is, pvs
shows no LVM drives available.  So, it removes partition table and LVM
data as well.  Just what I needed. 

Thanks for the tip.  Now to add this info to my little cheat file, where
I put things I can't remember.  My age is showing.  :/ 

Dale

:-)  :-) 

[-- Attachment #2: Type: text/html, Size: 3550 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-05-28  5:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-19  4:47 [gentoo-user] Removing LVM from disk, or disks, and being like new drives again Dale
2025-05-19  7:02 ` byte.size226
2025-05-28  5:36   ` Dale

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox