LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   can't erase / delete files usb (https://www.linuxquestions.org/questions/linux-hardware-18/cant-erase-delete-files-usb-4175624668/)

jettjett 02-28-2018 06:10 PM

can't erase / delete files usb
 
i have ubuntu os on my flash drive and the usb is now "write-protected.

i need to delete all files. can someone tell me how to clear the usb - deleting the os?

Mill J 02-28-2018 06:32 PM

Are you booting off of this usb? Or does it mount read only when you insert it?

jettjett 02-28-2018 06:49 PM

mill, it has an os on it. it had 2 partitions with the os, then i deleted 1 partition.

not trying to boot from it; yes, it mounts read only when i mount it (and try to remove files)

Mill J 02-28-2018 07:02 PM

So can you format the entire partition? my favorite tool is gparted, however Ubuntu ships with a Disks app that can do some simple partition manipulation.

colorpurple21859 02-28-2018 08:17 PM

unmount the usb partition and then reformatting the partition will remvoe all the files. This can be either done from the command line or use gparted as suggested.

jettjett 02-28-2018 09:34 PM

yes, correct, both of you. i reformatted using ubuntu "disks" like mill said = deleted the partition all together and erased all files.
thanks!

Syndacate 03-01-2018 01:50 AM

Quote:

Originally Posted by jettjett (Post 5825630)
yes, correct, both of you. i reformatted using ubuntu "disks" like mill said = deleted the partition all together and erased all files.
thanks!

For future ref, if this happens again, and formatting is not what you want to do, you can simply force mount as writeable, ie (if it's already mounted):
Code:

mount -o remount,rw /dev/foo /dir

cesarbergara 11-17-2018 04:31 PM

can't erase / delete files usb
 
Hi. Do you see in the /etc/fstab file? Maybe your system put devices (like pendrive) in the format "ro" . You can change in this file this option to "rw" and solve future and repetitive error. Other options like propietaries,group,chmod,etc can optimize your sistem.


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