LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   'df' Returning Wrong Size for a JFS Partion (https://www.linuxquestions.org/questions/slackware-14/df-returning-wrong-size-for-a-jfs-partion-578734/)

pricejm 08-21-2007 01:34 PM

'df' Returning Wrong Size for a JFS Partion
 
Why would df report this incorrectly?
If it is incorrect...

#df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda3 4.7G 3.3G 1.5G 70% /
/dev/hda1 477M 31M 447M 7% /boot
#
#
#
#fdisk -l

Disk /dev/hda: 20.4 GB, 20416757760 bytes
255 heads, 63 sectors/track, 2482 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 61 489951 83 Linux
/dev/hda2 62 183 979965 82 Linux swap
/dev/hda3 184 2482 18466717+ 83 Linux
#

bulliver 08-21-2007 05:14 PM

Does seem out of whack:

/dev/hda1 = 489951 blocks / 1024 = ~478M [Approximately correct]
/dev/hda2 = 979965 blocks / 1024 = ~956M [Approximately correct, if your swap is around 1G]
/dev/hda3 = 18466717 blocks / 1024 = ~18033M (~18G)[Missing 13G somewhere!]

So your /dev/hda3 as reported by 'df' indeed seems quite smaller than it should be. That said, the filesystem itself does add overhead that will be reported in 'df' but not 'fdisk', but not 13G worth certainly. I am unfamiliar with JFS so I am unable to help you further here...

syg00 08-21-2007 06:17 PM

Quote:

Originally Posted by pricejm (Post 2866016)
If it is incorrect...

Indeed.
There is no requirement for a filesystem to fill a partition - normal, but not obligatory. I would expect df to be correct without evidence to the contrary.
It looks like jfs can be enlarged, but needs a kernel module (I'm also not a user).

pricejm 08-21-2007 08:09 PM

I did a modprobe jfs with no change.

What if I wrote the partition tables out again through fdisk with no changes?

Would that screw something up? I thought I had done that before.

Sort of reformatting, I don't know.

michaelk 08-21-2007 08:38 PM

Did you modify the partition size at anytime? fdisk operates on the partition not the filesystem.

The capability of resizing (i.e. enlarging only) a jfs filesystem is built into its driver. You can do it via the command:

mount -o remount,resize /

Slackovado 08-23-2007 03:11 PM

Did you use partimage by any chance to image and then restore the partition?
With partimage, if the target partition when restoring an image is larger than the original partition when imaging then it will restore the file system to the original size.
Then df will report different size than the actual partition size.
It can be fixed easily but i'd have to look it up in my notes on another computer. So let me know if you need that info.

pricejm 08-25-2007 12:35 AM

Sorry for the late replay, didn't get an email...

I originally had multiple partitions, then after having to reinstall for the third or fourth time, (which meant putting the hard drive in another computer that would actually boot the install CD) I decided to just have a swap, boot, and the root filesystem. I'm pretty sure I formated both and I just did a full install instead of picking and choosing. Then after that I noticed the discrepancy.

I'll try the remount option...

Well that did it "mount -o remount,resize /"

# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda3 18G 3.3G 15G 19% /
/dev/hda1 477M 31M 447M 7% /boot

Thanks michaelk, great work.

...maybe I didn't format...


All times are GMT -5. The time now is 10:12 AM.