20

I have a USB cooldisk 8.0 GB. it was full of Windows viruses. I tried to delete them under Ubuntu 13.04, but it didn't allow me to delete anything!

I formatted it using 'Disks' to FAT filesystem and overwrite all data by zero. Again, I can't delete anything! I can't change permission of any file!

But, I can do anything by Terminal (CLI). I can create folder by mkdir. I can copy files by cp. etc. I ran sudo chmod 777 -R /media/me/USB/*, but the permission did not change:

enter image description here

I want do all this in Nautilus. It does not allow me to create folder, copy, change permissions in Nautilus (Files).

What's the problem?

Zanna
  • 72,312
mini
  • 2,385

9 Answers9

26

It is not necessary to format the flash drive or to nuke the partition. You can go to mount and then change the ownership of your flashdrive. On ubuntu :

cd /media
sudo chown -R username drivename

Of course replace username by your username and drivename by the name of your flash drive.

Then you will be able to use nautilus as usual to copy/move/delete your files.

Richard
  • 1,081
2

Try formatting it into ext4 format, then again format it in FAT. And you can also try the command , sudo rm /media/me/USB/* . Be sure to copy your files before formatting.

1

I had the same problem. I don't know how it happened, I also used the gnome disk management app, and somehow my directory in /media had the wrong ownership:

drwxr-x--- 1 root  root  0 Sep 28  2012 me

I deleted it (after unmounting all media), plugged in a usb drive and the directory has been recreated correctly:

drwx------ 1 me    root 18 Mai  1 01:59 me

Now everything's fine again.

1

go to "users and group". Change the account type from "desktop user" or "custom" to "administrator". This will give you the permissions if you are using a personal computer

1

With my pen drive: formatting, changing partition type didn't helped.

/media/user was empty, although nautilus was showing USB as mounted.

It helped simple:

Run disks, click settings of that drive, mounting, disable automounting, identify as: I chosed simply /dev/sdb1 click OK, unmount and mout again.

Martin
  • 53
1

I had the same issue with only being able to write as root. The only thing that worked for me was to use the Terminal (assuming that "sdb" is the name of your drive)

sudo umount /dev/sdb
sudo mkdosfs -F 32 -I /dev/sdb

Again this worked in my situation when all gui solutions were failing, even opening Nautilus as root and changing permissions.

0

I ended up fixing this problem after assuming that the Disks software had set it. I used Disks to format the USB drive into a FAT32 partition. I made the mistake of switching the User Session Defaults in Mount Options to off then back on for that drive. That can mess with your distribution. I fixed it by going back into Disks and checked for certain that I was using the User Session Defaults first. Then I quick formatted the drive again. Once I remounted the drive with my file manager again it was all cleared up. Everything was back to usual. I had initially tried tweeking a bunch of other settings on the system but nothing helped. I never had any problems until I used that switch in Disks. It's obviously not meant to be used on removable media. You have to let your system deal with that.

0

The whole process is quite long tho... what i did to solve the issue was this: i simply went to the drive that i was trying to gain ownership to and opened it in terminal.

Then i typed in :

cd ..

after that i then typed in:

ls

to check the name of the drive do the following ... it should look something like this:

usr@usr-MacBookPro:/mnt$ ls

usb-SanDisk_Cruzer_Force_00000822011421020600-0:0-part1

In the above case, the name of the drive was usb-SanDisk_Cruzer_Force_00000822011421020600-0:0-part1

then copy that name of the drive and close the terminal... then open up a new terminal and type df -Th | grep followed by the name of your drive. It should look like this :

df -Th | grep usb-SanDisk_Cruzer_Force_00000822011421020600-0:0-part1

if you were shown vfat or exfat then you can follow along to resolve the issue by typing this :

usr@usr-MacBookPro:~$ sudo umount/ {the drive name}

then write user name in the place of usr in the following code, it should mount your drive in a way that allows you to write files in that drive :

sudo mount -o uid=$(id -u usr),gid=$(id -g usr) /dev/sdb1 /mnt/{the drive name}

please inform me if any other issues occur... thanks:)

0

OPTION 1

Delete All files

If you run Disk Management, and click on the usb drive (SD card in the example below)

enter image description here

Click on the gear symbol (circled in red) and format the drive. this will clear it of all files.

OPTION 2

Delete individual files

if you do not want to delete them all, open terminal with Ctrl + Alt + T and type in the following

sudo nautilus

Then navigate to your drive and delete should then work as the sudo command before nautilus gives Nautilus root privileges.

OPTION 3

If you still can not access files

You should be able to change permissions by

  • mounting it with root nautilus (su then after entering the password, type nautilus)
  • then navigate to the drive and transferring permissions to 'guest'.
Simon
  • 4,843