LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-13-2008, 08:57 PM   #1
kaldrenon
LQ Newbie
 
Registered: Dec 2008
Location: (near) Philadelphia, PA
Distribution: Ubuntu currently
Posts: 9

Rep: Reputation: 0
Trouble Formatting a hard drive, not sure the issue


Hey all.

I'm an intermediate Linux user, gradually falling more and more in love with the system while working on my Ubuntu 8.10 desktop box. But I recently ran into some trouble with reformatting an IDE hard drive that I'm using to increase the storage I have available.

When I installed the drive and booted the system, I was able to see it, mount it, and access the files that were on it at the time - a Windows XP install that I won't be using any more.

I used gParted to delete the data on the drive, setting up a new partition table for it, starting it from scratch. That process ran properly, and I saw the device in gParted as /dev/sdb, a 500gb drive with its entire contents unallocated.

However, when I attempted to format it to fat32, a single partition using all unallocated space, the process failed, and the drive got flagged as having errors in gParted. I was able to re-clear the partition table, making it all unallocated again, but additional attempts to format it, including attempts with other FS formats, all had the same end result.

Also, fdisk cannot open the device:

Quote:
andrew@toumar:/media/500$ sudo fdisk /dev/hda
[sudo] password for andrew:
Unable to open /dev/hda
I might be missing something that would be obvious to a more experienced *nix user, but I'm not sure what my next step ought to be. I'll greatly appreciate any help I can get.

The details of the error output from gParted are below:
Quote:
GParted 0.3.8

Libparted 1.8.9

Create Primary Partition #1 (fat32, 465.76 GiB) on /dev/sdb 00:00:00 ( ERROR )

create empty partition 00:00:00 ( SUCCESS )

path: /dev/sdb1
start: 63
end: 976768064
size: 976768002 (465.76 GiB)
set partitiontype on /dev/sdb1 00:00:00 ( SUCCESS )

new partitiontype: fat32
create new fat32 filesystem 00:00:00 ( ERROR )

mkdosfs -F32 -v -n "" /dev/sdb1

mkdosfs 2.11 (12 Mar 2005)
mkdosfs: /dev/sdb1 contains a mounted file system.
 
Old 12-13-2008, 09:46 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
Quote:
Originally Posted by kaldrenon View Post

mkdosfs 2.11 (12 Mar 2005)
mkdosfs: /dev/sdb1 contains a mounted file system.
You need to unmount the file system first:

umount /dev/sdb1

If you cannot umount /dev/sdb1 then boot a liveCD and try to format the partition from the liveCD.

----------------------
Steve Stites
 
Old 12-13-2008, 10:15 PM   #3
kaldrenon
LQ Newbie
 
Registered: Dec 2008
Location: (near) Philadelphia, PA
Distribution: Ubuntu currently
Posts: 9

Original Poster
Rep: Reputation: 0
Thanks for the quick, helpful reply! I believe I've got it set, now.

I tried "sudo umount /dev/sdb" and got a message about sdb not being mounted according to mtab. So I set about preparing to use a Live CD. Only, as the computer was rebooting, I realized that, if mtab didn't see the device as mounted, and fstab didn't either, that a simple reboot should leave the device untouched. So I simply let Ubuntu boot again, ran gParted, and set the partition as I wanted.

Still, it was your advice to use a live CD that got me there, so thanks again!
 
Old 12-13-2008, 11:10 PM   #4
wit_273
Member
 
Registered: Mar 2007
Location: Nebraska
Distribution: CentOS
Posts: 82

Rep: Reputation: 15
Just so you know for the future, you needed to specify the partition (1). So the command should have been as jailbait said.

umount /dev/sdb1

The 1 specifies the partition number-- even though there was only one partition you still had to specify it. sdb only specifies the device, which could have many partitions.

Hopefully this gives you a better understanding of how Linux handles drives and partitions. Have fun falling in love with Linux--I am sure you will continue to find it much more useful then other OS's. And someone is generally always here to point you in the right direction when you have questions. I find LQ, and other online forums (along with IRC) quicker and more accurate then calling a helpdesk.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Hard Drive formatting! help!! the-yikes Slackware - Installation 16 01-29-2007 02:43 PM
Trouble partioning and formatting new hard drive netrambler Linux - General 8 12-31-2006 11:50 AM
Help Me!! Need help formatting my Hard Drive Mr. G Linux - Software 4 07-25-2006 10:57 AM
Formatting this hard drive bellaterror Linux - Hardware 9 06-24-2006 10:00 AM
Formatting hard drive Sparkfist Linux - General 9 05-24-2006 09:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:55 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
Open Source Consulting | Domain Registration