LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 08-02-2006, 07:29 PM   #1
anubis26
Member
 
Registered: Jan 2005
Location: Somewhere in the Central Timezone
Distribution: Suse 10.0
Posts: 128

Rep: Reputation: 15
Angry 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.
 
Old 08-02-2006, 07:39 PM   #2
Denes
Member
 
Registered: Mar 2004
Distribution: CentOS 4.3/4.5
Posts: 72

Rep: Reputation: 15
fdisk creates partitions, it doesn't require a partition or file system to be mounted. For example

/sbin/fdisk /dev/sda

not /dev/sda1

will open the whole device and then you can create a partition on it.

Use n to create a new partition as the first primary partition.

Use t to set it to type 6 for dos

then you can use

/sbin/mkdosfs /dev/sda1

or

/sbin/mkdosfs -F32 /dev/sda1

for Fat32.

If the drive is really messed up, you can always clear out all boot stuff with

/sbin/dd if=/dev/zero of=/dev/sda bs=512 count=1

Good Luck!
 
Old 08-02-2006, 07:56 PM   #3
anubis26
Member
 
Registered: Jan 2005
Location: Somewhere in the Central Timezone
Distribution: Suse 10.0
Posts: 128

Original Poster
Rep: Reputation: 15
Thank you so much! :P
Now I won't have to throw it away.
 
Old 06-15-2010, 02:31 PM   #4
sdavmor
LQ Newbie
 
Registered: Jun 2010
Location: Simi Valley, California
Distribution: Ubuntu 10.04
Posts: 4

Rep: Reputation: 1
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]# lspci
00:00.0 RAM memory: nVidia Corporation: Unknown device 03ea (rev a1)
00:01.0 ISA bridge: nVidia Corporation: Unknown device 03e0 (rev a2)
00:01.1 SMBus: nVidia Corporation: Unknown device 03eb (rev a2)
00:01.2 RAM memory: nVidia Corporation: Unknown device 03f5 (rev a2)
00:02.0 USB Controller: nVidia Corporation: Unknown device 03f1 (rev a3)
00:02.1 USB Controller: nVidia Corporation: Unknown device 03f2 (rev a3)
00:04.0 PCI bridge: nVidia Corporation: Unknown device 03f3 (rev a1)
00:05.0 Class 0403: nVidia Corporation: Unknown device 03f0 (rev a2)
00:06.0 IDE interface: nVidia Corporation: Unknown device 03ec (rev a2)
00:08.0 IDE interface: nVidia Corporation: Unknown device 03f6 (rev a2)
00:09.0 PCI bridge: nVidia Corporation: Unknown device 03e8 (rev a2)
00:0b.0 PCI bridge: nVidia Corporation: Unknown device 03e9 (rev a2)
00:0c.0 PCI bridge: nVidia Corporation: Unknown device 03e9 (rev a2)
00:0d.0 VGA compatible controller: nVidia Corporation: Unknown device 03d0 (rev a2)
00:18.0 Host bridge: Advanced Micro Devices [AMD]: Unknown device 1100
00:18.1 Host bridge: Advanced Micro Devices [AMD]: Unknown device 1101
00:18.2 Host bridge: Advanced Micro Devices [AMD]: Unknown device 1102
00:18.3 Host bridge: Advanced Micro Devices [AMD]: Unknown device 1103
01:05.0 Parallel controller: Lava Computer mfg Inc Lava Parallel (rev 03)
01:06.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139 (rev 10)

[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

Where do I go from here?

Cheers,
SDM in SoCal
 
Old 06-16-2010, 03:33 AM   #5
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,278

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


Reply



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
Formatting a usb drive guldo Linux - Hardware 11 10-09-2005 11:16 AM
Formatting USB ZIP Drive solarisrob Solaris / OpenSolaris 1 08-01-2005 02:44 PM
formatting a usb flash drive to fat32 Haiyadragon Linux - General 4 07-10-2005 07:45 PM
Flash Drive no longer mountable after formatting daleman Linux - Hardware 2 04-14-2005 12:35 AM
formatting a usb flash drive zatka Linux - Hardware 2 12-12-2004 08:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 07:19 AM.

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
Open Source Consulting | Domain Registration