LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Hard Drive Size Discrepancy? (https://www.linuxquestions.org/questions/linux-general-1/hard-drive-size-discrepancy-62644/)

Deathwind 05-30-2003 04:04 AM

Hard Drive Size Discrepancy?
 
I just installed Debian (well, ok, via a knoppix knx-hdinstall) onto this system, after formatting from a previous (rather old) install of Mandrake. I've gotten most everything up and running (and have fallen madly in love with apt-get), but then I issued df just to check things out. It reports:
Quote:

Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda1 3582344 1964040 1618304 55% /
This seems incorrect. Fdisk reports:
Quote:

Disk /dev/hda: 8455 MB, 8455200768 bytes
255 heads, 63 sectors/track, 1027 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 973 7815591 83 Linux
/dev/hda2 974 1027 433755 5 Extended
/dev/hda5 974 1027 433723+ 82 Linux swap
The disk is an 8GB hard drive, it was previously formatted the way df is reporting (~3.5GB given to / in an ext2 partition, everything else except a swap partition given to /home in an ext2 partition), but I used fdisk to delete all the previous partitions (and wrote the table to disk) and then created the partitions that fdisk is now reporting (but df isn't). During install I chose to make hda1 reiserfs, if that makes any difference. So, any ideas why df reports the wrong size for hda1 (or if hda1 actually is the wrong size), and how to fix it? I still also have a /mnt/hda6 out of nowhere as well that I can touch (create) files on (my old /home partition was on hda6), that df doesn't report. Any help would be greatly appreciated...I'm stumped.

jharris 05-30-2003 04:25 AM

Are you sure it is reporting the wrong size? df is reporting 1K blocks (3582344) while fdisk is showing you 512 byte blocks (7815591) so 7815591/2 = 3907795.5, so you've lost (3907795.5 - 3582344) 325451.5KB (~317MB) in formatting and filesystem information.

Still seems a bit steep. Also having just checked on of my boxes I don't get the same kind of discrepency.
Code:

root@rincewind:~# df
Filesystem          1k-blocks      Used Available Use% Mounted on
/dev/hda6              7245052  3190964  4054088  45% /

From fdisk
Code:

  Device Boot    Start      End    Blocks  Id  System
/dev/hda6          346      1247  7245283+  83  Linux

Well that should win me an award for the most useless post :rolleyes:

I'll get my coat...

Jamie...

Deathwind 05-30-2003 04:41 AM

Hmmm...

Well, it helps some, and for a second I thought you were dead on and I was just missing seeing the block size. Just to check, I did df -h (human-readable sizes) and got /dev/hda1 as being 3.5GB with 1.9GB used, when it really should be around 7.xGB with 1.9GB used. As it's an 8GB drive and everything but a small swap partition should be /dev/hda1. So maybe fdisk and df aren't reporting a discrepancy, but rather the same odd phenomenon in two different ways (while ignoring a huge section of disk). So I guess the question would become, where'd the rest of the drive go? :confused: Did it somehow stay on the mystical /dev/hda6 ( mounted apparently as /mnt/hda6, has nil in it but is writeable and I can't determine the max size, and it doesn't show up in df)? If so, can I somehow merge /dev/hda6 with /dev/hda1 so I only have /dev/hda1 at the proper size (7.xGB)?

So, I think you might be right on the block size thing, which helps us narrow it down to a possibly more frustrating problem...;)

Edit: Well, hrmmm, I just looked at your post again and realized that your fdisk and df are reporting much closer than mine....so my fdisk and df actually do seem to be reporting wholly different sizes...
I think this one might beat yours out for most useless post ;) :D

Thanks.

jharris 05-30-2003 04:47 AM

What does cfdisk report - anything different? All seems rather weird

cheers

Jamie..

Deathwind 05-30-2003 04:59 AM

cfdisk shows:
hda1 flagged to boot, type is primary, fs type is Linux ReiserFS, size (MB) as 8003.20.
It also shows hda5 as my logical linux swap with size (MB) as 444.17.

Deathwind 05-30-2003 08:00 PM

Woohoo!
Resolved the problem with a little help from IRC.
Turns out I had somehow gotten a 3.5GB ReiserFS filesystem living in an 8GB partition during the install. All I had to do to fix the problem was to grow the fs on /dev/hda1, by issuing the command:
resize_reiserfs /dev/hda1
Didn't even have to umount. And now df reports 7815344 blocks (which is correct).

:cool:

perry 05-12-2004 07:50 AM

Quote:

Originally posted by Deathwind
Woohoo!
Resolved the problem with a little help from IRC.
Turns out I had somehow gotten a 3.5GB ReiserFS filesystem living in an 8GB partition during the install. All I had to do to fix the problem was to grow the fs on /dev/hda1, by issuing the command:
resize_reiserfs /dev/hda1
Didn't even have to umount. And now df reports 7815344 blocks (which is correct).

:cool:

is there a similiar command for ext3 ? i have the same problem but am using ext3. i resized the /usr partition from 2.3 gig to 2.8 gig. now before you say system commander is useless, it also resized / from 155 mb to 256 mb and the swap partition from 243 mb to 512 mb no problem....

i ran cfdisk and it seemed to show the correct values so i got it to [W]rite the values back, it reported that it was able to do so but for some reason could not read those values back

help!

- perry


All times are GMT -5. The time now is 03:35 PM.