Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Hardware
User Name
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?


  Search this Thread
Old 05-26-2005, 09:43 AM   #1
LQ Newbie
Registered: May 2005
Posts: 7

Rep: Reputation: 0
formatting an already installed USB hard drive

Can someone tell me how to format an installed usb drive. I want to make maximum use of it. I can use it, but the OS (Suse 9.3) can not tell me how much space is available. So, I'd like to format it.
Old 05-26-2005, 12:58 PM   #2
Registered: Jan 2005
Location: Washington, D.C.
Distribution: Arch (Custom), CentOS
Posts: 239

Rep: Reputation: 30
From wiki:

Repartitioning the USB memory
Sometimes the stick is seperated in up to four partitions, and Linux can't read anything. To fix this you have to repartition the stick with fdisk. Make sure that there are no files left on the stick (if you used it before in Windows, Mac OS or anywhere else). Type:

# modprobe usb_storage
# fdisk /dev/sda

Delete all available partitions (d and partition number), create a new partition with n (I would suggest you use a single partition), press q to write everything and quit.

Create a filesystem on the stick:

# mkfs.vfat /dev/sda1
Old 05-27-2005, 06:25 PM   #3
LQ Newbie
Registered: May 2005
Posts: 7

Original Poster
Rep: Reputation: 0
I'm getting there

but I think I need a little more help, if you'd be so generous.
First, I'm installing a USB drive, not a stick (if that makes any difference). It's an 80 gig external drive.

Second, it's base URL is: file:////media/usbdisk

Third, its device node is: /dev/sda5

When I do what you told me to do, it tells me that the max size of my partition is 9962. Can I make it bigger than that?

Also, after deleting the partitions, if I choose "q" it'll quit WITHOUT saving the changes. How do I save the changes?

Thank you very much for your help.
Old 05-27-2005, 07:31 PM   #4
Registered: Jan 2005
Location: Washington, D.C.
Distribution: Arch (Custom), CentOS
Posts: 239

Rep: Reputation: 30
Did you get rid of all the partitions and replace them with only one? If you have one partition on there now, you can format for a filesystem:

log in as root

umount /dev/sda5

mke2fs -jc /dev/sda5

That should create a filesystem while checking the device for bad blocks.
Old 05-27-2005, 09:38 PM   #5
Registered: Aug 2002
Location: St Louis, MO
Distribution: Xubuntu, RHEL, Solaris 10
Posts: 929

Rep: Reputation: 30
To save the changes after you've deleted/changed anything with fdisk, choose 'w' to Write the changes to disk. It will probably tell you to reboot, but if you've not changed a disk that's actively being used at the moment you can most likely ignore that.
Once you've saved the changes, press 'q' to Quit.

Edit: Incidentally, typing 'm' will bring up a small menu with all the fdisk commands and their descriptions. That might help for future dealings with fdisk

Last edited by rose_bud4201; 05-27-2005 at 09:40 PM.


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
Formatting a Hard Drive dudeman41465 Linux - Software 3 10-13-2005 04:09 PM
Hard-drive formatting kc0bus Linux - Newbie 5 07-02-2005 12:14 PM
formatting my 2nd hard drive emokid Linux - Newbie 6 06-26-2005 07:45 AM
Formatting Hard Drive baber_abbasi Linux - Software 2 01-04-2005 08:41 AM
Formatting hard drive... Linux~Powered Linux - Hardware 1 02-09-2004 04:13 PM > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 02:52 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration