6

This question already has an answer here:

The Problem

It was a bootable Ubuntu USB drive at first I tried to format it using Nautilus it didn't work, then i simply deleted the partition using Gparted and created a new FAT32 partition. but when I tried to copy anything to the USB drive it gave me this error. I'm the owner of the location, technically I should be able to write to it.

Screenshot

What I've tried so far

  1. Tried formatting the partition to NTFS, it gave me the same error

  2. Tried formatting the partition to EXT4, root took the ownership of the location, I got the ownership back by running

    chown -R user:user PATH
    

    it did work, I became the owner but the error was still there.

  3. Tried formatting using Disk app, formatting was successful but I still can't write.

  4. Since it's a USB OTG drive, I tried connecting it to my Phone (Nexus 5) and strangely I can write to it from my phone (using ES file Explorer), written files are visible in Nautilus but i still can't write new data to it using Nautilus

  5. I don't have windows installed so I can't format it from there.

output of lsblk

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sdb      8:16   0   1.8T  0 disk 
├─sdb4   8:20   0   713G  0 part /mnt/Series
├─sdb2   8:18   0   220G  0 part /mnt/Movies
├─sdb3   8:19   0   710G  0 part /mnt/Hollywood
└─sdb1   8:17   0   220G  0 part /mnt/Stuff
sdc      8:32   1  15.1G  0 disk 
└─sdc1   8:33   1  15.1G  0 part /media/sumeet/bb499853-a4a5-40dd-
a5cc-c94d4ec0a
sda      8:0    0 111.8G  0 disk 
├─sda5   8:5    0  14.3G  0 part /
├─sda1   8:1    0   7.6G  0 part [SWAP]
└─sda6   8:6    0  89.9G  0 part /home

Disk is question here is dev/sdc1 which is Strontium Nitro USB drive

output of mount is posted here at Paste Ubuntu

output of ls -l /media/sumeet/rupam

total 5568
-rw-r--r-- 1 sumeet sumeet 1833612 Apr 11  2017 IMG_20170325_191153.jpg
-rw-r--r-- 1 sumeet sumeet 2537997 Apr 11  2017 IMG_20170329_200512.jpg
-rw-r--r-- 1 sumeet sumeet 1319450 Apr 11  2017 IMG_20170407_085110.jpg

UPDATE (I've written this section in little bit of rush, if it needs further explanation, please ask)

I tried running this command as suggested in the answer

sudo dd if="/dev/zero" of="/dev/sdc1"
sudo reboot

which took forever, and after reboot my USB drive wasn't mounted I tried to mount it at /mnt/sdc1 by running

sudo mount -o rw,users,umask=000 /dev/sdc1 /mnt/sdc1

which gave me this output
mount: wrong fs type, bad option, bad superblock on /dev/sdc1,
   missing codepage or helper program, or other error

   In some cases useful info is found in syslog - try
   dmesg | tail or so.

when I last formatted it I clearly remember it being ext4 partition on the USB drive, so i ran this command to fix that I've used this command before on same issue on my /dev/sdbn partitions

 sudo e2fsck -f -b 32768 -y /dev/sdc1

now it says

e2fsck 1.43.3 (04-Sep-2016)
e2fsck: Bad magic number in super-block while trying to open /dev/sdc1

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
or
e2fsck -b 32768 <device>

Is their a way that I can know that my partition (USB drive) was actually Ext4?

after all this sudo lsblk -f isn't showing any partition type on my drive

NAME   FSTYPE LABEL     UUID                                 MOUNTPOINT
sdb                                                          
├─sdb4 ext4   Series    707694b6-97b8-4374-9283-c98192591486 /mnt/Series
├─sdb2 ext4   Movies    b2d7f1a7-f3e6-4ca5-9925-d8225c897e4d /mnt/Movies
├─sdb3 ext4   Hollywood c2104e2a-cc8e-4b7b-9bba-a05d316472b4 /mnt/Hollywood
└─sdb1 ext4   Stuff     54c9765b-af6d-4a62-905f-09b56e280178 /mnt/Stuff
sdc                                                          
└─sdc1                                                       
sda                                                          
├─sda2                                                       
├─sda5 ext4             1cdd8ee7-c5c6-4bd6-af9b-9ed320f50c30 /
├─sda1 swap             d1749176-6c41-4961-a6bd-0c6a56968970 [SWAP]
└─sda6 ext4             161aa7c2-8e61-4848-8615-49cf66d80130 /home

UPDATE 2

mkusb finally solved my problem, USB drive is back and fully working

mkusb community wiki

marked as duplicate by Android Dev, 2707974, Elder Geek, Eric Carvalho, Anwar Apr 14 '17 at 15:15

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    Please edit your post to include the output of lsblk and mount Thank you for helping us help you! – Elder Geek Apr 10 '17 at 16:26
  • 1
    Maybe the problem is 'only' how it is mounted. Please try according to the following link, askubuntu.com/questions/895733/copying-files-to-a-usb-drive/… – sudodus Apr 10 '17 at 17:35
  • 1
    @SumeetDeshmukh a paste link is fine. – Elder Geek Apr 10 '17 at 17:42
  • 1
    @sudodus i tried everything that answer has asked me to do, but nothing has changed, i could write with sudo privileges as suggested in the answer. cat as user also worked i could see the content of the text file, unfortunately test deleting as user rm didn't work nor did the test writing as user, finally i did the last step, unmounted and then mounted with full permission, it got mounted with full permission but error still exists. – Sumeet Deshmukh Apr 11 '17 at 2:27
  • 2
    I'd trysudo dd if=/dev/zero of=/dev/sdc bs=1M count=1to erase the boot-sector and reformat the drive. – mook765 Apr 11 '17 at 5:09
6

I've had this same issue with recent versions of Ubuntu when creating Live USBs. If your issue is the same as mine, the fix I have implemented is a very simple one. The issue seems to be related to the file system dumped onto the USB when you create an Ubuntu Startup Disk. Wiping the very beginning of the USB device erases whatever causes this problem.

Here's what you want to do.

  • Determine the path to your device, not the partition path. Mine is /dev/sdd. The device path will never end with a number! Numbers indicate partitions on the device. The device path should look something like /dev/sdX, where X is a letter a-z. Use the gnome-disks tool, select your device, and look at the window title.disks.png
  • Make sure none of the partitions on your USB device are mounted.
  • Armed with your device path run the following command, replacing /your/device with your device path (WARNING: this will destroy existing data on the device you provide the path for)

    sudo dd if=/dev/zero of=/your/device bs=1M count=10
    
  • Finally, now try reformatting your USB, and it should be back to normal

  • I tried to reproduce the error, by doing what I did again, and tried to solve it using your approach and it did work – Sumeet Deshmukh Apr 11 '17 at 7:59
  • @SumeetDeshmukh - So this is a duplicate of my question then... – Android Dev Apr 11 '17 at 10:45
  • @AndroidDev seems like it – Sumeet Deshmukh Apr 11 '17 at 10:47

Not the answer you're looking for? Browse other questions tagged or ask your own question.