Formatting a usb flash drive (currently unformatted)
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
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.
Formatting a usb flash drive (currently unformatted)
While installing Windows XP, I accidently deleted the partition on my 1gb USB flash drive, mistaking it for a partition on my hard drive. Now, it it unpartitioned, and there is no way to format it (windows just refuses / Linux fdisk and qtparted won't because it can't be mounted: no file system). The only program which will see it (XP setup even won't anymore!) is the Gentoo graphical installer, although it throws up since there is less than 4gigs of space.
This is an old thread but it seems pertinent to a problem I'm having today.
I have a dozen stores all running a dbms server on Red Hat 6.2 (if it ain't broke don't fix it until it is). The hardware is all pretty recent (< 2 years old in the oldest case) and everything "just works" without creating headaches. These are scheduled for replacement (upgrade) to a current release of linux (probably Ubuntu 10.04 server LTS) later this year.
In the meantime I'd like to start using USB 2 8gb flash-drives for removable backup seeing as they are dirt cheap. I expected to be able to install the devices then mount the relevant partition. But the RH 6.2 systems do not appear to see them.
So first I need to understand how to get the USB flash-drives seen. And then I need to know about formatting them. Inserting one into my Ubuntu 10.04 desktop machine I see it auto recognized and installed onto media with an msdos file-system. Gparted tells me that it is FAT32 installed as /dev/sdd1 mounted as /media/001D-8464.
sfdisk -l shows that no drive other than the main system 40gb drive is out there:
Disk /dev/hda: 4866 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End #cyls #blocks Id System
/dev/hda1 * 0+ 5 6- 48163+ 83 Linux
/dev/hda2 6 527 522 4192965 82 Linux swap
/dev/hda3 * 528 4857 4330 34780725 83 Linux
/dev/hda4 0 - 0 0 0 Empty
On my Ubuntu desktop this is what I see from gparted. I was expecting to see something very simlar on the RH box:
Disk /dev/sdd: 977 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End #cyls #blocks Id System
/dev/sdd1 0+ 975 976- 7839698 b W95 FAT32
/dev/sdd2 0 - 0 0 0 Empty
/dev/sdd3 0 - 0 0 0 Empty
/dev/sdd4 0 - 0 0 0 Empty
A look at var/messages after installing the flash-drive and running lspci shows this (I've xx'd out the system name):
[root@xxx_yyy /root]# cat /var/log/messages | tail
Jun 15 12:12:26 xxx_yyy modprobe: modprobe: Can't locate module block-major-34
Jun 15 12:12:26 xxx_yyy modprobe: modprobe: Can't locate module block-major-34
Jun 15 12:12:26 xxx_yyy modprobe: modprobe: Can't locate module block-major-8
Jun 15 12:12:26 xxx_yyy last message repeated 4 times
Jun 15 12:12:26 xxx_yyy kernel: XD: Loaded as a module.
Jun 15 12:12:26 xxx_yyy insmod: /lib/modules/2.2.14-std/block/xd.o: ini
t_module: Device or resource busy
Jun 15 12:12:26 xxx_yyy insmod: /lib/modules/2.2.14-std/block/xd.o: ins
mod block-major-13 failed
Jun 15 12:12:26 xxx_yyy kernel: XD: Loaded as a module.
Jun 15 12:12:26 xxx_yyy insmod: /lib/modules/2.2.14-std/block/xd.o: ini
t_module: Device or resource busy
Jun 15 12:12:26 xxx_yyy insmod: /lib/modules/2.2.14-std/block/xd.o: ins
mod block-major-13 failed
start fresh threads please, but learn from old ones.
Quote:
Device Boot Start End #cyls #blocks Id System
/dev/sdd1 0+ 975 976- 7839698 b W95 FAT32
/dev/sdd2 0 - 0 0 0 Empty
/dev/sdd3 0 - 0 0 0 Empty
/dev/sdd4 0 - 0 0 0 Empty
seems like it's formatted FAT32. Try
modprobe vfat #have you got that kernel module? If not you'll see an error
mount -t vfat /dev/sdd1 /somewhere and you can access it writing to /somewhere
It won't always be sdd. If you put in another, it may have a different letter
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.