LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
LinkBack Search this Thread
Old 01-31-2013, 04:40 PM   #1
Quon
LQ Newbie
 
Registered: Nov 2011
Posts: 20

Rep: Reputation: 0
How do you REALLY delete images from a flash drive (such as for a digital camera)


I have a 2gb flash drive, and when I open it in Nautilus (on OpenSUSE) and delete the contents (images/videos from my camera), they disappear however they are actually just hidden. The free space doesn't change at all.

Instead it creates a new folder called .Trash-1000 and moves my photos/videos into that folder. If I delete it from there it still doesn't actually delete them either.

F-spot only works for the images, not the videos.

Basically I want to be able to mount my flash drive, and delete its content and stick it back in my camera and then have 2gb of free space again.

I do not know whether this is a Nautilus problem, an OpenSUSE problem, or a Linux problem, but some developers somewhere are mentally retarded. What is the logic behind the stupidity?

Solutions, please...
 
Old 01-31-2013, 04:52 PM   #2
snowpine
Senior Member
 
Registered: Feb 2009
Posts: 3,871

Rep: Reputation: 1037Reputation: 1037Reputation: 1037Reputation: 1037Reputation: 1037Reputation: 1037Reputation: 1037Reputation: 1037
Wow, that's kind of insulting, both to the Linux developers and to the mentally handicapped.

Anyway, Nautilus has an "empty trash" feature that, you guessed it, empties the trash. You can also go to Preferences->Behavior and enable the "Include a Delete command that bypasses trash" option.
 
Old 01-31-2013, 04:58 PM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Slackware
Posts: 14,888
Blog Entries: 2

Rep: Reputation: 3808Reputation: 3808Reputation: 3808Reputation: 3808Reputation: 3808Reputation: 3808Reputation: 3808Reputation: 3808Reputation: 3808Reputation: 3808Reputation: 3808
The logic behind that is quite simple. To enable the user to undo a deletion long time ago filemanager developers came up with the idea of a trashcan. So if you use a filemanager to delete files they only get moved to the trashcan. Just empty the trashcan and your files will get deleted permanently. This idea of those "mentally retarded" developers have literally saved an uncountable amount of people from doing their work twice.

The alternative from just emptying the trashcan would be to either tell your filemanager to permanently delete those files (most filemanagers have such an option) or to just delete the files using the commandline, which does not use the trashcan.
 
1 members found this post helpful.
Old 01-31-2013, 07:49 PM   #4
Quon
LQ Newbie
 
Registered: Nov 2011
Posts: 20

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by snowpine View Post
Wow, that's kind of insulting, both to the Linux developers and to the mentally handicapped.

Anyway, Nautilus has an "empty trash" feature that, you guessed it, empties the trash. You can also go to Preferences->Behavior and enable the "Include a Delete command that bypasses trash" option.
Changing the setting works for deleting new files (see below) so that is not an issue anymore, but as for emptying the trash, it is not moving the files to the Trash in the first place.

Quote:
Originally Posted by TobiSGD View Post
The logic behind that is quite simple. To enable the user to undo a deletion long time ago filemanager developers came up with the idea of a trashcan. So if you use a filemanager to delete files they only get moved to the trashcan. Just empty the trashcan and your files will get deleted permanently. This idea of those "mentally retarded" developers have literally saved an uncountable amount of people from doing their work twice.

The alternative from just emptying the trashcan would be to either tell your filemanager to permanently delete those files (most filemanagers have such an option) or to just delete the files using the commandline, which does not use the trashcan.
I know about the trash can. It does not move the files to the trash can, it is literally hiding the files on the drive.

It creates a hidden file entitled .Trash-1000 where it attempts to hide most of the files but it also seems to be hiding files elsewhere (i know this by looking at the free space which remains 600 MB short of 2 GB, since I managed to delete the contents of the .Trash-1000 folder not by deleting them from the .Trash-1000 folder (since it will only hide them again) but by deleting the folder itself.)

The file > empty trash option does not delete the files from the drive (it deletes files from the trash, the normal trash on the desktop). It does not remove files from the .Trash-1000 folder or anywhere else on the flash drive. To remove files from that folder I had to delete the folder itself, but that still doesn't delete all the files.

Doing so gave me back 1.4 GB however it is still hiding 600 MB worth of files somewhere on my 2gb flash drive and I cannot locate where it is hiding them so there is another place where it is hiding files also.

Whether this 600MB worth of files remaining is due to having deleted the entire .Trash-1000 folder, i do not know, but i doubt it since it makes no sense that it would delete some but not all of the files contained in it. There is probably another place where it is also hiding files from me or else for some reason some of the files remain but are now inaccessible since nothing points to that place on the drive (even by recreating the folder). Nothing reveals itself through "show hidden files".

To reiterate, this is not a matter of deleted files being moved to the trash as is the case when you normally delete something. This is a matter of files being intentionally preserved and deliberately hidden from me somewhere on the device.

Mac OS X is known for pulling this shit too (since I had this problem long ago and resolved it through OS X forums found on Google which I can no longer find since Google panda crapped on the internet), Im guessing the developers responsible were trying to copy.

New problem: I need to get the other 600MB back, but I cannot locate any files on the device (including hidden files).
 
Old 01-31-2013, 09:05 PM   #5
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Slackware
Posts: 14,888
Blog Entries: 2

Rep: Reputation: 3808Reputation: 3808Reputation: 3808Reputation: 3808Reputation: 3808Reputation: 3808Reputation: 3808Reputation: 3808Reputation: 3808Reputation: 3808Reputation: 3808
When emptying the trash does not delete the files in the hidden directory .Trash-1000 there seems to be a bug and it would be nice if you would report it to the Nautilus developers.

To get your space back simply format the drive, this should leave no traces of unreachable files.
You can use GParted or other GUI tools or just mkfs from the commandline for that.
 
Old 02-01-2013, 06:57 AM   #6
Inkit
Member
 
Registered: Feb 2011
Location: India
Distribution: Mint 10
Posts: 141

Rep: Reputation: 15
Hey Quon,
I'm not an expert on Linux, nor am I one on cameras, but I do own a digital camera and do import pictures into my system now and again. A simple solution would be for you to click the "Delete files from device after importing" or some such option while importing. I've not used F-spot in a long time so I'm not sure, but shotwell has this option and it works very well for me. And I've managed to fill and refill my 4 GB's worth of space umpteen times without doing anything else.

But then again, maybe the developers have a personal grudge against you and are doing something just to irritate the crap out of you.
 
Old 02-01-2013, 08:31 AM   #7
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,390
Blog Entries: 2

Rep: Reputation: 900Reputation: 900Reputation: 900Reputation: 900Reputation: 900Reputation: 900Reputation: 900Reputation: 900
The utility du will show where disk space is being used. The rm command will allow you to delete unwanted files. The mkfs command will allow you to format the partition(s) to recover all available space and effectively remove all content. Consult your local man page for the details on each command.

Your insulting language does not endear you to those from whom you seek assistance.

--- rod.
 
1 members found this post helpful.
Old 02-01-2013, 09:22 AM   #8
goumba
Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Debian Wheezy (7.0), Jessie (future 8) and Sid (unstable)
Posts: 473
Blog Entries: 2

Rep: Reputation: 53
And for the future: Nautilus, Thunar and most file managers under many operating systems, you hold down Shift when you press the Delete key and it bypasses the Trash Can, Recycle Bin, or whatever you want to call it. Those files will be gone.
 
Old 02-01-2013, 10:16 AM   #9
charging-ibis
Member
 
Registered: Dec 2011
Location: Columbus, OH
Distribution: Slackware 13.37
Posts: 36

Rep: Reputation: 0
To do a secure Delete is the use this command:
Code:
 dd if=/dev/zero of=/dev/<What ever device it's mounted as> bs=512 count=1
This fills your drive with zeros. This also prevents anybody from recovering your data from your drive versus, if doing a regular rm(delete) command, some one knowledge-able could just recover your pictures or data that you had supposedly deleted. People like, you know: malicious hackers, Law enforcement, etc...

But after using the dd command, go ahead and use what ever disk partitioning tool you prefer to create a partition.

Next run 'partprobe' command so that the system can update the '/etc/fstab'.

Next after committing(Writing) your new partition, you want to use the 'mkfs' utility to create the file system of what ever the file format you desire to use. like:
Code:
 mkfs.ext4 /dev/sdb1
After making the file system, go ahead and mount the filesystem for example:
Code:
 mount /dev/sdb1 /home/some_user23/pictures/photostuff
Then verify that the file system is mounted by entering:
Code:
 mount
You should get a list of all devices and filesystems that are currently mounted. The recently newly created one should be listed @ the bottom of the out put.

I hope this helps you out alot.

~ Thanks.
 
Old 02-01-2013, 10:29 AM   #10
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Slackware
Posts: 14,888
Blog Entries: 2

Rep: Reputation: 3808Reputation: 3808Reputation: 3808Reputation: 3808Reputation: 3808Reputation: 3808Reputation: 3808Reputation: 3808Reputation: 3808Reputation: 3808Reputation: 3808
Quote:
Originally Posted by charging-ibis View Post
To do a secure Delete is the use this command:
Code:
 dd if=/dev/zero of=/dev/<What ever device it's mounted as> bs=512 count=1
This fills your drive with zeros. This also prevents anybody from recovering your data from your drive versus, if doing a regular rm(delete) command, some one knowledge-able could just recover your pictures or data that you had supposedly deleted. People like, you know: malicious hackers, Law enforcement, etc...
The code you provided will not fill the drive with zeroes, it will just overwrite the MBR with zeroes. This does not in anyway effect the recoverability of the data and therefore is not a secure way to delete data. To get the wanted behavior remove the count option from the command (and use larger blocksizes to get better performance).
 
Old 02-01-2013, 12:18 PM   #11
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,390
Blog Entries: 2

Rep: Reputation: 900Reputation: 900Reputation: 900Reputation: 900Reputation: 900Reputation: 900Reputation: 900Reputation: 900
I don't think the OP is concerned about obscuring anything, just making the full capacity of his media available. Re-writing the partition table will do that, if followed by creating a new filesystem on the media.
I don't know what partprobe does, but I would hope it doesn't add anything to fstab that would try to mount the flash media at boot time. Most people use flash media as removable, and it should probably only be mounted when inserted into a reader. I also wouldn't recommend an ext4 filesystem type on media that a camera is supposed to read/write. All the cameras I've used (small sample size) need a FAT filesystem on the flash media they use.

--- rod.
 
Old 02-02-2013, 05:23 AM   #12
goumba
Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Debian Wheezy (7.0), Jessie (future 8) and Sid (unstable)
Posts: 473
Blog Entries: 2

Rep: Reputation: 53
Quote:
Originally Posted by charging-ibis View Post
To do a secure Delete is the use this command:
Next run 'partprobe' command so that the system can update the '/etc/fstab'.
Quote:
Originally Posted by theNbomr
I don't know what partprobe does, but I would hope it doesn't add anything to fstab that would try to mount the flash media at boot time.
partprobe does not do anything to /etc/fstab. It requests that the kernel to re-read the partition table of a device. In fact as it's name implies partprobe only knows about partitions, and nothing of filesystems, and would have no place modifying /etc/fstab.

Being the OP was using the card in some other device (camera), ext4 cannot be used as well. Besides Android phones (and as I own none, I can not speak for it's removable media, only the built in memory), there are very few consumer electronics out there that support anything other than FAT (more specifically FAT32/VFAT).

As far as the condescending attitude toward developers... Windows now has a frowning smiley when it gives a BSoD, so maybe such persons would be happier with such an OS with useless cute stuff.

Like I said earlier, based on the OPs original request, Shift + Delete in Nautilus is all he needed.

Last edited by goumba; 02-02-2013 at 05:29 AM. Reason: I wish I could spell things right the first time.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
can't connect usb pen drive and digital camera centos123 Linux - Hardware 6 05-09-2012 06:23 AM
Kodak EasyShare v803 digital camera -- drivers or drive detection? moxieman99 Linux - Hardware 2 03-02-2008 09:33 AM
Digital Camera Card Drive dudeman41465 Linux - Software 1 09-27-2005 08:51 PM
Automatically copy images off digital camera taboom Linux - Software 7 08-31-2005 03:07 PM
problem with mounting flash memory card from digital camera jogurt666 Linux - Hardware 3 12-07-2003 11:54 AM


All times are GMT -5. The time now is 07:17 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration