Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically wipe all attached storage media without the system one #159

Open
Nebuli1 opened this issue Jul 23, 2023 · 30 comments
Open

Automatically wipe all attached storage media without the system one #159

Nebuli1 opened this issue Jul 23, 2023 · 30 comments
Assignees

Comments

@Nebuli1
Copy link

Nebuli1 commented Jul 23, 2023

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"
}

@PartialVolume
Copy link
Owner

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
Copy link
Owner

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.

@ITJamie
Copy link
Contributor

ITJamie commented Jul 25, 2023

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

@Nebuli1
Copy link
Author

Nebuli1 commented Jul 28, 2023

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.

@PartialVolume
Copy link
Owner

@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.

@Nebuli1
Copy link
Author

Nebuli1 commented Jul 28, 2023

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.

@fieldofgreen
Copy link

fieldofgreen commented Oct 19, 2023

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
Copy link

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?

@Nebuli1
Copy link
Author

Nebuli1 commented Oct 20, 2023

please take a peek at this PartialVolume topic

#163

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

@PartialVolume
Copy link
Owner

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

@PartialVolume
Copy link
Owner

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.

@fieldofgreen
Copy link

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

@PartialVolume
Copy link
Owner

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.

@Nebuli1
Copy link
Author

Nebuli1 commented Dec 11, 2023

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

@Nebuli1
Copy link
Author

Nebuli1 commented Dec 13, 2023

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

Every now and then I clean my memory stick ;/

IMG_20231211_191616

@PartialVolume
Copy link
Owner

PartialVolume commented Dec 13, 2023

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.

@Nebuli1
Copy link
Author

Nebuli1 commented Dec 14, 2023

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

@PartialVolume PartialVolume self-assigned this Dec 14, 2023
@Nebuli1
Copy link
Author

Nebuli1 commented Feb 27, 2024

@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.

@PartialVolume
Copy link
Owner

PartialVolume commented Feb 27, 2024

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
Copy link
Owner

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.

@Nebuli1
Copy link
Author

Nebuli1 commented Feb 28, 2024

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

@PartialVolume
Copy link
Owner

committed #228

@PartialVolume
Copy link
Owner

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

@Nebuli1
Copy link
Author

Nebuli1 commented Mar 19, 2024

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?

@PartialVolume
Copy link
Owner

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.

@Nebuli1
Copy link
Author

Nebuli1 commented Mar 19, 2024

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

@Nebuli1
Copy link
Author

Nebuli1 commented May 31, 2024

@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
#257 (comment)
Is the shredos_exclude_boot_disc=yes option implemented in it?

#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
}

@PartialVolume
Copy link
Owner

PartialVolume commented May 31, 2024

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"
}

@Nebuli1
Copy link
Author

Nebuli1 commented Jun 1, 2024

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

@PartialVolume
Copy link
Owner

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

Excellent, thanks for letting me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants