The amazing disappearing 6-to-7GB!

I’ve searched online and I can’t seem to find an answer to my current little problem.

I’ve got 10GB hard disk on my GNU/Linux laptop. Strangely, when I check the properties of hda1, it reports that the disk is only 5.6GB and that I’ve already used 51% of it. :astonished: There’s a Linux-swap partition of about 502MB, so that minus the 2.5GB Knoppix install - I should have about 6-to-7GB somewhere, right?

I tried doing a little resizing in QTparted with no success. (In QTparted, it lists hda1 as being 8GB in size.) I tried to run fdisk, but I’m worried about screwing up majorly and then having to re-install and re-update my entire system.

Anybody run into this problem and discover a solution? (I need the disk space.)

:help:

[quote=“jwar”]I’ve searched online and I can’t seem to find an answer to my current little problem.

I’ve got 10GB hard disk on my GNU/Linux laptop. Strangely, when I check the properties of hda1, it reports that the disk is only 5.6GB and that I’ve already used 51% of it. :astonished: There’s a Linux-swap partition of about 502MB, so that minus the 2.5GB Knoppix install - I should have about 6-to-7GB somewhere, right?

I tried doing a little resizing in QTparted with no success. (In QTparted, it lists hda1 as being 8GB in size.) I tried to run fdisk, but I’m worried about screwing up majorly and then having to re-install and re-update my entire system.

Anybody run into this problem and discover a solution? (I need the disk space.)

:help:[/quote]

Before any of us can help you, we’ll need a little more information. First off, we’ll need to see the output of “df -h”. For example, on my machine:

x@sonic:~> df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda2 14G 7.9G 6.2G 57% /
tmpfs 125M 0 125M 0% /dev/shm

==============================
The only problem with the df command is that it will only show mounted partitions. We also need to see what is not mounted. Probably the best way to do that is to show us the output of the cfdisk command. You need to be root to run this. Do NOT make any modifications to the partitions, just show us the screen output. In case you don’t know how to copy/paste screen output: with your mouse, highlight the screen with left mouse button, then put mouse where you want to paste and click middle button (or trackwheel if you don’t have a middle button). Here’s the output I get from “cfdisk /dev/hda”:

                              cfdisk 2.12p

                          Disk Drive: /dev/hda
                    Size: 40020664320 bytes, 40.0 GB
          Heads: 16   Sectors per Track: 63   Cylinders: 77545

Name        Flags      Part Type  FS Type          [Label]        Size (MB)

hda1                    Primary   Linux swap / Solaris               500.10 
hda2                    Primary   Linux ReiserFS                   14999.82
hda3                    Primary   Linux                              649.77
hda4                    Primary   OpenBSD                          23870.99



 [Bootable]  [ Delete ]  [  Help  ]  [Maximize]  [ Print  ]
 [  Quit  ]  [  Type  ]  [ Units  ]  [ Write  ]

============================

Finally, it would help to see what is in your /etc/fstab file (this is your “file system table” - it shows us what should be mounted where). You can use “cat /etc/fstab” to get this output.

Armed with the above info, we can probably answer your question.

regards,
DB

df -h output:

Filesystem Size Used Avail Use% Mounted on
/dev/hda1 5.4G 2.6G 2.6G 50% /
/dev/root.old 20M 9.7M 11M 49% /initrd
/dev/sda1 125M 6.9M 118M 6% /mnt/sda1

cfdisk output:

cfdisk 2.12

Disk Drive: /dev/hda
Size: 10056130560 bytes, 10.0 GB
Heads: 15 Sectors per Track: 63 Cylinders: 20784

Name Flags Part Type FS Type [Label] Size (MB)

hda1 Boot Primary Linux ext3 8998.46
hda5 Logical Linux swap 509.97
Pri/Log Free Space 547.71

The /etc/fstab output:

/etc/fstab: filesystem table.

filesystem mountpoint type options dump pass

/dev/hda1 / ext3 defaults,errors=remount-ro 0 1

proc /proc proc defaults 0 0
/dev/fd0 /floppy vfat defaults,user,noauto,showexec,umask=022 0 0
usbdevfs /proc/bus/usb usbdevfs defaults 0 0
sysfs /sys sysfs defaults 0 0
/dev/cdrom /cdrom iso9660 defaults,ro,user,noexec,noauto 0 0
/dev/dvd /dvd iso9660 defaults,ro,user,noexec,noauto 0 0
/dev/cdaudio /cdaudio iso9660 defaults,ro,user,noexec,noauto 0 0

Added by KNOPPIX

/dev/hda5 none swap defaults 0 0

Added by KNOPPIX

/dev/sda1 /mnt/sda1 vfat noauto,users,exec,umask=000 0 0

Sorry to be such a burden. But, DB, your help is really appreciated. (I’m a Linux newbie - only about 4 months into it.)

Filesystem size, and partition size does not necessarly have to be the same although it almost always is. df shows fs size, while fdisk partition size.

Things that can cause such is eg. a switch between journal-nonjournaling fs.
One way to resolve could be the utility program resize2fs which although only
is for ext2 and you have ext3 it might be ok since they are so closely related and can be switched between without any dataloss.
I’m no expert on fs and journaling switch on and off, but hopefully I put you on the right track to the solution.

YingFan

I must say Jwar, after looking at the output you posted, I’m just about stumped. I’ve never seen anything like that. I was expecting to find that you had an old abandoned Windows partition on the drive that you’d forgotten about, but that’s apparently not the case. Cfdisk is showing just two partitions, a 500MB swap (extended) partition and a 9GB primary partition. The amount of space you’re using is not excessive for a full Knoppix install - Knoppix installs around 2GB of files, and I guess you may have added a few apps, plus your own data. Also, some space gets eaten up by the Firefox cache and Email trashcan if you’re not emptying it. There are also log files which grow over time, unless you delete them and turn logging off. So 2.5GB, which is what you’re using, is reasonable. But over 4GB seems to be unaccounted for. I can’t agree with Yingfan’s theory - a journal eats up some space, but not such a huge amount.

Here’s a guess - your hard disk is going to pot. If it’s only a 10GB hard disk, it must be pretty old - it’s been over five years since I’ve seen one that small for sale anywhere. There are some Linux utilities for checking a hard disk. First, just for grins, try this:

dmesg | grep -i error

If that gives you no output, that’s good! But it doesn’t mean you’re out of the woods. Since /dev/hda1 is ext3 partition, you can use a utility called e2fsck. It’s included with Knoppx and Kanotix, but BIG word of caution - you have to run it on an unmounted hard disk. That means, you’ve got to reboot with the Knoppix CD, then “su” to become root, then this:

e2fsck /dev/hda1

See if that gives you any error messages. If it doesn’t, one more utility (also on the Knoppix disk) is called “badblocks”. You run it the same way:

badblocks /dev/hda1

It will take quite some time to run (depending on the size and speed of your hard disk), so go drink some coffee while waiting.

If there are still no errors, you could attempt a reinstall. I don’t find re-installs so traumatic, especially since it gives you the excuse to download the latest Kanotix and install it. Of course, back up your data before proceeding (you do back up regularly, don’t you?).

If you decide to do a re-install, take the opportunity to learn how to manually partition your disk rather than letting Knoppix do it for you.

Boot Knoppix/Kanotix, open an Xterm, su to root, and manually configure your hard disk partitions with cfdisk. Delete the two partitions you’ve got, create two new ones, make them both “primary” partitions (as opposed to a primary and extended, as you have now). I usually make /dev/hda1 my swap and /dev/hda2 my main partition. You must set partition type - swap is 82 and Linux (your main partition) is 83. Save and exit. Then format the partitions. Assuming that /dev/hda1 is swap and /dev/hda2 is for everything else, do this:

mkswap /dev/hda1
mkfs.ext3 /dev/hda2

That’s all. Just fire up knoppix-installer (or kanotix-installer) and follow the instructions. Easy (isn’t it?). You just can’t have this kind of fun with Windows.

cheers,
DB

DB,

Thank you so much for these thorough and 100% helpful replies.

I’m currently reinstalling Knoppix 3.6 after cleaning the HD by repartitioning it. (I’d like to get the newest Knoppix, but the mirrors are just slow, slow, slow.) None of the checks revealed any errors (thankfully).

I followed your advice and everything seems to be clean. With the reinstall, I should have 7.5 GB of space for my work after a full Knoppix install. (Which is just GREAT!)

If you ever need any graphics or a logo or some other piece of art, just let me know. I need to repay you somehow for this help.

Your writings are now part of my GNU/Linux literature library.

I’ll write more tomorrow - hopefully reporting complete success.

(Note: I don’t know if installing a version of Morphix previously might have screwed up some things. No slap against Morphix, but me being a newbie, I screwed it up. I remember a couple of stops during installation and partitioning. When I viewed the hidden folders on my HD, there were Gnome folders. But Knoppix doesn’t have Gnome, so…)

DB,

Everything is good here now.

I’ve got 6.3 GB of free space - much better than 2.6!

Thanks a lot for sharing your GNU/Linux knowledge.