LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 04-23-2008, 12:49 PM   #1
mac1234mac
Member
 
Registered: Sep 2005
Posts: 183

Rep: Reputation: 30
how to format /dev/sda in linux


Hello,

I wonder how I can format drive in Linux. What tools would I need?.
Can be command line ones.
Installed qtparted, it runs but critical error shows up.
"Cannot read disk". I have no fdisk but it would allow me only to set up
partitions for the formatting. I want to format one partition without
changing the set up of them.

Cheers
 
Old 04-23-2008, 12:55 PM   #2
jei
LQ Newbie
 
Registered: Jul 2006
Posts: 29

Rep: Reputation: 16
What filesystem type are you wanting to format it to? for ntfs fs it is recommended to use windows based tools.

Otherwise

mkfs -t fat /dev/sda
or
mkfs.fat /dev/sda works in most cases
or

sudo mkfs.vfat -n ‘Label’ -I /dev/sda
 
Old 04-23-2008, 01:19 PM   #3
mac1234mac
Member
 
Registered: Sep 2005
Posts: 183

Original Poster
Rep: Reputation: 30
But I have no mkfs. This is 64-bit Fedora and there are no such tools like
fdisk or mkfs. Neither in normal user nor su. Maybe therea are some other tools which this system have?.
 
Old 04-23-2008, 01:41 PM   #4
jei
LQ Newbie
 
Registered: Jul 2006
Posts: 29

Rep: Reputation: 16
Where are you reading that their is no mkfs for x86_64?

try /sbin/mkfs

mkfs is the standard linux tool for creating filesystems, I do not use the 64-bit version, but I don't see why they would have removed it.
 
Old 04-23-2008, 02:05 PM   #5
mac1234mac
Member
 
Registered: Sep 2005
Posts: 183

Original Poster
Rep: Reputation: 30
Quote:
mkfs -t fat /dev/sda
With this command I can format drive to fat32?. Because this is what I want. I cannot format this partition from windows. In windows formatting goes on well till 100% than it says that the disk cannot be formatted.
Tried Partition Magic 7.0 and 8.0 but to no avail. It just won't start.
 
Old 04-23-2008, 02:16 PM   #6
jei
LQ Newbie
 
Registered: Jul 2006
Posts: 29

Rep: Reputation: 16
ok so you found mkfs? please answer the questions asked so you can be helped correctly.

If you can format it in windows try doing a quick format. Otherwise mkfs -t fat is the command you need to use.

You do not need partitioning software just to format a drive.
if your getting can't read errors you may have other issues, bad sectors, or corrupted partition.

Also make sure the drive is not mounted while you are trying to use mkfs on it.
 
Old 04-23-2008, 02:25 PM   #7
mac1234mac
Member
 
Registered: Sep 2005
Posts: 183

Original Poster
Rep: Reputation: 30
I have no access to the computer in question, but I asked question from
previous post in advance. Quick format doesn't work as well. This is new
disk so I don't suspect there are bad sectors etc. But who knows?.
 
Old 04-23-2008, 02:27 PM   #8
jei
LQ Newbie
 
Registered: Jul 2006
Posts: 29

Rep: Reputation: 16
if its a new disk it may not have a partition to format on it. These are all things that would have been good to know from the beginning, I guess its my fault for not asking.

As you do not have access to the machine I don't know what else to suggest.

Jei
 
Old 04-23-2008, 02:37 PM   #9
mac1234mac
Member
 
Registered: Sep 2005
Posts: 183

Original Poster
Rep: Reputation: 30
Yes, it's a new disk but already partitioned. It has 6 partitions and one of them cannot be formatted. I loose 80GB. On one of them there is windows, on some other Fedora. I tried to format from windows: no success. So now I try to format on fat32 from Fedora. I think the situation is now clear.
 
Old 04-23-2008, 03:01 PM   #10
mac1234mac
Member
 
Registered: Sep 2005
Posts: 183

Original Poster
Rep: Reputation: 30
OK, I've checked, there is fdisk and mkfs, as you suggested, in /sbin directory. But command /sbin/mkfs -t fat /dev/sda6 (in my case) doesn't work, it says something like that: "mkfs.fat: No such file or directory".
With ext2 as a parameter program runs, but not when there is fat or fat32(checked that also) as a parameter.
 
Old 04-23-2008, 03:15 PM   #11
jei
LQ Newbie
 
Registered: Jul 2006
Posts: 29

Rep: Reputation: 16
ok, try /sbin/mkfs.vfat /dev/sda6
 
Old 04-24-2008, 10:54 AM   #12
mac1234mac
Member
 
Registered: Sep 2005
Posts: 183

Original Poster
Rep: Reputation: 30
Thanks for help. I couldn't reply earlier. Partition is now seen, readable and writable in windows.
 
Old 04-24-2008, 12:24 PM   #13
Ricio
Member
 
Registered: Sep 2003
Location: Colombia
Distribution: Debian
Posts: 220

Rep: Reputation: 30
try downloading ntfstools, the package includes tools to format ntfs, resize ntfs filesystems, clone ntfs filesystem and others.
 
  


Reply


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
USB drive... /dev/sda1 doesn't show unless I try mounting /dev/sda as vfat finite Linux - Hardware 8 03-10-2009 12:52 AM
Linux 2.6.21.5 to 2.6.22.3: /dev/sda becomes /dev/hda CalcAndCoffee Linux - Laptop and Netbook 10 08-26-2007 10:08 AM
Install lilo on external drive (/dev/sda), then boot as INTERNAL (/dev/hda)? slackware-elf Slackware 3 08-18-2007 04:51 PM
[SOLVED] system disk moves from /dev/sda to /dev/sdm gdevaucorbeil Linux - Hardware 4 03-10-2007 09:30 AM
Sandisk USB card Reader not linking /dev/sg0 to /dev/sda acidraven Linux - Hardware 1 06-19-2004 03:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:00 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