[SOLVED] [Request] Subtract all numbers from specific column, [drive wiper Project]
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Can you give an example of the type of data you have as input, and precisely what you want to have output? The answer is probably sed, but I would need to see more to see how to set it up.
I need the partitions with the numbers subtracted so that when i am inserting drives i can see the drives pop up without the partitions.
I pretty much don't want to see the partitions of the drives and just the drives. so far i have revived a lot of help from these forums with a project i am working on and i am almost done. I will create a posting with pictures of what i am doing when i am done so everyone can see what they contributed to. I just need help with a few udev rules after this so i can prevent hardware freezes with shorted drives.
should show you only those entries with one character following the 'sd' Just another way...
That would work fine the problem is, iam processing up to 74 drives at a time.
I am working on a drive wiper project i need a udev rule added to /etc/udev/rules.d/ to run a specific command when a drive gets detected as inserted, into the bay. (sata ports and usb ports)
I want the hard drive shreder to show health status and start wiping right when drives are inserted. So far i have the health status log complete and shreding part done, thanks to you guys.
I just need the command to start a script with udev now
once i am done i am going to take pictures and show you guys what you helped me with, might even be able to turn this into a wiping distro for server cabinets
watch runs continuously and uses cursor commands to display the desired information at the same position which is probably why it messes with sed and no output. As far as I know udev would be a background process and not associated with a terminal window so your not going do see anything anyway.
I think you can use a dialog or window notification box to display the desired information. Please explain exactly what you are trying to accomplish with the display output.
watch runs continuously and uses cursor commands to display the desired information at the same position which is probably why it messes with sed and no output. As far as I know udev would be a background process and not associated with a terminal window so your not going do see anything anyway.
I think you can use a dialog or window notification box to display the desired information. Please explain exactly what you are trying to accomplish with the display output.
ok well that makes sense, not much really i need it to display the following in the terminal window
i want to create a udev rule like follows but iam not sure if i have it right
so for example
This is the code i tried so far, for udev. it runs the script when i restart udev service but not when i insert drive.
the shred all command will be running the following command for each drive
udev action to do drive 1
Code:
hdsentinel -solid -dev /dev/sdb | ts %Y/%m/%d-%H:%M:%S |& tee -a smartlog.1 && shred /dev/sdb -v
udev action to do drive 2
Code:
hdsentinel -solid -dev /dev/sdc | ts %Y/%m/%d-%H:%M:%S |& tee -a smartlog.1 && shred /dev/sdc -v
So far the code to execute works but the udev rule does not fully work, it does execute in background when i restart service though. This is my first time trying to do a udev script. Man if i get this right, it going to be so cool XD. Yall have been helping a lot so far.s
I need udev to also run this command so i can see the drives i am inserting in the terminal.
/dev/sd* | sed '/[0-9]/d' | nl
Last edited by finalturismo; 10-03-2019 at 06:03 PM.
I was able to find a solution using the following at the end of the command.
Code:
shred -v /dev/sdb >> /dev/pts/0 2>&1
the send to command does not show verbose for shred at the pts/0 terminal. As soon as you add 2>&1 it is able to forward verbose to terminal correctly.
I found this when looking at similar request on google , took my a while to find.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.