Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to erase partitions with the data inside?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Wed Mar 11, 2015 5:48 pm    Post subject: How to erase partitions with the data inside? Reply with quote

I thought that removing partition deleting inside data, as well -
but it still remain - please advise how to remove the content?
With gparted, fdisk or something else
_________________
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Back to top
View user's profile Send private message
bstaletic
Apprentice
Apprentice


Joined: 05 Apr 2014
Posts: 225

PostPosted: Wed Mar 11, 2015 7:34 pm    Post subject: Reply with quote

Just use mkfs. If you delete a partition, and create a new one with the same starting sector, you wil have all the data back. You could use wipefs but there's no need. And if you're looking for secure erase you can use dd with if=/dev/zero, and if you're really paranoid use if=/dev/random and then if=/dev/zero, then format the partition.
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Wed Mar 11, 2015 7:44 pm    Post subject: Reply with quote

bstaletic Hi,

You got the point - I removed the partitions, but create new on the same sector -
I can see old data remained. I also used the same mkfs.ext4...
So I have to use wipefs...

Thanks
_________________
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Wed Mar 11, 2015 7:45 pm    Post subject: Reply with quote

man shred
Code:
shred - overwrite a file to hide its contents, and optionally delete it


off topic if you are paranoid about data than you should always create

lvm container => luks => file-system e.g. ext4 in it

and please consider when your drive marks a sector "unuseable" the data in it can never be deleted therefore

i do not want to go into details, just a suggestion, and when you read about it a bit you may get my point


Last edited by Roman_Gruber on Wed Mar 11, 2015 7:47 pm; edited 1 time in total
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1656
Location: United Kingdom

PostPosted: Wed Mar 11, 2015 7:47 pm    Post subject: Re: How to erase partitions with the data inside? Reply with quote

pmam wrote:
I thought that removing partition deleting inside data, as well -
but it still remain - please advise how to remove the content?
With gparted, fdisk or something else

GParted does remove the data when you delete a partition and reformat it. Did you delete the partition and reformat it?
_________________
Clevo W230SS: amd64 OpenRC elogind nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 OpenRC elogind xf86-video-ati. Dual boot Win 7 Pro 64-bit.
KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Wed Mar 11, 2015 7:48 pm    Post subject: Re: How to erase partitions with the data inside? Reply with quote

Fitzcarraldo wrote:
pmam wrote:
I thought that removing partition deleting inside data, as well -
but it still remain - please advise how to remove the content?
With gparted, fdisk or something else

GParted does remove the data when you delete a partition and reformat it. Did you delete the partition and reformat it?


i doubt that, it only removes the table for it, the data will be recoverable with testdisk and other tools afaik.

shred is the only choice or some other overwrite method with DD, but oyu need script for that

reformating usually means, to create an empty table, whats in the sectors still remain, because they are not overwritten... in the first place by this "quick" format afaik


Last edited by Roman_Gruber on Wed Mar 11, 2015 7:49 pm; edited 1 time in total
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10263
Location: Somewhere over Atlanta, Georgia

PostPosted: Wed Mar 11, 2015 7:48 pm    Post subject: Reply with quote

/dev/random will work...if you have a few years to wait for a hard disk's worth of entropy to be collected...or if you have a hardware random number generator feeding your entropy pool. Best bet uis to use /dev/urandom if you really want to write a random (more or less; mostly more) pattern to the disk.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43223
Location: 56N 3W

PostPosted: Wed Mar 11, 2015 7:49 pm    Post subject: Reply with quote

pmam,

dban - thats a distro for exactly that purpose. It will erase *all* the HDDs it finds in any system it is run on.
For finer control, try scrub.

Whichever you choose - don't get it wrong. There is no undo.

If you are not quite so paranoid, mke2fs -cc may do. See
Code:
man mke2fs
again, there is no undo.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Wed Mar 11, 2015 7:58 pm    Post subject: Reply with quote

Guys... I am not paranoid at all... I just removed partitions and created new,
but still can see old data - and what is important to you Neddy -
after new installation, still get the X server problem :)
So it is not a matter of security - I just want to open a new page 'tabula rasa'.
Now - Please advise the right command to erase data from partitions no. 5-9?
It is important due to no undo :wink:
_________________
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Wed Mar 11, 2015 8:09 pm    Post subject: Reply with quote

usually i did hte following

gparted live cd.

delete partitions

apply.

check

create new partition with gparted

check mountpaion / fs / so on okay.


you can do the same with fdisk or wahtever you use.

the newly created partition should be empty if you do it that way. you only see it when you run recovery tools on it like testdisk...



even mkfs.ext4 --parametersofyourchoide /diskpoint ... should create a new empty file-system (the data still can be recovered with tools)


=> as neddy pointed out

mkfs.ext4 parameters /mountpoint should be sufficent


It may help when you post here the full output when you do not succeed after you tried again

=> man history
Back to top
View user's profile Send private message
Irre
Guru
Guru


Joined: 09 Nov 2013
Posts: 340
Location: Stockholm

PostPosted: Wed Mar 11, 2015 8:10 pm    Post subject: Reply with quote

Never forget to clean up data before deleting a partition.
Code:
dd if=/dev/zero of=/dev/sdax
to clean partition x.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43223
Location: 56N 3W

PostPosted: Wed Mar 11, 2015 8:15 pm    Post subject: Reply with quote

pmam,

A partition table is just a list of pointers to your data. Its easy to recreate these pointers when they are destroyed, which is all any partition table tool does.

Likewise, filesystem metadata contains pointers to you actual data, and other useful information about it.
If you destroy these pointers, by making new filesystems, you actual user data is still there but can no longer be found through your new filesystem as it does not contain the pointers to the data.
For example, ls -al will only show . and .. but photorec will find some photos, your old inaccessable user data. photorec does not use the filesystem.

For your use case, making new filesystems is good enough.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Wed Mar 11, 2015 8:22 pm    Post subject: Reply with quote

Irre Hi,

Code:
dd if=/dev/zero of=/dev/sdax

I am doing it right now - it takes some time but it worth

Neddy,

All I can say is what I saw - I removed partitions and created on the same sectors,
and also used the same file system ext4. When I tried to create ext 4 file system,
I got a message that I have already such file system, and I was asked to approve it.
After all this trip, I could see old data, and old problems were returned from the dark past... :)

Thanks you all
_________________
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Back to top
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1747

PostPosted: Wed Mar 11, 2015 8:48 pm    Post subject: Reply with quote

Quote:
So it is not a matter of security - I just want to open a new page 'tabula rasa'.
to just "open a new page" you can simply create a new filesystem on the same, old partition. From security point of view the data will still be there, but from filesystem point of view you can't access it anymore since all the metadata is gone -> at this point all your ex-files are just a random crap you don't know how to interprete filling disk sectors you don't care about.
So, mkfs.<your filesystem of choise> will do. Just like the very first time you installed*

* but unlike the first time, you are getting screwed if you format a wrong device now
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7094
Location: Saint Amant, Acadiana

PostPosted: Wed Mar 11, 2015 11:09 pm    Post subject: Reply with quote

pmam,

creating a new filesystem will clear your partition, not sure how did you manage to keep your files. OTOH, re-install will not fix your problems in Gentoo. If you have a problem then you have to look into it and repair it.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Mon Mar 16, 2015 10:58 am    Post subject: Reply with quote

Quote:
If you have a problem then you have to look into it and repair it.

You are absolutely right – This is the preferable way – However, I guess no one can blame me as a 'fast giving up' after looking at the following X server topic -
you also participated in this repair trying, and it seems it went into dead end. You know - Time is running and need to proceed...

After put zero (wish I have so many zero, with one positive digit on the left, in my bank account :) ) and deleting partitions,
I reinstalled Gentoo – I got the same X server problem. Now that I have a clean system without any remains from old installation,
I can assume in much confidence, that this is not my fault - due to any installation/configuration mistakes – but something of non-compatibility to my machine.
At the bottom line, I downgraded intel, evdev, xorg-server packages and X server was fixed. Please see detailed report in my X server topic here:
https://forums.gentoo.org/viewtopic-t-1011220-postdays-0-postorder-asc-start-0.html

Thanks you all
_________________
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7071

PostPosted: Mon Mar 16, 2015 2:36 pm    Post subject: Reply with quote

pmam wrote:
Code:
dd if=/dev/zero of=/dev/sdax

Better use random, many fs handle writing 0 and just clean the fs table entries instead, and many hardware also handle zeroing their sectors and just don't do it to prevent unneed/unwanted writes.

Also note that many hardware manufacturers don't use 0, but &FF as "empty".
But i'm unsure what you were trying to do in real, seems like you were using a hammer to push a screw.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43223
Location: 56N 3W

PostPosted: Tue Mar 17, 2015 8:20 pm    Post subject: Reply with quote

pmam,

Software issues related to Xorg affect almost everyone. It would be all over Google and the forums.
As its only you that seems to be affected, its not problem in the source code.

Likewise, if it were a hardware error, other programs would be affected too.
You haven't reported that.

This only leaves configuration issues and your helpers would have spotted that.
That leaves me at a loss to know why Xorg does not work for you..
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Tue Mar 17, 2015 9:57 pm    Post subject: Reply with quote

NeddySeagoon,

Please see more detailed report in the relevant topic here:
https://forums.gentoo.org/viewtopic-t-1011220-start-100.html
I know that my report is quite confused, but I am doing my best - first - to fix my machine and second - to report here as good as I can.
One thing is for sure, at least for me - with the upgraded drivers, X server did not work, even after new installation; and after downgraded, it was fixed.
I have a very similar machine that have not updated, so I took the right rev of these three drivers,
and forced it, by package.mask, on the problematic machine - now I am afraid to get the same X server issue after updating of the similar machine...
Something looks to me strange, but may be I am wrong - please take a look at this output - you can see the installed downgraded driver (2.21.15) -
but you also can see the driver's rev: 2.99.917 that was installed when X server did not work -
Please advise, what does it mean [m] and if is it a stable rev?
Code:
eix x11-drivers/xf86-video-intel
[I] x11-drivers/xf86-video-intel
     Available versions:  ~*2.9.1 2.19.0 2.20.13 2.21.15 [m]~2.99.903 [m]~2.99.905-r1 [m]~2.99.906 [m]~2.99.907-r1 [m]~2.99.909 [m]~2.99.910 [m]~2.99.914 [m]~2.99.916 [m]2.99.917 {debug dri glamor (+)sna +udev uxa xvmc}
     Installed versions:  2.21.15(02:48:08 PM 03/14/2015)(dri sna udev -glamor -uxa -xvmc)
     Homepage:            http://xorg.freedesktop.org/
     Description:         X.Org driver for Intel cards


Thanks
_________________
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43223
Location: 56N 3W

PostPosted: Tue Mar 17, 2015 10:12 pm    Post subject: Reply with quote

pmam,

man exi:
       [m]4.1.4
              The  version  matches  a  local  mask  (from  /etc/portage/pack-
              age.mask),  but  it is neither "masked by profile" nor masked in
              $PORTDIR/profiles/package.mask.


That shows that you have masked those versions yourself.

man eix:
       ~3.3.5.20050130
              The version would be "masked by ~keyword"
.
So they are also testing versions.

Are you running a mixed stable and testing Gentoo?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Tue Mar 17, 2015 10:46 pm    Post subject: Reply with quote

NeddySeagoon,

OK - So [m] is for mask, and it is right - I did it...

But I do not see '~' near 2.99.917 - Is it testing ver or not?

I suppose to have a stable Gentoo - How to verify?
_________________
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum