shredos.x86_64 icon indicating copy to clipboard operation
shredos.x86_64 copied to clipboard

Automatically wipe all attached storage media without the system one

Open Nebuli1 opened this issue 2 years ago • 30 comments

Hello, I am trying to make a flash drive that will clear all connected media after itself. However, I don't know how to safely exclude the flash drive itself. I have read that excluding the drive by sda does not guarantee that it will always be my pendrive, I tried to exclude by uuid but the packages are missing. How do you guys deal with this?

My configuration file. set default="0" set timeout="0"

menuentry "shredos" { linux /boot/shredos console=tty3 loglevel=3 nwipe_options="--method=zero --verify=off --noblank --autonuke --autopoweroff /dev/sda" }

Nebuli1 avatar Jul 23 '23 13:07 Nebuli1

If I've understood your use case correctly, all you need to do is add --nousb , this will exclude all devices from being wiped that are attached via USB, it will still enumerate all SATA, SAS, NvMe etc.

set default="0"
set timeout="0"

menuentry "shredos" {
linux /boot/shredos console=tty3 loglevel=3 nwipe_options="--method=zero --verify=off --noblank --autonuke --autopoweroff --nousb /dev/sda"
}

PartialVolume avatar Jul 23 '23 19:07 PartialVolume

However, if you only want to exclude USB devices that contain ShredOS, but enumerate all other USB , SATA, SAS and NvMe devices then at the moment that's not possible except by identifying what the device name is and using --exclude, however like you say a USB device name can change so that command is not reliable on the linux command line.

If the above feature is what you are looking for and --nousb isn't sufficient then I can add this as a new feature. I can have ShredOS determine which drives contain ShredOS and exclude those from the wipe. I'd probably go with the option --noshredos.

On a connected issue, I need to add an option that delays nwipes launch as often the USB devices haven't initialised so often you don't see any USB devices until you Control C and nwipe restarts.

PartialVolume avatar Jul 23 '23 20:07 PartialVolume

i think it would be a good idea to have something like --no-wipe-boot-drive. so it can ignore the bootdrive (USB, sata or whatever) but wipe everything else

ITJamie avatar Jul 25 '23 11:07 ITJamie

I've been reading for days and doing tests. I can't manage without help. Actually the nwipe boot delay option and the --no-wipe-boot-drive parameter solves my problem. The problem occurred because my disk cleaning computer has no nvme or PCI slot so I connect nvme drives via USB adapter.

Nebuli1 avatar Jul 28 '23 08:07 Nebuli1

@Nebuli1 I'm assuming your NvMe doesn't initially appear. You are aware that if you Control C in nwipe/ShedOS then press space-bar before starting your wipe all the USB attached devices will now be listed, when running in GUI mode or are you trying to autonuke with no GUI.

It's probably time I put a small check in the code to launch nwipe once the USB devices have been detected and launch anyway after 5 seconds.

PartialVolume avatar Jul 28 '23 10:07 PartialVolume

Thanks I didn't think about autonuke without GUI, I will test.

For now I'm working as you suggest. USB delay will be great. I've read other topics where you wrote about the autonuke problem so I guess this will be the easiest and fastest yet effective solution.

Nebuli1 avatar Jul 28 '23 14:07 Nebuli1

If the above feature is what you are looking for and --nousb isn't sufficient then I can add this as a new feature. I can have ShredOS determine which drives contain ShredOS and exclude those from the wipe. I'd probably go with the option --noshredos.

any update on this feature? I can exclude the internal disk of the device I use just fine since it always appears first in the list and I swear my USB used to always show in the second slot but It hasn't been doing that recently. Instead it is usually the last drive in the list or second to last. If I am always wiping 2 drives at a time I believe I can predict where the USB will be in the list but if I only do one drive then the USB will move and be visible again.

-edit I did find out that I can sort of accomplish this by just removing the USB and restarting nwipe so it doesnt pick up the usb anymore.

fieldofgreen avatar Oct 19 '23 18:10 fieldofgreen

On a connected issue, I need to add an option that delays nwipes launch as often the USB devices haven't initialised so often you don't see any USB devices until you Control C and nwipe restarts.

On a different note, Would it be possible to utilize the 5 second timer that occurs after ctrl-c and any key but just have a five second timer before nwipe finishes booting?

fieldofgreen avatar Oct 19 '23 18:10 fieldofgreen

please take a peek at this PartialVolume topic

https://github.com/PartialVolume/shredos.x86_64/issues/163

Wait and see if an update has been issued. I for one can't wait, but I have time to prepare my equipment :)

Nebuli1 avatar Oct 20 '23 11:10 Nebuli1

Thanks for the reminder, I'll make sure this is implemented in the next release.

PartialVolume avatar Oct 20 '23 12:10 PartialVolume

Just to let you know, I'm now working on building the latest ShredOS with kernel 6.4.16 with the latest nwipe v0.35 plus adding #163. Should hopefully release this very soon.

PartialVolume avatar Nov 06 '23 23:11 PartialVolume

Was the ability to exclude the Boot drive added to the most recent build or is that still in the works?

fieldofgreen avatar Nov 22 '23 17:11 fieldofgreen

Was the ability to exclude the Boot drive added to the most recent build or is that still in the works?

No, that will be in the next version. Hopefully shouldn't be too long, just got to add a few more changes.

PartialVolume avatar Nov 22 '23 18:11 PartialVolume

Is it known what parameters to add to config to exclude the boot disk ?

Nebuli1 avatar Dec 11 '23 18:12 Nebuli1

@PartialVolume Has any solution been implemented to exclude the Shredos system drive?

Every now and then I clean my memory stick ;/

IMG_20231211_191616

Nebuli1 avatar Dec 13 '23 19:12 Nebuli1

No, I've not added that option yet, I've not forgotten.

I will go with --shredos_exclude_boot_disc=yes as the option name. It will be in the next release I do, just not sure when I'm going to write the code as I'm pretty busy leading up to Christmas, but I'll see if I can squeeze it in. It will exclude both the ShredOS and Ventoy USB drives so the USB drive you booted from does not show up in the list of enumerated drives in either gui or non gui modes.

PartialVolume avatar Dec 13 '23 21:12 PartialVolume

Of course I understand and appreciate. Thank you. I will look for this option in the next update.

Nebuli1 avatar Dec 14 '23 12:12 Nebuli1

@PartialVolume Hi. Please don't take me the wrong way. I am asking in good faith. Did you manage to implement a new option ? I cannot find it. Thanks.

Nebuli1 avatar Feb 27 '24 14:02 Nebuli1

It's currently being tested, it will be committed to the master code in the next couple of days. The kernel command to enable it will be shredos_exclude_boot_disc=yes

PartialVolume avatar Feb 27 '24 15:02 PartialVolume

I'm also making it a little easier for Ventoy users. They can unpack the .img etc edit the grub.cfg and repack etc but that's all very time consuming. Instead all you need to do is create the following empty file on the USB stick that you don't want to appear in nwipe's interactive or get wiped in autonuke mode. /etc/shredos/shredos_exclude the PDF's will still written to the excluded drive it will just appear invisible to nwipe.

PartialVolume avatar Feb 28 '24 14:02 PartialVolume

@PartialVolume ok, as soon as you post the updated img image I will immediately try to test the solution. Thanks

Nebuli1 avatar Feb 28 '24 18:02 Nebuli1

committed #228

PartialVolume avatar Mar 02 '24 23:03 PartialVolume

Updated README.md-Exclude ShredOS boot drive with two alternate methods to exclude the ShredOS fat formatted boot drive.

PartialVolume avatar Mar 04 '24 20:03 PartialVolume

Thank you. I did the tests and unfortunately my flash drive ShredOS was wiped ;/ I attach my CFG file.

set default="0" set timeout="0" menuentry "shredos" { linux /boot/shredos console=tty3 loglevel=3 shredos_exclude_boot_disc="yes" nwipe_options="--method=zero --verify=off --noblank --exclude=/dev/sda --PDFreportpath=/ --autopoweroff --autonuke" nomodeset }

Have I done something wrong?

Nebuli1 avatar Mar 19 '24 20:03 Nebuli1

You don't mention whether you built ShredOS from source yourself. I've committed the changes to the source but not published a release yet, so no new .iso / .img files.

However, if you are building from source, let me know and I'll take a look at the problem.

PartialVolume avatar Mar 19 '24 23:03 PartialVolume

Sorry I didn't read that. I downloaded the .img. I will wait for the new .img version. :) Thanks.

Nebuli1 avatar Mar 19 '24 23:03 Nebuli1

@PartialVolume I must admit that I am actively following Github. I've been trying to compile img unfortunately on Windows and giving up ;/ I read recently that you've released an RC version of the https://github.com/PartialVolume/shredos.x86_64/issues/257#issuecomment-2140333330 Is the shredos_exclude_boot_disc=yes option implemented in it?

https://github.com/PartialVolume/shredos.x86_64/pull/228 Is this a good configuration file?

set default="0" set timeout="0"

menuentry "shredos" { linux /boot/shredos console=tty3 loglevel=3 shredos_exclude_boot_disc="yes" nwipe_options="--method=zero --verify=off --noblank --PDFreportpath=/ --autopoweroff --autonuke --shredos_exclude_boot_disc" nomodeset }

Nebuli1 avatar May 31 '24 12:05 Nebuli1

Is the shredos_exclude_boot_disc=yes option implemented in it?

Yes.

Is this a good configuration file?

Not quite, you seem to have a second shredos_exclude_boot_disc inside the nwipe_options. That should be removed. Also the --PDFreportpath is unnecessary as you have it set to / which is it's default value in ShredOS, so that can be removed.

With the above changes made it would look as shown below. I have also put nomodeset directly after loglevel and before any ShredOS or nwipe_options. Not for any valid technical reason, just because I like to see any ShredOS or nwipe options came after everything else. That's also the way I test it.

set default="0"
set timeout="0"

menuentry "shredos" {
linux /boot/shredos console=tty3 loglevel=3 nomodeset shredos_exclude_boot_disc="yes" nwipe_options="--method=zero --verify=off --noblank --autopoweroff --autonuke"
}

PartialVolume avatar May 31 '24 21:05 PartialVolume

I tested the solution. Everything works perfectly, thank you.

Nebuli1 avatar Jun 01 '24 14:06 Nebuli1

I tested the solution. Everything works perfectly, thank you.

Excellent, thanks for letting me know.

PartialVolume avatar Jun 01 '24 20:06 PartialVolume