LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-26-2017, 05:38 AM   #16
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 9,917
Blog Entries: 7

Rep: Reputation: 2442Reputation: 2442Reputation: 2442Reputation: 2442Reputation: 2442Reputation: 2442Reputation: 2442Reputation: 2442Reputation: 2442Reputation: 2442Reputation: 2442

Quote:
Originally Posted by ondoho View Post
ALSO, maybe you have more than 1 partition?
Quote:
Originally Posted by ddenial View Post
Code:
# extundelete /dev/sda --restore-all
the dd command you used will fill the current partition only.

/dev/sda on the other hand refers to the whole hard drive.
 
Old 02-26-2017, 11:19 PM   #17
Jjanel
Member
 
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
Blog Entries: 12

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
Question from bottom of #8...

Quote:
[`df .` shows 9xxMfree ;dd if=/dev/zero of=junk; df shows 0free; `du junk` 9yyM] then I ran extundelete [sda] from systemrescuecd, I recovered about 400GB of my [OLD deleted] private data full intact. Now explain this.
IF this is accurate, THEN I don't 'understand' 'how Linux works' (assuming 1 1T partition)

Last edited by Jjanel; 02-27-2017 at 05:05 AM.
 
Old 02-27-2017, 01:54 AM   #18
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 11,485

Rep: Reputation: 3453Reputation: 3453Reputation: 3453Reputation: 3453Reputation: 3453Reputation: 3453Reputation: 3453Reputation: 3453Reputation: 3453Reputation: 3453Reputation: 3453
sorry guy: what did you quote?
here is a possible explanation: http://prefetch.net/blog/index.php/2...hosts-with-dd/
 
Old 02-27-2017, 03:25 AM   #19
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 3,612
Blog Entries: 1

Rep: Reputation: 782Reputation: 782Reputation: 782Reputation: 782Reputation: 782Reputation: 782Reputation: 782
If you want to wipe the whole disk.

# dd if=/dev/zero of=/dev/sdXYZdiskXYZ bs=1M
# cmp /dev/zero /dev/sdXYZdiskXYZ

Where sdXYZdiskXYZ is probably not the actual name of your device. It should fail at the end of device, otherwise it didn't take. Some media fails to read only and you can NEVER delete the data. Outside of physically destroying the media. Data recovery tools like photorec / testdisk can read the entire device and reform media that was not overwritten. If you want to make those tools mostly useless, use encrypted file systems and delete your keys. SSDs tend to have reserve write-able areas and swap out used areas for them when issues or use deem it necessary. You lose access to "delete" that data, but it's still technically there. Some SSDs are encrypted by hardware with ways to delete their keys that (in theory) deletes the data by removing the ability to (easily) decrypt the data. It depends on where you place your "trust".
 
Old 02-27-2017, 03:50 AM   #20
Jjanel
Member
 
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
Blog Entries: 12

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
Will `dd if=/dev/zero of=junk` zero-out deallocated data (in a 'typical' 1-partition hdd)?

Sorry for my writing... it's from #8, bottom. The [...] are my interpretation of what was done.
The only difference is the `rm junk` (but I don't think that changes the issue here)
I thought of 'sparse' files, but I didn't think `dd if=/dev/zero of=junk` would cause them.

My interpretation of the complete scenario of what OP did, may be incomplete/incorrect.
OP seemed to be referring to a 'normally' running system, ext4, but didn't say what distro,
so wasn't writing direct to the /dev/sd..., just a file, filling fs. Maybe OP will clarify.
The goal seemed to have been: to zero-out all disk blocks containing 'deleted' data, so no 'typical' recovery process could find pieces of 'old data' (or to verify this, before&after).

I 'picked up on' the [plea]: "Now explain this." at end of #8, and couldn't, so I tried to clarify what OP did. (the only thing I could think of to add was a `du junk`, to verify it was 9yyM [900+M], just before `rm junk`)

Edit: on the distro, OP mentions Ububtu 16.10 host; CentOS VBox guest here,
so 'all MY bets are off' IF this is being done IN guest! (Because I'm not sure what .vdi 'magic' happens [tho I play only in VBoxes].) I'll 'assume' it's the Ubuntu 'normal/real' host, tho.

Last edited by Jjanel; 02-27-2017 at 05:32 AM.
 
Old 02-27-2017, 07:39 AM   #21
ddenial
Member
 
Registered: Dec 2016
Distribution: CentOS, Fedora, Ubuntu
Posts: 102

Original Poster
Rep: Reputation: 14
Sorry for delay...

My OS is Ubuntu 16.10 with ext4 file system. I was trying to delete some folders in terminal, so I issued sudo rm -rf * command, which i thought i did, but actually it was sudo rm -rf /*. It took me around 2 seconds to realize the mistake, but by the time most of OS folder like /etc and my personal mounted partitions were gone.

I first tried to recover data by using testdisk tool (from systemrescuecd). Because I was using this tool for first time, and the interface was confusing I just gave-up. The data were mostly Linux distros ISOs and Virtualbox/KVM OS backups (VDIs) which were very old anyway.

So I unmounted all partitions, deleted all logical volumes, created new logical volumes and restored my old Fedora 25 OS clone which i had created using fsarchiver.

I tend to keep this hard disk till I by new one, and then I'll donate this disk to someone. @JeremyBoden, I'm donating not gifting....

So I tried to clean the free space (individual partitions) with zero using the DD command. And then, for curiosity, I ran extundelete to check. I also recovered so many things which were very old.

I will clean again with tools like zerofree as @r3sistance suggested, but was curious how do i prove myself that all data are gone. Of course I can run again extundelete, but is that only a way?

Thanks
 
Old 02-27-2017, 08:18 AM   #22
JeremyBoden
Senior Member
 
Registered: Nov 2011
Distribution: Debian
Posts: 1,376

Rep: Reputation: 276Reputation: 276Reputation: 276
Quote:
Originally Posted by ddenial View Post
@JeremyBoden, I'm donating not gifting....
Is there a difference?
And the disk, according to you, is on its last legs...
 
1 members found this post helpful.
Old 02-27-2017, 11:26 AM   #23
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 9,477

Rep: Reputation: 990Reputation: 990Reputation: 990Reputation: 990Reputation: 990Reputation: 990Reputation: 990Reputation: 990
Shred overwrites random data many times in an attempt to confuse forensic recovery techniques.

Using the retrospectoscope, it might be optimal to invert the data bit for bit, (i.e. 10101010 becomes 01010101) and leave it in that state for a while, THEN shred it.
 
Old 02-28-2017, 03:52 PM   #24
ddenial
Member
 
Registered: Dec 2016
Distribution: CentOS, Fedora, Ubuntu
Posts: 102

Original Poster
Rep: Reputation: 14
Quote:
Originally Posted by JeremyBoden View Post
Is there a difference?
And the disk, according to you, is on its last legs...
Seriously man! I cant believe you are trolling me on this. You don't have this concept of donation.. isn't it? Heard of organizations who take your old computer junks, dissect them, take the good part, join them with other good parts of others, make them like real new, assemble them like real new and donate them to poor countries.

Buddy! just google how you can donate your old computer junks, there are lot of good private organizations who will come to your home and collect them.
 
Old 02-28-2017, 04:05 PM   #25
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 19 MATE
Posts: 6,235
Blog Entries: 2

Rep: Reputation: 1992Reputation: 1992Reputation: 1992Reputation: 1992Reputation: 1992Reputation: 1992Reputation: 1992Reputation: 1992Reputation: 1992Reputation: 1992Reputation: 1992
Quote:
Originally Posted by ddenial View Post
Seriously man! I cant believe you are trolling me on this. You don't have this concept of donation.. isn't it? Heard of organizations who take your old computer junks, dissect them, take the good part, join them with other good parts of others, make them like real new, assemble them like real new and donate them to poor countries.

Buddy! just google how you can donate your old computer junks, there are lot of good private organizations who will come to your home and collect them.
If a disk is failing then, once any data is recovered from it, the best place for it is in the bin. The cost of repairing it, if in fact possible, is in most cases much more than of replacing it.

Donating it to an organization will only result in the wasted time of the volunteers who test the disk only to find it failing and, if it somehow gets past these tests, the probable and eventual loss of data in the computer of the person who receives it.

Knowing that a disk is failing and deciding to donate it is therefore pretty irresponsible, imo.
 
Old 02-28-2017, 04:34 PM   #26
ddenial
Member
 
Registered: Dec 2016
Distribution: CentOS, Fedora, Ubuntu
Posts: 102

Original Poster
Rep: Reputation: 14
Quote:
Originally Posted by hydrurga View Post
If a disk is failing then, once any data is recovered from it, the best place for it is in the bin. The cost of repairing it, if in fact possible, is in most cases much more than of replacing it.

Donating it to an organization will only result in the wasted time of the volunteers who test the disk only to find it failing and, if it somehow gets past these tests, the probable and eventual loss of data in the computer of the person who receives it.

Knowing that a disk is failing and deciding to donate it is therefore pretty irresponsible, imo.
I give up.
 
  


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
Zero out deleted files to recover disk space? JoeyB Linux - Newbie 3 03-23-2016 08:54 PM
Disk full. Deleted files but no space available. atrejo Linux - General 3 05-03-2010 03:00 PM
[SOLVED] Deleted 25 million records from database, had no effect on disk space the182guy Linux - Newbie 5 10-03-2009 11:35 AM
3Gb of disk space lost! Disk space problem or mother board conflicts with HDD Mistreated Linux - Hardware 4 12-06-2004 04:58 PM
what files can be safely deleted to save disk space? rohan208 Linux - General 9 05-27-2004 09:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:03 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration