LinuxQuestions.org
Help answer threads with 0 replies.
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
  Search this Thread
Old 03-23-2017, 12:59 PM   #1
Harshit_24
Member
 
Registered: Jul 2014
Location: India
Distribution: CentOS
Posts: 75

Rep: Reputation: 5
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

Last edited by Harshit_24; 03-23-2017 at 01:00 PM.
 
Old 03-23-2017, 01:16 PM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 8,439
Blog Entries: 13

Rep: Reputation: 3759Reputation: 3759Reputation: 3759Reputation: 3759Reputation: 3759Reputation: 3759Reputation: 3759Reputation: 3759Reputation: 3759Reputation: 3759Reputation: 3759
Always use sudo with the dd command.
 
Old 03-23-2017, 03:40 PM   #3
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,652

Rep: Reputation: 362Reputation: 362Reputation: 362Reputation: 362
Quote:
Originally Posted by Harshit_24 View Post
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.
 
Old 03-24-2017, 10:14 AM   #4
erik2282
Member
 
Registered: May 2011
Location: TX
Distribution: Debian
Posts: 769

Rep: Reputation: 223Reputation: 223Reputation: 223
if you remove the usb drive and run fdisk -l again, does /dev/sdb go away?
 
Old 03-24-2017, 11:35 AM   #5
Harshit_24
Member
 
Registered: Jul 2014
Location: India
Distribution: CentOS
Posts: 75

Original Poster
Rep: Reputation: 5
Quote:
Originally Posted by JeremyBoden View Post
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 View Post
if you remove the usb drive and run fdisk -l again, does /dev/sdb go away?
Yes, it doesn't shows then.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
USB devices stop detecting (or un-detecting). Mleahy Linux - Desktop 1 07-31-2011 03:08 AM
Embedded USB hub NOT detecting any usb devices zaks_974 Linux - Embedded & Single-board computer 2 09-16-2010 01:47 AM
detecting a USB printer lobo78 Linux - Hardware 3 05-21-2004 07:13 AM
Detecting USB mouse? NovaBurst Slackware 12 04-08-2004 10:00 PM
stop hotplug from detecting things connected to usb (but still noticing usb itself) TheOneAndOnlySM Linux - Hardware 5 10-18-2003 11:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:38 PM.

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