[opensuse] df reports completely different sizes from fdisk
Hi ListMates, Opensuse Linux (Linux sr-server 2.6.37.6-0.7-default #1 SMP 2011-07-21 02:17:24 +0200 i686 athlon i386 GNU/Linux) I have a very unusual problem where fdisk reports one size BUT df reports a TOTALLY different and unexpected size. Besides doing a full backup, repartition, reformat and restore, is there anything else I can try first?? Here are the outputs: (sda1 and sda2 sizes are completely different from fdisk!!) df -v -h Filesystem Size Used Avail Use% Mounted on rootfs 22G 17G 4.2G 81% / devtmpfs 369M 152K 368M 1% /dev tmpfs 375M 648K 374M 1% /dev/shm /dev/sda2 22G 17G 4.2G 81% / /dev/sda1 15G 7.8G 6.6G 54% /windows/C FDISK reports correctly (sda1, sda2, sda3 = 24Gb, 949Gb, 3.1gb) ==== fdisk /dev/sda Command (m for help): p Disk /dev/sda: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0xd9ef0943 Device Boot Start End Blocks Id System /dev/sda1 63 48821534 24410736 7 HPFS/NTFS/exFAT /dev/sda2 * 48821535 1947254714 949216590 83 Linux /dev/sda3 1947254715 1953525167 3135226+ 82 Linux swap / Solaris SFDISK reports correctly also ================== sfdisk -s -l /dev/sda 976762584 Disk /dev/sda: 121601 cylinders, 255 heads, 63 sectors/track Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0 Device Boot Start End #cyls #blocks Id System /dev/sda1 0+ 3038 3039- 24410736 7 HPFS/NTFS/exFAT /dev/sda2 * 3039 121210 118172 949216590 83 Linux /dev/sda3 121211 121601- 391- 3135226+ 82 Linux swap / Solaris /dev/sda4 0 - 0 0 0 Empty PARTED also reports correctly ================== parted -l /dev/sda Model: ATA WDC WD10EARX-00N (scsi) Disk /dev/sda: 1000GB Sector size (logical/physical): 512B/4096B Partition Table: msdos Number Start End Size Type File system Flags 1 32.3kB 25.0GB 25.0GB primary ntfs type=07 2 25.0GB 997GB 972GB primary ext4 boot, type=83 3 997GB 1000GB 3210MB primary linux-swap(v1) type=82 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Otto Rodusek said the following on 09/13/2011 11:14 AM:
I have a very unusual problem where fdisk reports one size BUT df reports a TOTALLY different and unexpected size. Besides doing a full backup, repartition, reformat and restore, is there anything else I can try first??
Apples and Cucumbers. No even the shape, not even both a kind of fruit. Two totally different things. Not all file systems are on disk. When a file system is in a disk partition it doesn't have to fill the whole partition When a file system does fill a whole partition the amount of data will not be the same size as the partition because of the structural metadata that is part the file system. Sorry, what is your problem? Based on the data I don't see a problem. -- Much of the wisdom of one age, is the folly of the next. - Charles Simmons -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 09/13/2011 12:41 PM, Anton Aylward pecked at the keyboard and wrote:
Otto Rodusek said the following on 09/13/2011 11:14 AM:
I have a very unusual problem where fdisk reports one size BUT df reports a TOTALLY different and unexpected size. Besides doing a full backup, repartition, reformat and restore, is there anything else I can try first??
Apples and Cucumbers. No even the shape, not even both a kind of fruit. Two totally different things.
Not all file systems are on disk.
When a file system is in a disk partition it doesn't have to fill the whole partition
When a file system does fill a whole partition the amount of data will not be the same size as the partition because of the structural metadata that is part the file system.
Sorry, what is your problem? Based on the data I don't see a problem.
When creating a filesystem about 5% is held back for root in case of problems. It used to be 10% but with today's much larger drives it was reduced. Therefore the filesystem will always be smaller then the partition. Nothing to worry about here. -- Ken Schneider SuSe since Version 5.2, June 1998 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Ken Schneider - openSUSE said the following on 09/13/2011 01:00 PM:
On 09/13/2011 12:41 PM, Anton Aylward pecked at the keyboard and wrote:
Otto Rodusek said the following on 09/13/2011 11:14 AM:
I have a very unusual problem where fdisk reports one size BUT df reports a TOTALLY different and unexpected size. Besides doing a full backup, repartition, reformat and restore, is there anything else I can try first??
Apples and Cucumbers. No even the shape, not even both a kind of fruit. Two totally different things.
Not all file systems are on disk.
When a file system is in a disk partition it doesn't have to fill the whole partition
When a file system does fill a whole partition the amount of data will not be the same size as the partition because of the structural metadata that is part the file system.
Sorry, what is your problem? Based on the data I don't see a problem.
When creating a filesystem about 5% is held back for root in case of problems. It used to be 10% but with today's much larger drives it was reduced. Therefore the filesystem will always be smaller then the partition. Nothing to worry about here.
Then there are sparse files like database files, where the files size and the amount of disk space allocated are two different things. In one sense all files are a bit sparse. A file of actual length 1 byte will still have a 4K logical disk block allocated. Some file systems can 'share' in situations like that, but don't assume they all can. man du says: <quote> --apparent-size print apparent sizes, rather than disk usage; although the apparent size is usually smaller,it may be larger due to holes in (`sparse') files, internal fragmentation, indirect blocks, and the like </quote> man fdisk says <quote> In a DOS-type partition table the starting offset and the size of each partition is stored in two ways: as an absolute number of sectors given in 32 bits), and as a Cylinders/Heads/Sectors triple ..... Linux never uses C/H/S. </quote> Bytes .. logical disk blocks .. sectors You may think they are the same thing but they do no have a simple mapping. Different file systems will use the same partition in different ways. The same applications will use different file systems in different ways. some file systems are 'tunable;, but not all tuning will be optimal for some applications. And 'optimal' can mean different things in different contexts. -- Ninety percent of the politicians give the other ten percent a bad reputation. -- Henry Kissinger -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 2011/09/13 13:00 (GMT-0400) Ken Schneider - openSUSE composed:
When creating a filesystem about 5% is held back for root in case of problems. It used to be 10% but with today's much larger drives it was reduced. Therefore the filesystem will always be smaller then the partition.
5% is only a default. On most of my user data partitions (only EXT2 & EXT3 used here) it is either 1% or 0%, so "always" smaller in terms of space available to users is incorrect. -- "The wise are known for their understanding, and pleasant words are persuasive." Proverbs 16:21 (New Living Translation) Team OS/2 ** Reg. Linux User #211409 ** a11y rocks! Felix Miata *** http://fm.no-ip.com/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Tue, Sep 13, 2011 at 12:41 PM, Anton Aylward <opensuse@antonaylward.com> wrote:
Otto Rodusek said the following on 09/13/2011 11:14 AM:
I have a very unusual problem where fdisk reports one size BUT df reports a TOTALLY different and unexpected size. Besides doing a full backup, repartition, reformat and restore, is there anything else I can try first??
Apples and Cucumbers. No even the shape, not even both a kind of fruit. Two totally different things.
Not all file systems are on disk.
When a file system is in a disk partition it doesn't have to fill the whole partition
When a file system does fill a whole partition the amount of data will not be the same size as the partition because of the structural metadata that is part the file system.
Sorry, what is your problem? Based on the data I don't see a problem.
Anton, Did you "look" at his email? His /dev/sda2 partition is reported as almost 1TB by various partitioning tools (972GB per one of them) df (not du) reports that partition as 22GB: /dev/sda2 22G 17G 4.2G 81% / That is not just a missing 5 or 10%. He is missing more than 95% of his potential space. I know how to force a filesystem to fill less than 5% of a partition, but it certainly isn't normal. Then sda1 is supposedly 25GB per the partition table, but df shows it much less: /dev/sda1 15G 7.8G 6.6G 54% /windows/C If that were my computer, I'd be very confused as well. == Back to OPs question. I'd make a backup immediately if you don't already have one. Then use fsck on /dev/sda2 to verify the consistency of your file systems. (Boot windows to check out /dev/sda1). If all looks good you can grow your ext filesystem to fill the partition. Use "resize2fs /dev/sda2". You can do the same for your Windows C: drive. If you're running Vista or Win7 you can do that inside the native OS. There I'd reboot and do it there. I let you google for the details on that. Greg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Greg Freemyer said the following on 09/13/2011 04:14 PM:
Anton,
Did you "look" at his email?
Yes, I did, and there's no need to post to me as well as the list. I sent a mail and couple of follow-ups exploring other aspects. You obviously missed the original one where I said
Not all file systems are on disk.
When a file system is in a disk partition it doesn't have to fill the whole partition
I have a partition that is deliberately not filled. 18G of a 54G partition is unused. Yes, I said PARTITION. -- "It's better to light a candle than to curse the darkness." - Eleanor Roosevelt -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 14/9/11 4:14 AM, Greg Freemyer wrote:
On Tue, Sep 13, 2011 at 12:41 PM, Anton Aylward <opensuse@antonaylward.com> wrote:
Otto Rodusek said the following on 09/13/2011 11:14 AM:
I have a very unusual problem where fdisk reports one size BUT df reports a TOTALLY different and unexpected size. Besides doing a full backup, repartition, reformat and restore, is there anything else I can try first?? Apples and Cucumbers. No even the shape, not even both a kind of fruit. Two totally different things.
Not all file systems are on disk.
When a file system is in a disk partition it doesn't have to fill the whole partition
When a file system does fill a whole partition the amount of data will not be the same size as the partition because of the structural metadata that is part the file system.
Sorry, what is your problem? Based on the data I don't see a problem. Anton,
Did you "look" at his email?
His /dev/sda2 partition is reported as almost 1TB by various partitioning tools (972GB per one of them)
df (not du) reports that partition as 22GB:
/dev/sda2 22G 17G 4.2G 81% /
That is not just a missing 5 or 10%. He is missing more than 95% of his potential space. I know how to force a filesystem to fill less than 5% of a partition, but it certainly isn't normal.
Then sda1 is supposedly 25GB per the partition table, but df shows it much less: /dev/sda1 15G 7.8G 6.6G 54% /windows/C
If that were my computer, I'd be very confused as well.
== Back to OPs question.
I'd make a backup immediately if you don't already have one.
Then use fsck on /dev/sda2 to verify the consistency of your file systems. (Boot windows to check out /dev/sda1).
If all looks good you can grow your ext filesystem to fill the partition. Use "resize2fs /dev/sda2".
You can do the same for your Windows C: drive. If you're running Vista or Win7 you can do that inside the native OS. There I'd reboot and do it there. I let you google for the details on that.
Greg Hi Greg,
Thanks for your email reply. Yes, I did a full backup the moment I saw the anomoly. I did not mention this in my original post but, yes, I rebooted into OpenSuse 11.4 (Rescue) and did an (e2fsck) on /dev/sda2 as well as (resizefs -p /dev/sdb2) - all to no avail - once rebooted to /dev/sda2 df reports same anomoly!! My next step (and I was hoping not to have to do it!!) is to re-boot from dvd, (mkfs.ext4 /dev/sda2) and restore from backup then rerun grub for /dev/sda2 and see the results. I was hoping there would be a "magic bullet" so I wouldn't have to do that. I am real curious as to why this should happen. Thanks. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Wed, Sep 14, 2011 at 12:22 AM, Otto Rodusek <otto@applied.com.sg> wrote:
On 14/9/11 4:14 AM, Greg Freemyer wrote:
On Tue, Sep 13, 2011 at 12:41 PM, Anton Aylward <opensuse@antonaylward.com> wrote:
Otto Rodusek said the following on 09/13/2011 11:14 AM:
I have a very unusual problem where fdisk reports one size BUT df reports a TOTALLY different and unexpected size. Besides doing a full backup, repartition, reformat and restore, is there anything else I can try first??
Apples and Cucumbers. No even the shape, not even both a kind of fruit. Two totally different things.
Not all file systems are on disk.
When a file system is in a disk partition it doesn't have to fill the whole partition
When a file system does fill a whole partition the amount of data will not be the same size as the partition because of the structural metadata that is part the file system.
Sorry, what is your problem? Based on the data I don't see a problem.
Anton,
Did you "look" at his email?
His /dev/sda2 partition is reported as almost 1TB by various partitioning tools (972GB per one of them)
df (not du) reports that partition as 22GB:
/dev/sda2 22G 17G 4.2G 81% /
That is not just a missing 5 or 10%. He is missing more than 95% of his potential space. I know how to force a filesystem to fill less than 5% of a partition, but it certainly isn't normal.
Then sda1 is supposedly 25GB per the partition table, but df shows it much less: /dev/sda1 15G 7.8G 6.6G 54% /windows/C
If that were my computer, I'd be very confused as well.
== Back to OPs question.
I'd make a backup immediately if you don't already have one.
Then use fsck on /dev/sda2 to verify the consistency of your file systems. (Boot windows to check out /dev/sda1).
If all looks good you can grow your ext filesystem to fill the partition. Use "resize2fs /dev/sda2".
You can do the same for your Windows C: drive. If you're running Vista or Win7 you can do that inside the native OS. There I'd reboot and do it there. I let you google for the details on that.
Greg
Hi Greg,
Thanks for your email reply. Yes, I did a full backup the moment I saw the anomoly. I did not mention this in my original post but, yes, I rebooted into OpenSuse 11.4 (Rescue) and did an (e2fsck) on /dev/sda2 as well as (resizefs -p /dev/sdb2) - all to no avail - once rebooted to /dev/sda2 df reports same anomoly!!
My next step (and I was hoping not to have to do it!!) is to re-boot from dvd, (mkfs.ext4 /dev/sda2) and restore from backup then rerun grub for /dev/sda2 and see the results. I was hoping there would be a "magic bullet" so I wouldn't have to do that.
I am real curious as to why this should happen. Thanks.
Otto, Something is clearly wrong. I suggest you post to the ext kernel mailing list ("ext4" <linux-ext4@vger.kernel.org> ) No subscription necessary, just post away. They follow a reply-all policy, so you should be kept in copy of any replies. They support both the kernel portion of ext2/ext3/ext4 on that list and the userspace portion. Greg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (5)
-
Anton Aylward
-
Felix Miata
-
Greg Freemyer
-
Ken Schneider - openSUSE
-
Otto Rodusek