Author Topic: Problem with HDD-size info.  (Read 444 times)

Offline satuser083

  • Hero Member
  • *****
  • Posts: 510
Problem with HDD-size info.
« on: December 10, 2012, 06:32:49 AM »
I have a small FAT32 partition on one of my HDDs, which PCC tells me is 14MB large (and which is what I remember setting it to when I partitioned the disk). From PCC:
Code: [Select]
Device: sdb1
UUID: 2853-8697
DOS drive letter: C (just a guess)
Type: FAT32 (0xb)
Start: sector 63
Size: 14MB (0%), 30177 sectors
I checked with blkid that I'm referring to the correct disk:
Code: [Select]
[root@localhost ~]# /sbin/blkid
dev/sdb1: UUID="2853-8697" TYPE="vfat"
and then with df to get the size
Code: [Select]
df -hBK
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sdb1             5160912K  1310972K  3849940K  26% /media/disk
As can be seen, there's a massive difference (PCC says 14MB, df says 5GB)  :(  . Can anyone explain this, because it's seriously affecting one of my scripts. Is there any way of encouraging both utilities to correspond with their info?

I'm using mmxii, BTW. Thanks.

Edit: interestingly, have just noticed that System-monitor says the partition is 4.9GB.

Offline µT6

  • Hero Member
  • *****
  • Posts: 1902
Re: Problem with HDD-size info.
« Reply #1 on: December 10, 2012, 07:37:15 AM »
how did you created that partition?

do you need it to be fat32?  fat32 is not the strongest type of partition, i would use ntfs for windows compatibility or ext3/4 for linux only

i don't know much about the topic so better wait for op who knows everything here  ;)
"A question that sometimes drives me hazy: am I or are the others crazy?"

Albert Einstein

Offline satuser083

  • Hero Member
  • *****
  • Posts: 510
Re: Problem with HDD-size info.
« Reply #2 on: December 10, 2012, 07:51:02 AM »
how did you created that partition?
With PCC  :o
do you need it to be fat32?  fat32 is not the strongest type of partition, i would use ntfs for windows compatibility or ext3/4 for linux only

i don't know much about the topic so better wait for op who knows everything here  ;)
On reflection it was probably a mistake, I don't even need it  ;) . I'm more interested in the obvious differences displayed by two utilities; perhaps this could occur with ext3/4 partitions, and that would be a problem.

Many thanks  :)

Offline cyrwyn

  • Hero Member
  • *****
  • Posts: 833
Re: Problem with HDD-size info.
« Reply #3 on: December 10, 2012, 09:04:24 AM »
Fat-32 is not a partition, but a filesystem that can contain files. A filesystem can be written to a partition up to the size of the partition, but doesn't have to fill it, the rest being empty space. I haven't a clue why you're getting conflicting reports about the size of the Fat-32 filesystem. If I were you I'd save any files in it elsewhere, delete it and reformat.
Using Linux for over 18 years and still counting.

Online Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10668
  • MLUs Forever!
Re: Problem with HDD-size info.
« Reply #4 on: December 10, 2012, 11:24:34 AM »
What does

fdisk -l /dev/sdb

report?

...  and also

df

without any options?
MLUs rule the roost!

Linux XPS 3.4.38-pclos1.bfs  64 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline µT6

  • Hero Member
  • *****
  • Posts: 1902
Re: Problem with HDD-size info.
« Reply #5 on: December 10, 2012, 12:29:49 PM »
"Fat-32 is not a partition, but a filesystem that can contain files. A filesystem can be written to a partition up to the size of the partition, but doesn't have to fill it, the rest being empty space"

i think this is the third time i have been corrected this way but i keep saying that fat32 is a partition and probably will keep doing it, spreading lies!!!  ;D

when you used pcc to create the partition, did you formated it with pcc?  i had problems in the past formatting fat32 and ntfs with pcc
"A question that sometimes drives me hazy: am I or are the others crazy?"

Albert Einstein

Offline satuser083

  • Hero Member
  • *****
  • Posts: 510
Re: Problem with HDD-size info.
« Reply #6 on: December 18, 2012, 09:45:32 AM »
What does

fdisk -l /dev/sdb

report?

...  and also

df

without any options?
Here you are (hope it helps):
Code: [Select]
[root@localhost ~]# fdisk -l /dev/sdb

Disk /dev/sdb: 40.0 GB, 40007761920 bytes
240 heads, 63 sectors/track, 5168 cylinders, total 78140160 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xc2afc2af

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *          63       30239       15088+   b  W95 FAT32
/dev/sdb2           30240    78140159    39054960    5  Extended
/dev/sdb5           30303       45359        7528+   b  W95 FAT32
/dev/sdb6           45423    36938159    18446368+  83  Linux
/dev/sdb7        36938223    63609839    13335808+  83  Linux
/dev/sdb8        63609903    78140159     7265128+  83  Linux
[root@localhost ~]# df
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda10             11G  8.9G  1.6G  85% /
/dev/sdb7              13G  4.1G  7.9G  35% /home/lawrence/zqstore
/dev/sdb8             6.9G  3.0G  3.6G  45% /home/lawrence/zqstoreT
/dev/sdb6              18G  4.3G   13G  26% /home/lawrence/.VirtualBox
/dev/sda1              12G   11G  818M  93% /media/mmx11_cop_241112
/dev/sda8              11G  8.3G  2.2G  80% /media/mmx11_cop_020712
/dev/sda5             6.5G  2.5G  4.0G  39% /media/DATA
/dev/sda11             17G  9.5G  6.4G  61% /media/BakZqstore02
/dev/sda9              11G  7.6G  2.8G  74% /media/mmx11_cop_120612
/dev/sdb1             5.0G  1.3G  3.7G  26% /media/disk
/dev/sda6             124M  6.7M  111M   6% /media/GrubPart

fdisk appears to provide the correct details; I could use it, but it means using root, which I wanted to avoid in the script.

when you used pcc to create the partition, did you formated it with pcc?  i had problems in the past formatting fat32 and ntfs with pcc
Yes, I did. I seem to remember having problems with PCC/FAT32, as well, I'll avoid that in future.

Many thanks to you both.  :) ;D

Online Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10668
  • MLUs Forever!
Re: Problem with HDD-size info.
« Reply #7 on: December 19, 2012, 11:15:20 AM »
Quote
fdisk appears to provide the correct details; I could use it, but it means using root, which I wanted to avoid in the script.

The availability of fdisk to the user is dependent on the user being a member of a specific group ....  not sure off hand which group ...  maybe 'disk' ? .....  I would need to check to be sure ....

I mention it as it might be useful for your particular application ...
MLUs rule the roost!

Linux XPS 3.4.38-pclos1.bfs  64 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline satuser083

  • Hero Member
  • *****
  • Posts: 510
Re: Problem with HDD-size info.
« Reply #8 on: December 19, 2012, 01:13:01 PM »

The availability of fdisk to the user is dependent on the user being a member of a specific group ....  not sure off hand which group ...  maybe 'disk' ? .....  I would need to check to be sure ....

I mention it as it might be useful for your particular application ...

I certainly would be interested to know how to do that; I've not fiddled around with groups before. I think fdisk would probably be more suitable for what I want in the script.

Many thanks.   :) :)

Online Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10668
  • MLUs Forever!
Re: Problem with HDD-size info.
« Reply #9 on: December 19, 2012, 04:46:28 PM »

The availability of fdisk to the user is dependent on the user being a member of a specific group ....  not sure off hand which group ...  maybe 'disk' ? .....  I would need to check to be sure ....

I mention it as it might be useful for your particular application ...

I certainly would be interested to know how to do that; I've not fiddled around with groups before. I think fdisk would probably be more suitable for what I want in the script.

Many thanks.   :) :)

I checked here and it is the 'disk' group that gives the user the permission to use that command ......  and a lot of others no doubt.

MLUs rule the roost!

Linux XPS 3.4.38-pclos1.bfs  64 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT