How to erase one partition not all of the disk in a safe way on ubuntuHow can I securely erase a hard drive?Can't add space to my Ubuntu partitionSafest way to format and add unassigned partition to Ubuntu partition in a dual boot system with win 7How can I efficiently format my Ubuntu Live USB to a FAT32 partition?Recover ext4 file system after quick format
Can dual US-Canadian citizens travel to the US with an expired US passport but valid Canadian passport?
In the top five, I'm odd
Submitting list of forbidden words
Is a vector space naturally isomorphic to its dual?
Why don't the crew of Moya know the location of their homeworlds?
Fantasy movie with a deaf man, strong man who hurls cannon balls and a flying ship
Is it usual for a US president to make specific comments about a UK Prime Minister's suitability during a general election?
Can abstractions and good code practice in embedded C++ eliminate the need for the debugger?
Is there a way to download the box art for games?
A concrete example of the deficiency of triangulated categories?
Famous statistical wins and horror stories for teaching purposes
How to build CNOT gate out of universal gates?
How does a variable caster level work for spells?
I have been accused of copying two lab reports from the previous year even though I had done everything by myself
Mechanics to keep mobs and environment alive without using tons of memory?
(Re-)entering UK academic system after a long time abroad
After upgrading to Xcode 11.2 from Xcode 11.1, app crashes due to _UITextLayoutView
Are there any galaxies visible in the night sky around the Orion constellation?
Drawing a Wickselian triangle graph in Latex
Scriptwriting, screenplay writing, playwriting, blogging
Why is the Duration of Time spent in the Dayside greater than that of the Night side of the Moon for Chandrayaan-2 Orbiter?
Cisco ASA 5512X does not allow connections across VLANs to internet
Is there a greedy heuristic approach to the MILP problem?
Languages which changed their writing direction
How to erase one partition not all of the disk in a safe way on ubuntu
How can I securely erase a hard drive?Can't add space to my Ubuntu partitionSafest way to format and add unassigned partition to Ubuntu partition in a dual boot system with win 7How can I efficiently format my Ubuntu Live USB to a FAT32 partition?Recover ext4 file system after quick format
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;

I have 2 partitions, my system file, swap.. every thing is on the partition which named now (free space) because I clicked the [-] button.
The second partition is the partition where I usually store some important data in and I don't want to erase it.
What I want to do is to Erase the partition which called (free space) safely, mean if someone installed photoRec for example he will not be able to recover my old files.
I found here on this website many answers, but all of what I found guides the user to erase all of his disk; but I don't want to do that, I just want to erase one partition, because the secret data is stored there (in free space).
I don't know what is the name of this method, maybe it's replacing the free data on the partition with zeros, (I don't know but want the safest).
Another question: the hacker can't recover the files on my partition (free space) after erasing it safely even if the another partition (/dev/sda4 ntfs) is still on my device without erasing, true?
disk format safely
|
show 2 more comments

I have 2 partitions, my system file, swap.. every thing is on the partition which named now (free space) because I clicked the [-] button.
The second partition is the partition where I usually store some important data in and I don't want to erase it.
What I want to do is to Erase the partition which called (free space) safely, mean if someone installed photoRec for example he will not be able to recover my old files.
I found here on this website many answers, but all of what I found guides the user to erase all of his disk; but I don't want to do that, I just want to erase one partition, because the secret data is stored there (in free space).
I don't know what is the name of this method, maybe it's replacing the free data on the partition with zeros, (I don't know but want the safest).
Another question: the hacker can't recover the files on my partition (free space) after erasing it safely even if the another partition (/dev/sda4 ntfs) is still on my device without erasing, true?
disk format safely
The free space is not allocated to a partition; I see only a single partition being sda4 (ntfs). Free space is unallocated to any partition; dev sda is the physical disk itself (not a partition). I'm confused by what you see as the 'second' partition as I only see one (sda4)
– guiverc
Jul 14 at 4:07
Me too, I don't know any thing, the only thing I know that my linux was on that free space before I clicked the [-] button.
– sam islam
Jul 14 at 4:11
Use the space for something else (ie. make a partition there, and fill it with junk, or write 0101010 etc. on it, then something else or 1010101, then erase the partition so it' free again) - i'm still confused by your question though.
– guiverc
Jul 14 at 4:12
Maybe the question should be: I want to make safe erase for this (free space) not for the /dev/sda4 ntfs.
– sam islam
Jul 14 at 4:13
Thank you because you're trying to help me guiverc, okay I made a partition there, but this is a very big space 262GB how I'll fill all of this free space? What is the best way?
– sam islam
Jul 14 at 4:19
|
show 2 more comments

I have 2 partitions, my system file, swap.. every thing is on the partition which named now (free space) because I clicked the [-] button.
The second partition is the partition where I usually store some important data in and I don't want to erase it.
What I want to do is to Erase the partition which called (free space) safely, mean if someone installed photoRec for example he will not be able to recover my old files.
I found here on this website many answers, but all of what I found guides the user to erase all of his disk; but I don't want to do that, I just want to erase one partition, because the secret data is stored there (in free space).
I don't know what is the name of this method, maybe it's replacing the free data on the partition with zeros, (I don't know but want the safest).
Another question: the hacker can't recover the files on my partition (free space) after erasing it safely even if the another partition (/dev/sda4 ntfs) is still on my device without erasing, true?
disk format safely

I have 2 partitions, my system file, swap.. every thing is on the partition which named now (free space) because I clicked the [-] button.
The second partition is the partition where I usually store some important data in and I don't want to erase it.
What I want to do is to Erase the partition which called (free space) safely, mean if someone installed photoRec for example he will not be able to recover my old files.
I found here on this website many answers, but all of what I found guides the user to erase all of his disk; but I don't want to do that, I just want to erase one partition, because the secret data is stored there (in free space).
I don't know what is the name of this method, maybe it's replacing the free data on the partition with zeros, (I don't know but want the safest).
Another question: the hacker can't recover the files on my partition (free space) after erasing it safely even if the another partition (/dev/sda4 ntfs) is still on my device without erasing, true?
disk format safely
disk format safely
edited Jul 14 at 5:05
PRATAP
6,7184 gold badges11 silver badges44 bronze badges
6,7184 gold badges11 silver badges44 bronze badges
asked Jul 14 at 3:56
sam islamsam islam
284 bronze badges
284 bronze badges
The free space is not allocated to a partition; I see only a single partition being sda4 (ntfs). Free space is unallocated to any partition; dev sda is the physical disk itself (not a partition). I'm confused by what you see as the 'second' partition as I only see one (sda4)
– guiverc
Jul 14 at 4:07
Me too, I don't know any thing, the only thing I know that my linux was on that free space before I clicked the [-] button.
– sam islam
Jul 14 at 4:11
Use the space for something else (ie. make a partition there, and fill it with junk, or write 0101010 etc. on it, then something else or 1010101, then erase the partition so it' free again) - i'm still confused by your question though.
– guiverc
Jul 14 at 4:12
Maybe the question should be: I want to make safe erase for this (free space) not for the /dev/sda4 ntfs.
– sam islam
Jul 14 at 4:13
Thank you because you're trying to help me guiverc, okay I made a partition there, but this is a very big space 262GB how I'll fill all of this free space? What is the best way?
– sam islam
Jul 14 at 4:19
|
show 2 more comments
The free space is not allocated to a partition; I see only a single partition being sda4 (ntfs). Free space is unallocated to any partition; dev sda is the physical disk itself (not a partition). I'm confused by what you see as the 'second' partition as I only see one (sda4)
– guiverc
Jul 14 at 4:07
Me too, I don't know any thing, the only thing I know that my linux was on that free space before I clicked the [-] button.
– sam islam
Jul 14 at 4:11
Use the space for something else (ie. make a partition there, and fill it with junk, or write 0101010 etc. on it, then something else or 1010101, then erase the partition so it' free again) - i'm still confused by your question though.
– guiverc
Jul 14 at 4:12
Maybe the question should be: I want to make safe erase for this (free space) not for the /dev/sda4 ntfs.
– sam islam
Jul 14 at 4:13
Thank you because you're trying to help me guiverc, okay I made a partition there, but this is a very big space 262GB how I'll fill all of this free space? What is the best way?
– sam islam
Jul 14 at 4:19
The free space is not allocated to a partition; I see only a single partition being sda4 (ntfs). Free space is unallocated to any partition; dev sda is the physical disk itself (not a partition). I'm confused by what you see as the 'second' partition as I only see one (sda4)
– guiverc
Jul 14 at 4:07
The free space is not allocated to a partition; I see only a single partition being sda4 (ntfs). Free space is unallocated to any partition; dev sda is the physical disk itself (not a partition). I'm confused by what you see as the 'second' partition as I only see one (sda4)
– guiverc
Jul 14 at 4:07
Me too, I don't know any thing, the only thing I know that my linux was on that free space before I clicked the [-] button.
– sam islam
Jul 14 at 4:11
Me too, I don't know any thing, the only thing I know that my linux was on that free space before I clicked the [-] button.
– sam islam
Jul 14 at 4:11
Use the space for something else (ie. make a partition there, and fill it with junk, or write 0101010 etc. on it, then something else or 1010101, then erase the partition so it' free again) - i'm still confused by your question though.
– guiverc
Jul 14 at 4:12
Use the space for something else (ie. make a partition there, and fill it with junk, or write 0101010 etc. on it, then something else or 1010101, then erase the partition so it' free again) - i'm still confused by your question though.
– guiverc
Jul 14 at 4:12
Maybe the question should be: I want to make safe erase for this (free space) not for the /dev/sda4 ntfs.
– sam islam
Jul 14 at 4:13
Maybe the question should be: I want to make safe erase for this (free space) not for the /dev/sda4 ntfs.
– sam islam
Jul 14 at 4:13
Thank you because you're trying to help me guiverc, okay I made a partition there, but this is a very big space 262GB how I'll fill all of this free space? What is the best way?
– sam islam
Jul 14 at 4:19
Thank you because you're trying to help me guiverc, okay I made a partition there, but this is a very big space 262GB how I'll fill all of this free space? What is the best way?
– sam islam
Jul 14 at 4:19
|
show 2 more comments
1 Answer
1
active
oldest
votes
The free space shown in the picture is an unpartitioned portion of the disk.
To securely erase it:
1 - Create a partition on free space and format it ext4
2 - Write randoms on all space
3 - Delete created partition
Here is more details for step 2 : how to write randoms on all the free space
Let's say that the partition created from free space is
/dev/sda1Option 0 : not randoms but fill with zeros
The Ubuntu gnome-disks manager have an 'Erase' option which fill with zeros
Its quite secure but there is more secure : filling with randoms
Option 1 : Fill with randoms using dd:sudo dd if=/dev/urandom of=/dev/sda1
Option 2 : Fill with randoms using the secure deletion tool shred
If not present on the system, install it, its part of the package coreutilssudo apt install coreutils
Usage:sudo shred -v -n 1 /dev/sda1option -n 1 is for 1 pass, can be increased for more security and longer process time...
add a comment
|
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1158144%2fhow-to-erase-one-partition-not-all-of-the-disk-in-a-safe-way-on-ubuntu%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The free space shown in the picture is an unpartitioned portion of the disk.
To securely erase it:
1 - Create a partition on free space and format it ext4
2 - Write randoms on all space
3 - Delete created partition
Here is more details for step 2 : how to write randoms on all the free space
Let's say that the partition created from free space is
/dev/sda1Option 0 : not randoms but fill with zeros
The Ubuntu gnome-disks manager have an 'Erase' option which fill with zeros
Its quite secure but there is more secure : filling with randoms
Option 1 : Fill with randoms using dd:sudo dd if=/dev/urandom of=/dev/sda1
Option 2 : Fill with randoms using the secure deletion tool shred
If not present on the system, install it, its part of the package coreutilssudo apt install coreutils
Usage:sudo shred -v -n 1 /dev/sda1option -n 1 is for 1 pass, can be increased for more security and longer process time...
add a comment
|
The free space shown in the picture is an unpartitioned portion of the disk.
To securely erase it:
1 - Create a partition on free space and format it ext4
2 - Write randoms on all space
3 - Delete created partition
Here is more details for step 2 : how to write randoms on all the free space
Let's say that the partition created from free space is
/dev/sda1Option 0 : not randoms but fill with zeros
The Ubuntu gnome-disks manager have an 'Erase' option which fill with zeros
Its quite secure but there is more secure : filling with randoms
Option 1 : Fill with randoms using dd:sudo dd if=/dev/urandom of=/dev/sda1
Option 2 : Fill with randoms using the secure deletion tool shred
If not present on the system, install it, its part of the package coreutilssudo apt install coreutils
Usage:sudo shred -v -n 1 /dev/sda1option -n 1 is for 1 pass, can be increased for more security and longer process time...
add a comment
|
The free space shown in the picture is an unpartitioned portion of the disk.
To securely erase it:
1 - Create a partition on free space and format it ext4
2 - Write randoms on all space
3 - Delete created partition
Here is more details for step 2 : how to write randoms on all the free space
Let's say that the partition created from free space is
/dev/sda1Option 0 : not randoms but fill with zeros
The Ubuntu gnome-disks manager have an 'Erase' option which fill with zeros
Its quite secure but there is more secure : filling with randoms
Option 1 : Fill with randoms using dd:sudo dd if=/dev/urandom of=/dev/sda1
Option 2 : Fill with randoms using the secure deletion tool shred
If not present on the system, install it, its part of the package coreutilssudo apt install coreutils
Usage:sudo shred -v -n 1 /dev/sda1option -n 1 is for 1 pass, can be increased for more security and longer process time...
The free space shown in the picture is an unpartitioned portion of the disk.
To securely erase it:
1 - Create a partition on free space and format it ext4
2 - Write randoms on all space
3 - Delete created partition
Here is more details for step 2 : how to write randoms on all the free space
Let's say that the partition created from free space is
/dev/sda1Option 0 : not randoms but fill with zeros
The Ubuntu gnome-disks manager have an 'Erase' option which fill with zeros
Its quite secure but there is more secure : filling with randoms
Option 1 : Fill with randoms using dd:sudo dd if=/dev/urandom of=/dev/sda1
Option 2 : Fill with randoms using the secure deletion tool shred
If not present on the system, install it, its part of the package coreutilssudo apt install coreutils
Usage:sudo shred -v -n 1 /dev/sda1option -n 1 is for 1 pass, can be increased for more security and longer process time...
answered Jul 14 at 4:50
cmak.frcmak.fr
3,7841 gold badge15 silver badges31 bronze badges
3,7841 gold badge15 silver badges31 bronze badges
add a comment
|
add a comment
|
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1158144%2fhow-to-erase-one-partition-not-all-of-the-disk-in-a-safe-way-on-ubuntu%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
The free space is not allocated to a partition; I see only a single partition being sda4 (ntfs). Free space is unallocated to any partition; dev sda is the physical disk itself (not a partition). I'm confused by what you see as the 'second' partition as I only see one (sda4)
– guiverc
Jul 14 at 4:07
Me too, I don't know any thing, the only thing I know that my linux was on that free space before I clicked the [-] button.
– sam islam
Jul 14 at 4:11
Use the space for something else (ie. make a partition there, and fill it with junk, or write 0101010 etc. on it, then something else or 1010101, then erase the partition so it' free again) - i'm still confused by your question though.
– guiverc
Jul 14 at 4:12
Maybe the question should be: I want to make safe erase for this (free space) not for the /dev/sda4 ntfs.
– sam islam
Jul 14 at 4:13
Thank you because you're trying to help me guiverc, okay I made a partition there, but this is a very big space 262GB how I'll fill all of this free space? What is the best way?
– sam islam
Jul 14 at 4:19