Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 26 Jul 2014, 07:27
All times are UTC - 4
 Forum index » House Training » Bugs ( Submit bugs )
PetGet size check error
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [6 Posts]  
Author Message
bsleys

Joined: 04 Mar 2008
Posts: 3

PostPosted: Tue 04 Mar 2008, 03:53    Post subject:  PetGet size check error
Subject description: In petget.run stat returns different block sizes on large USB sticks
 

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:
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:
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:
  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:
  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
Back to top
View user's profile Send private message 
MU


Joined: 24 Aug 2005
Posts: 13642
Location: Karlsruhe, Germany

PostPosted: Tue 04 Mar 2008, 04:00    Post subject:  

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

_________________
my recommended links
Back to top
View user's profile Send private message Visit poster's website 
bsleys

Joined: 04 Mar 2008
Posts: 3

PostPosted: Tue 04 Mar 2008, 04:37    Post subject:  

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:
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:
# 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.
Back to top
View user's profile Send private message 
bsleys

Joined: 04 Mar 2008
Posts: 3

PostPosted: Tue 04 Mar 2008, 05:44    Post subject:  

Here is the info from 3.01 and 3.02

Code:
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.
Back to top
View user's profile Send private message 
MU


Joined: 24 Aug 2005
Posts: 13642
Location: Karlsruhe, Germany

PostPosted: Tue 04 Mar 2008, 06:22    Post subject:  

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

_________________
my recommended links
Back to top
View user's profile Send private message Visit poster's website 
iscraigh

Joined: 03 Sep 2006
Posts: 276

PostPosted: Tue 04 Mar 2008, 20:49    Post subject:  

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
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [6 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Bugs ( Submit bugs )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0738s ][ Queries: 11 (0.0099s) ][ GZIP on ]