LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 01-16-2007, 11:08 AM   #1
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Rep: Reputation: 77
Getting Rid Of Hard Drive?


OK - I am selling my one and only hard drive which is what my Linux partition is built on.

Code:
cwilliams@stormshadow:~$ sudo df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/stormshadow-root
                      227G  5.5G  210G   3% /
tmpfs                 507M     0  507M   0% /lib/init/rw
udev                   10M   68K   10M   1% /dev
tmpfs                 507M     0  507M   0% /dev/shm
/dev/sda1             236M   22M  202M  10% /boot
The drive is a Western Digital 250GB S-ATA drive. How do I release this drive to stranger and get all the information of it being my only disk? Should I just boot from my Debian disk and run the installer as a fresh install or is there something else I can do?
 
Old 01-16-2007, 11:33 AM   #2
FnordPerfect
Member
 
Registered: Dec 2006
Location: Germany
Distribution: Kubuntu (Feisty Fawn), Debian (SID)
Posts: 127

Rep: Reputation: 15
Sorry, I didn't quite get what you are up to. I'm confused by this getting-rid expression...

do you want to
a) get all information of it, as in transfering it to a new disk, or
b) get all information off it, as in giving it to a stranger completely empty?

I suppose, you are going to give your old hard drive away and want to transfer the information on it to a new harddrive? Is this it?

Then, you probably don't need to rerun the installer at all. Your partition setup is pretty straight-forward, shouldn't be much of a hassle.

Just
* connect your new drive
* boot from your old hard drive
as root
* recreate both of your data partitions ( / and /boot) with cfdisk on the new harddrive
* create the file systems with mkfs -t ext3
* mount them somewhere (e.g., /mnt/new-hd and /mnt/new-hd/boot)
* copy the content from the old one there with cp -xRp / /mnt/new-hd and cp -xRp /boot /mnt/new-hd/boot
* After that, update /mnt/new-hd/etc/fstab if necessary
* Don't forget to reconfigure and install the boot loader on the new drive's MBR.
* Switch hard drives
* Pray that I didn't tell bullshit here

If both drives have the same dimensions, you could just "clone" them with the dd utility.

Hope that helps

~fab
 
Old 01-16-2007, 11:38 AM   #3
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
No - I am selling my drive and I have uploaded all my data to a secure NFS on my LAN. I am scared someone will be able to access the drive data and any sensitive information I have on it.

When I release the drive to the new owner, how do I make sure the drive is wiped and the data would be gone or hard to recover? I understand to some degree there is always a way to recover data depending on who and how bad they want it. What is the best process for wiping the one & only drive I have on my system?

I tried booting with Knoppix 3.6 (old) and it has a app called "QtParted" which did not work as I am still booting from the system and posting from it now. Everything is still here.

Last edited by carlosinfl; 01-16-2007 at 11:39 AM.
 
Old 01-16-2007, 11:46 AM   #4
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
I would boot a live Linux CD and use shred to overwrite the entire drive.
Code:
shred -v /dev/sda
That will overwrite the entire disk with random data 25 times. You may be satisfied with having the disk overwritten once. The shred man page has more information about the parameters that control its behavior.

Some Linux distributions may not have shred but do have a similar utility called wipe. If all else fails you could use the dd utility.
Code:
dd if=/dev/urandom of=/dev/sda bs=25K count=10G
dd works fastest if you keep the bs parameter small and allow that to reiterate many times via the count parameter.

Last edited by stress_junkie; 01-16-2007 at 11:50 AM.
 
Old 01-16-2007, 11:55 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,703

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
Reformatting and reinstalling will not really erase all of your personal data from the disk. Overwriting the disk with multiple passes with alternating ones and zeros via the dd command will pretty much keep all but the professional data recovery people from finding any real info.
 
Old 01-16-2007, 11:59 AM   #6
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
Quote:
Originally Posted by Carlwill
How do I release this drive to stranger and get all the information of it being my only disk? Should I just boot from my Debian disk and run the installer as a fresh install or is there something else I can do?
I don't understand your question. Do you want to get the information off of it and then securely wipe it of your personal info?

If that's what it is, burn your info to CD/DVD that you want to keep. Then reboot with a Knoppix CD and type shred -z -v -n 10 /dev/sda. This will overwrite the drive 10 times with different combinations of data and then a final pass with all zeros. If you're really paranoid, you can leave off the "-n 10" and it defaults to like 25 times or some large number (just be prepared to wait a day for it to finish).

EDIT: Late to the game as always! BTW after you finish shredding the drive, you can see just how good of a job you did by running a forensic program on the drive like foremost or photorec and see if it comes back with any real data.

Last edited by pljvaldez; 01-16-2007 at 12:04 PM.
 
Old 01-16-2007, 04:45 PM   #7
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
Yes - I just want to destroy all data on the disk. I know how to back up everything fine but I don't want my resume, tax info, SS#, and everything else I have on my Linux box being recovered by some 17 year old kid.
 
Old 01-16-2007, 04:49 PM   #8
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
You could download Darik's Boot and Nuke.
http://dban.sourceforge.net/
 
Old 01-16-2007, 06:11 PM   #9
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
So I just booted into Knoppix for fun and I for some reason can't understand why I am unable to browse my drives data from a Live CD?

Code:
knoppix@Knoppix:~$ sudo su -
root@Knoppix:~# cd /media/
root@Knoppix:/media# ls
cdrom  fd0  hd  hda  hdb  sda1  sda5  test
root@Knoppix:/media# cd sda1
root@Knoppix:/media/sda1# ls
root@Knoppix:/media/sda1# ls -la
total 2
drwxr-xr-x  2 root root 1024 Jan 16  2007 .
drwxr-xr-x 10 root root 1024 Jan 16  2007 ..
root@Knoppix:/media/sda1# cd ..
root@Knoppix:/media# ls
cdrom  fd0  hd  hda  hdb  sda1  sda5  test
root@Knoppix:/media# cd sda5
root@Knoppix:/media/sda5# ls
root@Knoppix:/media/sda5# ls -la
total 2
drwxr-xr-x  2 root root 1024 Jan 16  2007 .
drwxr-xr-x 10 root root 1024 Jan 16  2007 ..
It shows nothing on the 2 mounted /dev/sda drives.

What am I missing. I want to see something there before I scrub it clean.
 
Old 01-16-2007, 06:14 PM   #10
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
Were they mounted or just recognized and mount points were created? I'm guessing /etc/fstab has the "noauto" option. Try mount /dev/sda1...
 
Old 01-16-2007, 06:17 PM   #11
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
OK - that worked but as you can see my data seems to be on the /dev/sda5 partition and the same command that worked for sda1 does not for sda5, why?

Code:
root@Knoppix:/media/sda5# cd /
root@Knoppix:/# mount /dev/sda1
root@Knoppix:/# cd /dev/sda1
-su: cd: /dev/sda1: Not a directory
root@Knoppix:/# cd /media/sda1
root@Knoppix:/media/sda1# ls
System.map-2.6.17-2-k7  initrd.img-2.6.17-2-486.bak  lost+found
config-2.6.17-2-k7      initrd.img-2.6.17-2-k7       vmlinuz-2.6.17-2-k7
grub                    initrd.img-2.6.17-2-k7.bak
root@Knoppix:/media/sda1# mount /dev/sda5
mount: you must specify the filesystem type
 
Old 01-16-2007, 06:20 PM   #12
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
Maybe sda5 isn't in fstab? cat /etc/fstab
 
Old 01-16-2007, 06:24 PM   #13
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
Code:
root@Knoppix:/media/sda1# cat /etc/fstab
/proc      /proc       proc   rw,nosuid,nodev,noexec 0 0
/sys       /sys        sysfs  rw,nosuid,nodev,noexec 0 0
/dev/shm   /dev/shm    tmpfs  rw,nosuid,nodev,noexec 0 0
/dev/pts   /dev/pts    devpts mode=0622           0 0
/dev/fd0   /media/fd0  auto   user,noauto,exec,umask=000    0 0
/dev/cdrom /media/cdrom  auto   user,noauto,exec,ro 0 0
/dev/hdb /media/hdb  auto   users,noauto,exec,ro 0 0
/dev/hda /media/hda  auto   users,noauto,exec,ro 0 0
# Added by KNOPPIX
/dev/sda1 /media/sda1 ext3 noauto,users,exec 0 0
# Added by KNOPPIX
/dev/sda5 /media/sda5 auto noauto,users,exec 0 0
To me it looks fine. Perhaps I need to add another string to the "mount" command so it knows how to mount it or something like that? I obviously will need to "umount" sda5 when I am done looking at it so I can shred it.

Last edited by carlosinfl; 01-16-2007 at 06:25 PM.
 
Old 01-16-2007, 06:25 PM   #14
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
What type of filesystem is it (fdisk -l)? Change the "auto" to the right filesystem type.
 
Old 01-16-2007, 06:26 PM   #15
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
Code:
root@Knoppix:/media/sda1# fdisk -l

Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          31      248976   83  Linux
/dev/sda2              32       30401   243947025    5  Extended
/dev/sda5              32       30401   243946993+  8e  Linux LVM
Ah - yes, I did an LVM partition on that when I installed it. It has been some time ago...What do I do to view this LVM?

Last edited by carlosinfl; 01-16-2007 at 06:29 PM.
 
  


Reply



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
Installing grub to external USB hard drive for later use as internal hard drive dhave Linux From Scratch 2 12-10-2005 08:48 AM
Don't get rid of hard disk icons micder Debian 2 01-11-2005 12:26 PM
2 hard drive in system mirror 1st hard drive sburns76247 Linux - General 2 12-21-2004 01:47 AM
Grub to access new hard drive and old multi os hard drive ? gedi1 Linux - Hardware 0 06-03-2004 12:01 PM
Need to ged rid of Dynamic Drive Overlay :< muah Linux - Hardware 4 01-31-2004 08:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 07:41 PM.

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
Open Source Consulting | Domain Registration