PetGet size check error

Please post any bugs you have found
Post Reply
Message
Author
bsleys
Posts: 3
Joined: Tue 04 Mar 2008, 07:24

PetGet size check error

#1 Post by bsleys »

I've had a problem installing packages via petget for a while now. I keep getting the error I don't have enough room to install them even though I have lots of space. I finally started digging into it and fund the problem is with the stat command and the size of blocks reported by it when used on my 4GB memory stick.

For example when trying to install XFCE-442a.pet which is 21.7MB in size on my install with a 256MB pup_save file and 221.2M free I would get the not enough block free message.

When checking what stat returns I get the following for these 2 commands.

Code: Select all

sh-3.00# stat --filesystem --format=%f /
51100

sh-3.00# stat --format=%b XFCE-442a.tar.gz 
44592
When you multiply the 22592 * 2 as the petget.run file does I don't have enough room but the problem is this is only looking at the # of blocks and not taking into account the block sizes as shown below.

Code: Select all

sh-3.00# stat --filesystem --format=%s /
4096

sh-3.00# stat --format=%B XFCE-442a.tar.gz 
512
Now when you take into account the block sizes I have plenty of room

51100 * 4096 = 209,305,600 -- free space in bytes
44592 * 512 * 2 = 45,662,208 -- required space in bytes

So my solution was to change

Code: Select all

  EXPFREEB=`stat --filesystem --format=%f /` * `stat --filesystem --format=%s /`#no. free blocks.
  EXPFILEB=`stat --format=%b $APKGNAMEEX` #no. blocks.
  EXPNEEDB=`expr $EXPFILEB \* 2` #bz2 can expand up to x3, need twice temp space. v3.01 changed 5 to 3. v3.92 changed to 2.
  if [ $EXPNEEDB -gt $EXPFREEB ];then
to

Code: Select all

  EXPFREEB=`stat --filesystem --format=%f /` #no. free blocks.
  EXPFREEBS=`stat --filesystem --format=%s /` #fee block size
  EXPFREEBY=`expr $EXPFREEB \* $EXPFREEBS` #free bytes
  EXPFILEB=`stat --format=%b $APKGNAMEEX` #no. blocks.
  EXPFILEBS=`stat --format=%B $APKGNAMEEX` #block size
  EXPFILEBY=`expr $EXPFILEB \* $EXPFILEBS` #bytes
  EXPNEEDB=`expr $EXPFILEBY \* 2` #bz2 can expand up to x3, need twice temp space. v3.01 changed 5 to 3. v3.92 changed to 2.
  if [ $EXPNEEDB -gt $EXPFREEBY ];then
I'm sure this is a better/cleaner way to do this but it worked for me.

Bob

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#2 Post by MU »

can you please post the result of
df -m

I'm interested in the free space in /tmp

In Puppy3, this can be mounted as tmpfs in ram, so it is limited in size.
A workaround can be to create a folder /tmp2 (can also be on a seperate partition) , and then
mount /tmp /tmp2

Then it has the size equivalent to the free space in pup_save.2fs or the external partition.
This will be no longer used in Puppy 4, and for Muppy a patched initrd.gz is available to use /tmp "traditionally".

Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

bsleys
Posts: 3
Joined: Tue 04 Mar 2008, 07:24

#3 Post by bsleys »

Will post the results in a bit. I've since rebooted to 4.00 alpha6 (I think?) 396 version.

I have the same problem in it. PETget gives me the following error

Code: Select all

The XFCE-442a.pet package has been downloaded to /root/.packages,
however there is not enough room to uncompress and install it.
The free space is 57220 blocks but it is estimated you will
need 89184 blocks temporarily for the expansion and install.

Note: If you are using a pup_save.3fs personal storage file,
it can be made bigger -- see Utilities menu.

This script will now delete the package and exit...
Oh and the df -m for this version is

Code: Select all

# df -m
Filesystem           1M-blocks      Used Available Use% Mounted on
/dev/sdb1                 3960      2746      1214  69% /initrd/mnt/dev_save
/dev/loop1                 248       177        71  71% /initrd/pup_ro1
tmpfs                      247        23       224   9% /initrd/pup_rw
tmpfs                       65        64         1  99% /initrd/mnt/tmpfs
/dev/loop0                  64        64         0 100% /initrd/pup_ro2
unionfs                    247        23       224   9% /
I'll post back with the same info from 3.01 and 3.02 both of which also have this same problem.

bsleys
Posts: 3
Joined: Tue 04 Mar 2008, 07:24

#4 Post by bsleys »

Here is the info from 3.01 and 3.02

Code: Select all

3.01
sh-3.00# df -m
Filesystem           1M-blocks      Used Available Use% Mounted on
/dev/sdb1                 3960      3003       958  76% /initrd/mnt/dev_save
/dev/loop1                 124         7       117   6% /initrd/pup_ro1
tmpfs                      247         3       245   1% /initrd/pup_rw
tmpfs                      109       108         1  99% /initrd/mnt/tmpfs
/dev/loop0                 108       108         0 100% /initrd/pup_ro2
/dev/loop3                   7         7         0 100% /initrd/pup_ro3
unionfs                    247         3       245   1% /
shmfs                       63         0        63   0% /dev/shm

3.02
sh-3.00# df -m
Filesystem           1M-blocks      Used Available Use% Mounted on
/dev/sdb1                 3960      2747      1214  69% /initrd/mnt/dev_save
/dev/loop1                 248       144       104  58% /initrd/pup_ro1
tmpfs                      247         2       246   1% /initrd/pup_rw
tmpfs                       72        71         1  99% /initrd/mnt/tmpfs
/dev/loop0                  71        71         0 100% /initrd/pup_ro2
/dev/loop3                  29        29         0 100% /initrd/pup_ro3
unionfs                    247         2       246   1% /
Oh and BTW I tested a 2nd 4GB USB stick and it does the same thing with the block size. The filesystem block size is much lager then the file block sizes. I'm guessing this has something to do with the lager USB memory sticks playing games to keep windows happy with the block counts or something similar. The first stick is a Patriot Xporter 4GB and the 2nd a ScanDisk Cruzer Micro 4.0GB.

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#5 Post by MU »

thanks.
On your system, /tmp is not mounted as tmpfs, so it is ok already.
You would have a line with /tmp and tmpfs in one line.

The blocksizes, yes, I encountered this too with an external harddisk.
The current method to measure the size needs to be enhanced.

Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

iscraigh
Posts: 276
Joined: Sun 03 Sep 2006, 05:50

#6 Post by iscraigh »

I have been having the same issue on 2 different usb sticks as well as a frugal install. All variants of 3.01/02

I just turned space checking to 0 in the script, not really a good idea but at least I could install the programs.

Craig

Post Reply