Link to home
Start Free TrialLog in
Avatar of jodyglidden
jodyglidden

asked on

Deleting files from linux

Hi,
I have a laptop (formerly xp) with a failed drive.  I'm able to boot into knoppix and copy files over by using the following command:

mount -t smbfs -o uid=knoppix,workgroup=Workgroup,username=Username,password=Password,dmode=755 //Computer Name/Shared Folder /mnt/shared

The problem is that I can't seem to delete files from the drive once their copied.  Any idea how I can do this?  I tried taking the read only flag off, setting permissions any way I know how, etc.
Avatar of jlevie
jlevie

Are you trying to use Knoppix to get data from the failing drive and save it on the mounted share?

If that's the case I'd suggest not trying to delete any of the files from the disk. With a failing drive you could loose what's left as the result of a write to that disk, which is a necessity when deleting a file.
Avatar of jodyglidden

ASKER

Thanks.  Good advice.  I'll only be deleting the files after I'm all done then.
That's much safer. And if the disk is failing it may be that simply destroying it (if it contains sensitive information)  is the best ultimate solution.
There is some sensitive info going to be left on it if I can't delete.  I have to send it in for repair.
At this point I'd be considering how sensitive the data is with respect to the cost of a replacement drive. If the data is highly sensitive I'd simply buy a new drive and destroy the old one. Alternatively, you might contact the laptop vendor and see if they will ship you a replacement drive in exchange for the top plate of the existing drive, which allows you to destroy the rest.
Once the data is transferred, I really don't need the old drive and might as well let the company replace it as per their normal warranty program.  They won't ship me one unfortunately.
Now I'm confused. You've been saying that the drive contains sensitive information that you need to delete before having the drive replaced. But your last comment seems to indicate that as long as you can save the data from the drive that a normal warranty replacement is satisfactory.  Which condition that applies governs how you treat the drive.
I need to delete the files sensitive files from the original computer now that I have transferred them to the new computer.
Well, there's all sorts of levels of sensitive data. At on extreme you have data that must never be see except by those with a "need to know" (national security data, financial, or health data, etc). The protection of data at this level is mandated by law and there are clearly defined procedures for dealing with the absolute removal of all data from a device. Typically in the case of a failing drive where all blocks  cannot be sanitized that means destruction of the device. At the other extreme there's data that one just wouldn't want in public circulation. In that case simply over writing or re-formating the drive may be acceptable.

You have to determine how sensitive this data is and that determination will define the correct action. You do need to know that simply deleting the files doesn't remove the data. All a delete does is to remove the file name from the directory table. The file's data is untouched and is easily recoverable.
Ok, My question revolves around how do I delete.
ASKER CERTIFIED SOLUTION
Avatar of jlevie
jlevie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>> mount -t smbfs -o uid=knoppix,workgroup=Workgroup,username=Username,password=Password,dmode=755 //Computer Name/Shared Folder /mnt/shared

Okay, please correct me if I get this wrong:

1. "Computer Name" is the "laptop (formerly xp) with a failed drive"?
2. "Shared Folder" is the folder where you have your critical files that you want to delete?
3.  You boot the "Computer Name", which is XP, at the same time, boot into Knoppix on other computer on your network and mount the "Shared Folder" on "Computer Name" to "/mnt/shared" on Knoppix?

If the above are correct, you cannot delete the files in "//Computer Name/Shared Folder" because Sharing permission is read only and please don't do "dd if=/dev/zero of=/dev/hda" because you dont want to wipe out the wrong pc/laptop.
On second thought, if the "//Computer Name/Shared Folder" is where you copy your back-up data to, then as suggested by jlevie, write zeros to every block of the failed drive is a good way to wipe it.
It's a laptop right?  Failed drive but needs to be returned?

After you have finished coping all your stuff, just remove the drive, and get a whopping big magnet and pass it over it a few times... that will trash the data with no physical damage.

Nick