LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   USB not detecting (https://www.linuxquestions.org/questions/linux-newbie-8/usb-not-detecting-4175602406/)

Harshit_24 03-23-2017 11:59 AM

USB not detecting
 
I have created the bootable USB using command

Code:

dd if=FILE NAME HERE.iso of=/dev/sdb bs=1MB
I wanted to remove all the files present there but they become read only.

I tried to run

Code:

dd if=/dev/zero of=/dev/sdb  bs=512  count=1
But it didn't worked. After searching through out the internet, I found the command to remove the read only & remove all the files from the USB.

Code:

sudo hdparm -r0 /dev/sdb
But now after ejecting the USB & again plugging in, it is not even detecting the USB.

After running the command

Code:

fdisk -l
I got

Code:

Disk /dev/ram0: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram1: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram2: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram3: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram4: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram5: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram6: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram7: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram8: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram9: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram10: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram11: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram12: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram13: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram14: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram15: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 3F801004-655B-4485-A2D9-95FDB1B8D6BA

Device        Start        End    Sectors  Size Type
/dev/sda1      2048  159999999  159997952  76.3G Linux filesystem
/dev/sda2  160000000  176001023  16001024  7.6G Linux swap
/dev/sda3  176001024 1953523711 1777522688 847.6G Linux filesystem




Disk /dev/sdb: 14.3 GiB, 15376000000 bytes, 30031250 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

How can I remove all the files from the usb?

Thanks

rtmistler 03-23-2017 12:16 PM

Always use sudo with the dd command.

JeremyBoden 03-23-2017 02:40 PM

Quote:

Originally Posted by Harshit_24 (Post 5687346)
Code:

Disk /dev/sdb: 14.3 GiB, 15376000000 bytes, 30031250 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

How can I remove all the files from the usb?
Thanks

What files?
Code:

dmesg | tail
should give information of interest connected with the recent detection of the USB device.

erik2282 03-24-2017 09:14 AM

if you remove the usb drive and run fdisk -l again, does /dev/sdb go away?

Harshit_24 03-24-2017 10:35 AM

Quote:

Originally Posted by JeremyBoden (Post 5687417)
What files?
Code:

dmesg | tail
should give information of interest connected with the recent detection of the USB device.

I had created the bootable USB for CENTOS. I want to remove those files present in the USB.

Below is the output of the above command.

Code:

[  545.306054] scsi host2: usb-storage 1-3:1.0
[  545.306174] usbcore: registered new interface driver usb-storage
[  545.319166] usbcore: registered new interface driver uas
[  546.307118] scsi 2:0:0:0: Direct-Access    SanDisk  Ultra            1.00 PQ: 0 ANSI: 6
[  546.308825] sd 2:0:0:0: Attached scsi generic sg2 type 0
[  546.310188] sd 2:0:0:0: [sdb] 30031250 512-byte logical blocks: (15.4 GB/14.3 GiB)
[  546.311609] sd 2:0:0:0: [sdb] Write Protect is off
[  546.311628] sd 2:0:0:0: [sdb] Mode Sense: 43 00 00 00
[  546.312012] sd 2:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[  546.330395] sd 2:0:0:0: [sdb] Attached SCSI removable disk

Quote:

Originally Posted by erik2282 (Post 5687725)
if you remove the usb drive and run fdisk -l again, does /dev/sdb go away?

Yes, it doesn't shows then.


All times are GMT -5. The time now is 03:25 AM.