LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-26-2009, 08:25 PM   #1
mbrando
LQ Newbie
 
Registered: Mar 2009
Posts: 20

Rep: Reputation: 0
Formatting 300GB external drive vfat


Hi,

I'm working on a box with an external USB drive 300GB. I ran the following commends to create a vfat filesystem.

dd of=/dev/sdb1 if=/dev/zero bs=1M count=1024
mkfs -t vfat -c /dev/sdb1

It was previously NTFS. my SSH connection was closed by a firewall time out. when I came back in ran the same commands again. I'm running top and see:

21770 root 18 0 73192 70m 428 D 5 1.7 3:22.08 mkfs.vfat

Will this process go away then it is done working on the drive?

Then I should be able to mount the drive like this??

mount -t vfat /dev/sdb1 /mnt/vfat

I made this a folder to mount to '/mnt/vfat'

Thanks,
Mike
 
Old 03-26-2009, 08:43 PM   #2
watcher69b
Member
 
Registered: Nov 2007
Location: /home/watcher69b
Distribution: RH, Fedora & CentOS
Posts: 544

Rep: Reputation: 40
wouldn't you want to use fdisk to delete the current partition and create one?

then use the mkfs.vfat

or download gparted and use the nice GUI...

Quote:
Then I should be able to mount the drive like this??

mount -t vfat /dev/sdb1 /mnt/vfat

I made this a folder to mount to '/mnt/vfat'
Yes, after you have the partition created and have run the mkfs you will be able to mount it with the above command.
 
Old 03-26-2009, 08:49 PM   #3
mbrando
LQ Newbie
 
Registered: Mar 2009
Posts: 20

Original Poster
Rep: Reputation: 0
Hi,

Thanks. I only SSH access to this box. I'm guessing I did not do this correctly. I'll stop the current the process and and start this from beginning.

Thanks,

Mike
 
Old 03-26-2009, 09:03 PM   #4
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
There's nothing wrong in what you are doing, assuming that sdb1 exists and the partition table is sane. There's no need to zero it out though, unless you have a good reason to. There's no need to delete and re-create the partition either. Just reformat it with whatever fs you want.
 
Old 03-26-2009, 09:05 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,833

Rep: Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820
The bad block check will be taking the time - do you really need to do that ?.
 
Old 03-26-2009, 09:08 PM   #6
mbrando
LQ Newbie
 
Registered: Mar 2009
Posts: 20

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by syg00 View Post
The bad block check will be taking the time - do you really need to do that ?.
Thanks for pointing that out. Next time I'll omit the block check.

Mike
 
Old 03-26-2009, 09:12 PM   #7
AceofSpades19
Senior Member
 
Registered: Feb 2007
Location: Chilliwack,BC.Canada
Distribution: Slackware64 -current
Posts: 2,079

Rep: Reputation: 58
AFAIK, vfat doesn't support volumes over 140 gb I think
 
Old 03-26-2009, 09:22 PM   #8
mbrando
LQ Newbie
 
Registered: Mar 2009
Posts: 20

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by AceofSpades19 View Post
AFAIK, vfat doesn't support volumes over 140 gb I think
When I :

root@host [~]# fdisk -l

Disk /dev/sdb: 300.0 GB, 300069052416 bytes
255 heads, 63 sectors/track, 36481 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 36482 293033984 7 HPFS/NTFS

It looks like it is using all the cylinders 1-36482. Does that mean it is using 300GB?

It's kind of odd that the system it is showing is HPFS/NTFS. When I mount:

mount -t vfat /dev/sdb1 /mnt/vfat

is mounts read/write.

Mike
 
Old 03-26-2009, 09:30 PM   #9
mbrando
LQ Newbie
 
Registered: Mar 2009
Posts: 20

Original Poster
Rep: Reputation: 0
Hi,

Even stranger.

root@host [~]# fdisk /dev/sdb1

command 'p'

does not display any partitions. Yet it does mount.

Can someone help me. What is the correct way to format this 300GB drive fat32.

I did this:

dd of=/dev/sdb1 if=/dev/zero bs=1M count=1024
mkfs -t vfat /dev/sdb1

Got rig of the block check. It seems to work. I'm just thinking I want to confirm it is accurate.

Thanks,
Mike
 
Old 03-26-2009, 09:38 PM   #10
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
Quote:
Originally Posted by mbrando View Post
It's kind of odd that the system it is showing is HPFS/NTFS. When I mount:

mount -t vfat /dev/sdb1 /mnt/vfat
That's a flag that DOS and some other things can use to determine the "type" of the partition, which doesn't necessarily mean that the partition is formated that way at all.

In fdisk, if my memory serves correctly, the command "l" will list the known types, and surely there's another command to change that silly byte. It really doesn't matter, smart programs can guess that without having to resort to that info, which sometimes is not even in sync with the contents of the partition, as in your case.

As per the max volume size, for fat32 I am pretty much sure that it's 2TB, and it would seem improbably to me that vfat is going to lower that limit, plus there's no reason to do so. I think I've used bigger volumes (bigger than 140gb) myself, but I can't be sure right now.

The winxp installer couldn't create volumes bigger than 128gb or so, I don't really remember. Though xp itself could use bigger volumes if you created them using another OS or tool.
 
Old 03-26-2009, 09:44 PM   #11
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,833

Rep: Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820
- "fdisk -l" shows one partition covering the entire disk (300 Gig) - says nothing about the filesystem on that partition.
- the id of 7 (NTFS) is indicative only; for (human) sanity should agree with the filesystem type, but doesn't have to, as you've found.
- fdisk works with devices, not partitions - "fdisk /dev/sdb1" is invalid.
- after you mount it, do a "df -hT" to see how big it really is
 
Old 03-26-2009, 09:52 PM   #12
mbrando
LQ Newbie
 
Registered: Mar 2009
Posts: 20

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by syg00 View Post
- "fdisk -l" shows one partition covering the entire disk (300 Gig) - says nothing about the filesystem on that partition.
- the id of 7 (NTFS) is indicative only; for (human) sanity should agree with the filesystem type, but doesn't have to, as you've found.
- fdisk works with devices, not partitions - "fdisk /dev/sdb1" is invalid.
- after you mount it, do a "df -hT" to see how big it really is
Hi,

root@host [/mnt/vfat]# df -hT
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
ext3 1.6T 11G 1.5T 1% /
/dev/sda1 ext3 99M 18M 77M 19% /boot
tmpfs tmpfs 2.0G 0 2.0G 0% /dev/shm
/usr/tmpDSK ext3 485M 11M 449M 3% /tmp
/dev/sdb1 vfat 280G 55M 280G 1% /mnt/vfat
root@host [/mnt/vfat]#

/dev/SB1 is 280GB

I copied a 55M file to it to see if it would write.

Thanks,
Mike
 
  


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
formatting my external hard drive twelvenine Linux - Newbie 7 12-27-2006 03:53 AM
Help formatting an external hard drive. ruddyss4 Linux - Hardware 3 03-04-2006 02:01 PM
Formatting External USB Drive Question highspeednodrag Linux - Hardware 1 02-17-2005 11:35 PM
Formatting a hard drive (vfat) id10t Slackware 9 01-22-2004 07:31 PM
formatting an external hard drive pobfosheezy Linux - Laptop and Netbook 1 09-18-2003 12:12 PM


All times are GMT -5. The time now is 07:34 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration