Tag Archives: usb keys

How to permanently remove files in Ubuntu/linux and make them unrecoverable by NickMcDTV

AddThis

How to shred (permanently delete) files from your Hard Disks on Ubuntu Linux

In our last post we examined the possibility to recover deleted data from USB keys and disks. Today we want to focus your attention on the proper way to destroy sensitive data from your disks.

On Ubuntu you have the possibility to move any file to the Trash but, as we demonstrate in our last post, anyone has the possibility to recover them using a simple, basic GUI, program called PhotoRec.

If you want to be reasonably sure that none will be able to recover a file you decided to permanently delete you have to use the Shred command. Shred is native in Ubuntu Kernel and literally delete your files overwriting them repeatedly with arbitrary data. After you delete a file with Shred you can be sufficiently sure that recovering procedures will not succeed.

As usual we must warn you that technology is rapidly evolving and what could be considered sure today, tomorrow will be out of date! So, if you think you need to preserve your privacy in the best way, don’t forget to change the hard disks regularly and mechanically destroy your old ones. Sincerely we hope our readers haven’t this kind of need.

To start using Shred on Ubuntu you have to open a Terminal and type:

sudo shred –help

In this way you will visualize the grammar and all the possible options offered by this program.

The correct grammar to use Shred is:

shred [OPTIONS] FILE

or, if you want to shred a entire partition:

shred [OPTIONS] /dev/[HDA9]

The possible options are:

  -f, –force    change permissions to allow writing if necessary
-n, –iterations=N  overwrite N times instead of the default (3)
–random-source=FILE  get random bytes from FILE
-s, –size=N   shred this many bytes (suffixes like K, M, G accepted)
-u, –remove   truncate and remove file after overwriting
-v, –verbose  show progress
-x, –exact    do not round file sizes up to the next full block;
this is the default for non-regular files
-z, –zero     add a final overwrite with zeros to hide shredding
–help     display this help and exit
–version  output version information and exit

In our experience, to operate in the fastest way, we decided to add Shred on the Nautilus Menu and have the command ready with a simple right click on the mouse.

For this reason you have to open a Terminal and type:

sudo apt-get install nautilus-actions

Then you launch the program following this path: System->Preference->Nautilus Actions Configuration.

Last, you have to configure Shred filling e.g. the following parameters:

Label: Shred
Tooltip: Shred utility to securely erase files
Icon: gtk-dialog-warning
Path: shred
Parameters: -f -u -v -z %M
Filenames: *
Mimetypes: */*
Appears if selection contains: Both
Be sure to check the box “Appears if selection has multiple files or folders“

To finish your configuration, do not forget to open again a Terminal and type:

nautilus -q

nautilus

AddThis

Recovering deleted files from USB disks on Ubuntu

Everyday we use USB keys to transfer data without transmitting them through the t. The USB keys and portable disks are small, light and their data capacity allow us to move in privacy huge files. This idyll sometimes is broken by a fatal mistake: we unintentionally delete an important file. Normally, if we are smart we recover the erased file in the Trash but in other situations when we realize the mistake we had made is too late.

In this circumstances is very import to stop to use our USB key or portable disk till we are able to use a good software for data recovering. On Ubuntu you have a wise number of dedicated software that can do this job for you, the most powerful run on Terminal as testdisk, foremost, and scalpel but you can also use a “minimal GUI” software as PhotoRec.

PhotoRec is very intuitive to use and it is able to recover many data formats from jpeg to db. After you install it using Synaptic Package Manager or the Software Center you can launch it in Terminal with:

sudo photorec

Immediately a GUI Terminal interface appears and you have just to follow the instruct  ions you visualize on your monitor.

Using the arrows and the Enter keys you have to:

1 – Choose the USB device from where you want to recover the data

2 – Select the partition table (usually Intel)

3 – Specify the partition table

4 – Select the right filesystem where the data were stored

5 – Decide if you want to try the data recovering from all the free space

6 – select the directory where you want to store the recovered data. IMPORTANT: do not store the recovered data on the same USB key you are scanning for recovering

7 – Wait till PhotoRec finishes the recover operations.

PhotoRec is fast and, during our tests, we were able to recover almost the 100% of data. Not bad!!! AddThis