Friday, September 18, 2015

LowLevelFormat with Linux


I needed a script that was able to destroy the data on multiple storage devices and create a new NTFS partition.
The script needed to be plain simple, for me and eventually colleges. 

doing a quick search on the Internet I found the command shred. this program allowed me to create a simple script:

#!/bin/sh

HDD=$1

if [ -z "$HDD" ]; then
   echo "please give a drive to destroy"
else
   clear
   echo "Low Level Format of /dev/$HDD"
   shred -v -z -n 3 /dev/$HDD

   echo "Create a new NTFS FS on /dev/$HDD"
   mkfs.ntfs -f -F -S 4096 /dev/$HDD
fi

Script breakdown:
1: start a bash script
3: put the argument in var HDD
5,6: check if HDD is filled and give an error if it's not
8: clear the screen
9: print what drive will be formated
10: do the actual shred
      -v = verbose
      -z = do a zeroing at the end
      -n 3 = fill the disk with random data, 3 times
because of the verbose you will get a lot of output, giving you an idea of much longer you have to wait.

12: print the second action, creating a new partition
13: the actual command to create a new partition.

ToDo:
1. create a list of available disks, allowing the user to select the disk he/she wants to LLF
2. allow the user to change the number of random data fill
3. allow the user to change the final partition type.

Thursday, January 16, 2014

Getting the ASUS PCE-N53 to work on a ubuntu system with 3.8.x Kernel

 

Ubuntu prerequisites:

sudo apt-get install build-essential
 

Steps:

1. Download 

Get the ASUS Driver from the ASUS website
Get the 3.8 Patch rt5592sta_fix_64bit_3.8.patch
 

2. Getting the files in place

Unzip the ASUS driver: 

$ unzip Linux_PCE_N53_1008.zip
$ cd Linux 
$ tar -xvf DPO_GPL_RT5592STA_LinuxSTA_v2.6.0.0_20120326.tar.bz2
$ cd ..

copy the patch:

$ cp rt5592sta_fix_64bit_3.8.patch Linux/ 
 

3. Use the Patch

$ cd Linux/DPO_GPL_RT5592STA_LinuxSTA_v2.6.0.0_20120326/
$ patch -p1 < ../rt5592sta_fix_64bit_3.8.patch
 

4. Compile the new and improved driver

$ sudo make
$ sudo make install
$ sudo modprobe rt5592sta

5. References:

http://askubuntu.com/questions/193319/missing-driver-asus-pce-n53-11n-n600-pci-e-adapter
https://bbs.archlinux.org/viewtopic.php?id=152960