LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 08-16-2020, 05:03 AM   #16
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 15,302
Blog Entries: 9

Rep: Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377Reputation: 4377

Quote:
Originally Posted by zero.one View Post
No, no ... I think I was misunderstood. I appreciate anyone trying to help me ... Let me try to better explain.

So let's say in one session I would want to search for the character 'a'. This would be spread over an area that has many other characters, but let's say a 1 mb area. So let's say there are 900 'a' characters. Everyone that is found would be set to '0'. That's the end of it. Now the search might not be for a character. It can be a string and etc. I would make the script usable in other scenarios. All these things I can do with dd and other utilities, I have written and read bytes before. Even strings, but automating it, so I can simply have some utility functions to do this quickly would be better. The most important drawback is, that the drive does not have a partition. It's just a flat storage area. No filesystem etc. just raw data. So od would help, but it does all nonzero characters. However, I know it's possible to pipe it to grep then dd and etc. So I'm learning about this now. Another option might be sleuthkit.
So you want to first read the data, then wipe it?
You want to read all non-zero characters, then overwrite them with zeros.

Please tell us where my analysis is wrong, how your requirement differs from what I described.

BTW, you are correct, advanced technobabble about AI and neurons does not bring this topic forward.
 
Old 08-16-2020, 05:23 AM   #17
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 5,054
Blog Entries: 3

Rep: Reputation: 2521Reputation: 2521Reputation: 2521Reputation: 2521Reputation: 2521Reputation: 2521Reputation: 2521Reputation: 2521Reputation: 2521Reputation: 2521Reputation: 2521
You can write directly to the raw device using dd:

Code:
dd if=/dev/sde bs=1M | tr 'a' '0' | dd of=/dev/sde
From my perspective that looks like it works but there might be some gotchas which I am unaware of.

Whatever the method, there is unlikely to be a way to easily skip writing unchanged blocks unless you write a custom program in C or similar language.
 
Old 08-17-2020, 04:31 AM   #18
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 15,085

Rep: Reputation: 4957Reputation: 4957Reputation: 4957Reputation: 4957Reputation: 4957Reputation: 4957Reputation: 4957Reputation: 4957Reputation: 4957Reputation: 4957Reputation: 4957
Quote:
Originally Posted by Turbocapitalist View Post
You can write directly to the raw device using dd:

Code:
dd if=/dev/sde bs=1M | tr 'a' '0' | dd of=/dev/sde
From my perspective that looks like it works but there might be some gotchas which I am unaware of.

Whatever the method, there is unlikely to be a way to easily skip writing unchanged blocks unless you write a custom program in C or similar language.
not to speak about the booking/handling of the information stored on this device. I can't see any logic here to identify the location and size of the data to be processed.
Probably exists, but without that dd will just read/write the whole disk.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to handle a broken pipe exception (SIGPIPE) in FIFO pipe? zyroot998 Programming 5 03-03-2011 08:10 PM
PING .... pipe 2 vs pipe 3 hanen03 Linux - Networking 1 04-10-2009 10:50 AM
pipe using no pipe soathana Programming 2 02-22-2003 04:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration