Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello.
I have a PenDrive that when Plugged it to the system, Linux can't open it and show it as "Generic".
$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 046d:c05a Logitech, Inc. Optical Mouse M90
Bus 003 Device 002: ID 8087:8008 Intel Corp.
Bus 004 Device 002: ID 8087:8000 Intel Corp.
Bus 001 Device 008: ID 058f:1234 Alcor Micro Corp. Flash Drive
$ sudo mkfs.vfat /dev/sdc
mkfs.vfat 3.0.13 (30 Jun 2012)
/dev/sdc: No medium found
I guess my Pendrive Corrupted but can I have any hope?
Take care about which device actually is your USB stick !!! The next
command will render all data on /dev/sdx inaccessible !!!
(1) First, wipe the bootsector of the USB stick:
dd if=/dev/zero of=/dev/sdx bs=512 count=1
(2) Then, create a new FAT32 partition on the stick and write a FAT32
filesystem on it (vfat or type b in fdisk terminology):
fdisk /dev/sdx <<EOF
n
p
1
t
b
w
EOF
mkdosfs -F32 /dev/sdx1
The 10 lines starting with 'fdisk /dev/sdx <<EOF' and ending with the
single word 'EOF' is actually one single command spread over ten lines,
including the two empty lines in the middle. This format is called a
'here-document'. It allows you to use a command which expects interactive
input in a non-interactive way. If you're uncomfortable with the above
command you can just run
fdisk /dev/sdx
and create a partition interactively :-)
==========================================================
Author: Eric Hameleers <alien@slackware.com> 17-feb-2011
Blog post: http://alien.slackbook.org/blog/installing-slackware-using-usb-thumb-drive/
Wiki URL: http://www.slackware.com/~alien/dokuwiki/doku.php?id=slackware:usbboot
Before you do the above, with the attendant dangers, try running dmesg as root and seeing whether it sees the pen drive.
Dmesg outputs a lot of data, so you may want to pipe it to a file and then examine the file in a text editor. Here are some examples.
Code:
bash-4.3# dmesg | grep sd <---This would show all the drives, as "hd" is deprecated. Grep will only catch the lines including the string, "sd."
bash-4.3# dmesg > dmesg.txt <---This pipes the entire output of dmesg to a file named "dmesg.txt"
bash-4.3# vim dmesg.txt <---This opens it in vim. Use the text editor of your choice.
Here's a portion of the second command relating to an external USB drive on this here computer; it's not a pen drive, but the principle is the same:
Code:
[ 6.992929] usb 1-5: Product: FANTOM DRIVE
[ 6.993389] usb 1-5: Manufacturer: MICRONET
[ 6.993845] usb 1-5: SerialNumber: 533248474A39465A39303134
in the console, as root...
Paste back what it shows
Melissa
~$ sudo fdisk -l
WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 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 identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sda1 1 976773167 488386583+ ee GPT
Partition 1 does not start on physical sector boundary.
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 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 identifier: 0x00d600d6
Device Boot Start End Blocks Id System
/dev/sdb1 63 419425019 209712478+ 7 HPFS/NTFS/exFAT
Partition 1 does not start on physical sector boundary.
/dev/sdb2 419425020 976773167 278674074 7 HPFS/NTFS/exFAT
Partition 2 does not start on physical sector boundary.
Before you do the above, with the attendant dangers, try running dmesg as root and seeing whether it sees the pen drive.
Dmesg outputs a lot of data, so you may want to pipe it to a file and then examine the file in a text editor. Here are some examples.
Code:
bash-4.3# dmesg | grep sd <---This would show all the drives, as "hd" is deprecated. Grep will only catch the lines including the string, "sd."
bash-4.3# dmesg > dmesg.txt <---This pipes the entire output of dmesg to a file named "dmesg.txt"
bash-4.3# vim dmesg.txt <---This opens it in vim. Use the text editor of your choice.
Here's a portion of the second command relating to an external USB drive on this here computer; it's not a pen drive, but the principle is the same:
Code:
[ 6.992929] usb 1-5: Product: FANTOM DRIVE
[ 6.993389] usb 1-5: Manufacturer: MICRONET
[ 6.993845] usb 1-5: SerialNumber: 533248474A39465A39303134
$ sudo dmesg | grep sd
[ 3727.121665] sd 6:0:0:0: Attached scsi generic sg3 type 0
[ 3727.121953] sd 6:0:0:0: [sdc] 31703040 512-byte logical blocks: (16.2 GB/15.1 GiB)
[ 3727.122588] sd 6:0:0:0: [sdc] Write Protect is off
[ 3727.122596] sd 6:0:0:0: [sdc] Mode Sense: 43 00 00 00
[ 3727.123244] sd 6:0:0:0: [sdc] No Caching mode page found
[ 3727.123250] sd 6:0:0:0: [sdc] Assuming drive cache: write through
[ 3727.125581] sd 6:0:0:0: [sdc] No Caching mode page found
[ 3727.125591] sd 6:0:0:0: [sdc] Assuming drive cache: write through
[ 3727.126562] sdc: sdc1
[ 3727.128604] sd 6:0:0:0: [sdc] No Caching mode page found
[ 3727.128613] sd 6:0:0:0: [sdc] Assuming drive cache: write through
[ 3727.128620] sd 6:0:0:0: [sdc] Attached SCSI removable disk
[ 3733.025632] FAT-fs (sdc1): utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!
[ 3847.075170] sdc: detected capacity change from 16231956480 to 0
[ 6204.812250] sd 7:0:0:0: Attached scsi generic sg3 type 0
[ 6204.812506] sd 7:0:0:0: [sdc] 1953394095 512-byte logical blocks: (1.00 TB/931 GiB)
[ 6204.813092] sd 7:0:0:0: [sdc] Write Protect is off
[ 6204.813099] sd 7:0:0:0: [sdc] Mode Sense: 1f 00 10 08
[ 6204.813695] sd 7:0:0:0: [sdc] Write cache: disabled, read cache: enabled, supports DPO and FUA
[ 6204.842490] sdc: sdc1
[ 6204.844271] sd 7:0:0:0: [sdc] Attached SCSI disk
[11686.493120] sd 8:0:0:0: Attached scsi generic sg3 type 0
[11686.493787] sd 8:0:0:0: [sdc] Attached SCSI removable disk
Take care about which device actually is your USB stick !!! The next
command will render all data on /dev/sdx inaccessible !!!
(1) First, wipe the bootsector of the USB stick:
dd if=/dev/zero of=/dev/sdx bs=512 count=1
(2) Then, create a new FAT32 partition on the stick and write a FAT32
filesystem on it (vfat or type b in fdisk terminology):
fdisk /dev/sdx <<EOF
n
p
1
t
b
w
EOF
mkdosfs -F32 /dev/sdx1
The 10 lines starting with 'fdisk /dev/sdx <<EOF' and ending with the
single word 'EOF' is actually one single command spread over ten lines,
including the two empty lines in the middle. This format is called a
'here-document'. It allows you to use a command which expects interactive
input in a non-interactive way. If you're uncomfortable with the above
command you can just run
fdisk /dev/sdx
and create a partition interactively :-)
==========================================================
Author: Eric Hameleers <alien@slackware.com> 17-feb-2011
Blog post: http://alien.slackbook.org/blog/installing-slackware-using-usb-thumb-drive/
Wiki URL: http://www.slackware.com/~alien/dokuwiki/doku.php?id=slackware:usbboot
~$ sudo dd if=/dev/zero of=/dev/sdc bs=512 count=1
dd: opening `/dev/sdc': No medium found
~$ sudo dd if=/dev/zero of=/dev/sdc1 bs=512 count=1
1+0 records in
1+0 records out
512 bytes (512 B) copied, 2.6831e-05 s, 19.1 MB/s
~$ sudo fdisk /dev/sdc1
fdisk: unable to read /dev/sdc1: Inappropriate ioctl for device
$ sudo mkdosfs -F32 /dev/sdc1
mkdosfs 3.0.13 (30 Jun 2012)
mkdosfs: Too few blocks for viable file system
$ sudo mkfs.ext3 /dev/sdc1
mke2fs 1.42.5 (29-Jul-2012)
/dev/sdc1 is not a block special device.
Proceed anyway? (y,n) y
mkfs.ext3: Device size reported to be zero. Invalid partition specified, or
partition table wasn't reread after running fdisk, due to
a modified partition being busy and in use. You may need to reboot
to re-read your partition table.
$ sudo fsck.vfat -a /dev/sdc1
dosfsck 3.0.13, 30 Jun 2012, FAT32, LFN
Logical sector size is zero.
$ sudo dumpe2fs /dev/sdc | grep superblock
dumpe2fs 1.42.5 (29-Jul-2012)
dumpe2fs: No medium found while trying to open /dev/sdc
Couldn't find valid filesystem superblock.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.