# partition size not being reported correctly

## tjfitz

First of all, my apologies if this is in the wrong forum....

Ok, this is my problem.  I ran out of space in my linux / partition (which is where I have everything except my swap space).  To make room, I rebooted with Knoppix, created an image of my linux partition, used qtparted to shrink my windows partition, removed the swap partition and recreated it (qtparted wouldn't move it for some reason), then used fdisk to make a new primary partition for linux.  Then I restored the image to that partition.  I didn't format the partition first, because I was using reiser and it looks like the knoppix cd didn't support creating a reiser fs (but I'm new at this so maybe I just missed something).  After restoring the image, I rebooted and it worked fine, but 'df' showed the same 91% used as before, even though it should be about 500M  (?) bigger.  How do I get the size right?

Also, as a side note, how do I get my number lock on the keyboard to come on automatically when I start up/log in?

Thanks much!

----------

## NeddySeagoon

tjfitz,

The key words here are 'image of partition'. If thats what your really did, you also imaged all the partition size information, which got restored when you did the restore. You extra 500Mb have disappeared because of that.

You don't give your partition scheme but normally the easiest thing to do is to move one of your top level directories to its own partition. /usr is a good choice.

----------

## tjfitz

Hmm, that does make sense.  My system layout is thus:

CDRW: hda

w2k: hdb1

fat extended: hdb2 (containing vfat hdb5)

linux swap: hdb3

linux (everything else): hdb4

vfat: hdc1

It's an old machine, hdb is 40GB, hdc is ~6GB.

Anyway, what would you suggest I do to fix this?

----------

## tjfitz

Oh, btw, my linux "everything but swap" partition was/is ~2GB.  The uncompressed image easily fit onto my little hdc1.

----------

## NeddySeagoon

tjfitz,

Using the liveCD tar your liunx filesystem being sure to preserve times and permissions and maybe run it through bzip2 if you need to compress it. Then save it somewhere safe. You don't want to tar a live /proc or /dev

Resize your Windows partition, which you have already done.

hdb5 is a problem - you need to back that up too.

Now delete hdb5, hdb4, hdb3 and hdb2

make your extended partition hdb2 to fill the drive again.

Put linux everything else as hdb5

Swap as hdb6

vfat as hdb7.

Restore linux, fix grub and fstab and you should be in business.

Could you move some of linix onto hdc1. You would have to shrink the vfat partiton that is there but you could put /usr into the space that became available. Then you only have to have a new entry in fstab to mount it.

----------

## tjfitz

This tar-ing the whole partition, using the live cd, is a good idea.  I can save it to hdc1.  As for the other ideas, there are some snags.  I would rather not use hdc for anything other than short-term storage (it's old and a sizeable chunk of it was wrecked when the power went out and my UPS died....slowly, of course [I guess the head landed on the disk or something like that]).  As for hdb5, there's nowhere to put it, it's about 13GBs with about 10 used (unless I burn it all onto cd's).  Also, I should have been clearer in explaining the hdb layout.  Everything is true as I said, but not in that order.  In order on the disk it looks like this:

hdb1 |  hdb3  |  hdb4  |  hdb2(hdb5)

Ok, I'm going to give it shot at backing up everything, and I'll let you know how it turns out.

(dang, I really need another hd!)

----------

## tjfitz

Ok, tarring the partition works ok, but when I use the -p to preserve permissions it almost finishes it then gives me a message about a delayed error or such (sorry didn't write it down).  Will I need to preserve the permissions explicitly or will it be fine as is?  This is what I used:

tar -cvvf /mnt/hdb5/LINUXFILES.tar /mnt/hdb4/

I have this file now, but I'm not going to wipe out the old partition until I find out if this .tar file is what I need.  Thanks!

----------

## NeddySeagoon

tjfitz,

Try untarring the the file to /dev/null to check for errors.

To be really safe you could also use the verify option when you make the tar file. I think its -W. Check with man tar or info tar.

The -p (for preserve) looks like its an extraction option. the permissions are saved in the tar file anyway.

----------

## tjfitz

Ok then, here we go.  Wheeeee!

----------

## tjfitz

Ok, I got that error again, "tar: Error exit delayed from previous errors".  Huh?

----------

## NeddySeagoon

tjfitz,

What previous errors ?

----------

## Rafje

 *tjfitz wrote:*   

> How do I get the size right?

 

Easy: resize_reiserfs if you've got reiserfs, ext2resize if you've got ext2 or ext3.

I had the exact same issue as you, and ext2resize solved it in seconds. Absolutely no need to shift files around.

 *tjfitz wrote:*   

> Wheeeee!

 Am I just too late...?   :Smile: 

----------

## tjfitz

Rafje,

Too late?  Absolutely not!  That would be a lot less headache, I believe.

However, I don't know what the exact size should be.  qtparted reports the partition as being 2.66G, but df reports it as still at the old size (about 2.2G).  How would I use this command to do this?

----------

## Rafje

 *The resize_reiserfs man page that I linked to wrote:*   

> If the -s option is not specified, the filesystem will be resized to fill the given device.

 

If I remember correctly, the ext2resize that I used worked in the same way: if you don't give a size, it takes the size of the partition as you see it in fdisk.

Cheers

----------

## tjfitz

Oh, duh, yeah, I was reading the man page too but kinda skipped over that first paragraph to look at the syntax.  So then, I'm going to try 

resize_reiserfs /dev/hdb4

Once I've verified that my backup is good.  Thanks a lot!

----------

## tjfitz

Neddy,

I didn't see any previous errors.  However, when I removed the -W option it worked, hmm.

Rafje,

Ok, the resize_reiserfs worked like a charm!

And to both of you, thanks very much for your assistance!!!

 :Very Happy: 

----------

