LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 12-17-2011, 09:24 AM   #1
kreeder
LQ Newbie
 
Registered: Feb 2009
Location: Nashua, NH
Distribution: RedHat 3, 5.3, 5.7
Posts: 16

Rep: Reputation: 0
Formatting USB drive in RedHat 5


I have a 1TB USB drive connected to a server running RedHat 5 (kernel 2.6.18-274.12.1.el5). From the factory, the drive is formatted as NTFS. Running "fdisk -l" returns:

Device Boot Start End Blocks Id System
/dev/sdc1 1 121602 976760032+ 7 HPFS/NTFS


I used "mkfs.ext3 /dev/sdc1" to format the drive as ext3 instead. I can now mount the drive and access it without any issues. However, "df -h" says the drive has a size of 917G, that 200M is used, and that 871G is available.

So, two questions:

1) Why does the drive seem to have only 871G available? The only thing on the drive is the lost+found directory which is empty.

2) After running mkfs.ext3, "fdisk -l" still reports the system type as HPFS/NTFS. Is there a way to make the system type Linux rather than HPFS/NTFS?

Thanks for the help.

-Keith
 
Old 12-17-2011, 10:12 AM   #2
sinuhe
Member
 
Registered: Apr 2010
Location: Utah
Distribution: Slackware
Posts: 42

Rep: Reputation: 4
partition and inode table

You need to repartition the drive for Ext (Linux partition type). Ext allocates inode table data (such as file ownership) separately, which could explain the smaller block assignment. Also, 5% is often reserved, which may explain the difference (I didn't check a calculator).

You might try XFS which dynamically allocates inodes.

Last edited by sinuhe; 12-17-2011 at 10:15 AM.
 
Old 12-17-2011, 10:28 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 12,061

Rep: Reputation: 760Reputation: 760Reputation: 760Reputation: 760Reputation: 760Reputation: 760Reputation: 760
To elaborate you just need to change the partition ID to 83 (Linux) which isn't modified when it is formatted. Any partition tool will work i.e. fdisk, parted.

Reserved space is supposed to reduce fragmentation as well as allow root to login if the filesystem becomes full. You can use tune2fs to reduce the amount of reserved space and since this is used for data you can reduce it to zero if desired.

Last edited by michaelk; 12-17-2011 at 10:31 AM.
 
Old 12-19-2011, 07:58 AM   #4
kreeder
LQ Newbie
 
Registered: Feb 2009
Location: Nashua, NH
Distribution: RedHat 3, 5.3, 5.7
Posts: 16

Original Poster
Rep: Reputation: 0
I'm using a spare 500G USB drive to experiment. With this drive, I tried using fdisk to make a single Linux partition. I wrote the table to disk and exited. fdisk -l still reports the drive as HPFS/NTFS. However, printing the partitions in fdisk shows a single partition of type Linux. For example:

linux> fdisk -l

Device Boot Start End Blocks Id System
/dev/sdb1 1 60801 488384001 7 HPFS/NTFS


linux> fdisk /dev/sdb1
Command (m for help): p

Device Boot Start End Blocks Id System
/dev/sdb1 1 60800 488375968+ 83 Linux


So "fdisk -l" reports an end cylinder of 60801 instead of 60800 for the printed partition table; the total number of blocks reported for "fdisk -l" is also larger than those reported when printing the partition table. fdisk won't let me set the end partition to 60801 (says "Value out of range") when I try to set the partition size from cylinder 1 to cylinder 60801.

Any ideas about the discrepancy and a way to fix it?

-Keith
 
Old 12-19-2011, 04:39 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 12,061

Rep: Reputation: 760Reputation: 760Reputation: 760Reputation: 760Reputation: 760Reputation: 760Reputation: 760
The Master boot Record / partition table is not part of any partition. Do not specify a partition number when using fdisk. i.e.

fdisk /dev/sdb

You can delete everything you created and reformatting should fix everything and since you are just experimenting no harm in deleting sdb1 and start over so you can become familiar with the process.

Last edited by michaelk; 12-21-2011 at 11:03 AM.
 
Old 12-21-2011, 10:47 AM   #6
kreeder
LQ Newbie
 
Registered: Feb 2009
Location: Nashua, NH
Distribution: RedHat 3, 5.3, 5.7
Posts: 16

Original Poster
Rep: Reputation: 0
Using "fdisk /dev/sdb" rather than "fdisk /dev/sdb1" did the trick. Now "fdisk -l" lists the drive as Linux rather than NTFS. Thanks Michaelk!

-Keith
 
  


Reply

Tags
fdisk, format, mkfs, usb


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 usb drive to ntfs DebianUser Linux - Hardware 5 02-13-2011 02:15 PM
Problem formatting USB drive, need some help... tiger.woods Ubuntu 9 08-10-2007 10:39 PM
Formatting a usb drive guldo Linux - Hardware 11 10-09-2005 12:16 PM
Formatting USB ZIP Drive solarisrob Solaris / OpenSolaris 1 08-01-2005 03:44 PM
formatting a usb flash drive zatka Linux - Hardware 2 12-12-2004 09:04 AM


All times are GMT -5. The time now is 10:00 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration