Solved

Deleting files from linux

Posted on 2004-10-14
14
217 Views
Last Modified: 2010-03-18
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.
0
Comment
Question by:jodyglidden
  • 6
  • 5
  • 2
  • +1
14 Comments
 
LVL 40

Expert Comment

by:jlevie
ID: 12315097
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.
0
 
LVL 1

Author Comment

by:jodyglidden
ID: 12315172
Thanks.  Good advice.  I'll only be deleting the files after I'm all done then.
0
 
LVL 40

Expert Comment

by:jlevie
ID: 12315809
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.
0
 
LVL 1

Author Comment

by:jodyglidden
ID: 12319492
There is some sensitive info going to be left on it if I can't delete.  I have to send it in for repair.
0
 
LVL 40

Expert Comment

by:jlevie
ID: 12330647
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.
0
 
LVL 1

Author Comment

by:jodyglidden
ID: 12331084
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.
0
 
LVL 40

Expert Comment

by:jlevie
ID: 12331249
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.
0
Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

 
LVL 1

Author Comment

by:jodyglidden
ID: 12331475
I need to delete the files sensitive files from the original computer now that I have transferred them to the new computer.
0
 
LVL 40

Expert Comment

by:jlevie
ID: 12332893
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.
0
 
LVL 1

Author Comment

by:jodyglidden
ID: 12334420
Ok, My question revolves around how do I delete.
0
 
LVL 40

Accepted Solution

by:
jlevie earned 250 total points
ID: 12335624
If memory serves, Knoppix only provides read-only access to an NTFS file system, which explains why you can't delete files. What I'd do is to use dd to write zeros to every block of the disk, like:

dd if=/dev/zero of=/dev/hda

That may fail on bad parts of the disk, but it will certainly wipe out the partition table and the majority of the data.
0
 
LVL 5

Expert Comment

by:badrulnm
ID: 12336383
>> 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.
0
 
LVL 5

Expert Comment

by:badrulnm
ID: 12336415
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.
0
 
LVL 1

Expert Comment

by:Nick
ID: 12426457
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
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now