[SOLVED] How to find out the space used in save.dat file

Post here if you are a new Porteus member and you're looking for some help.
User avatar
anandisrocking007
Black ninja
Black ninja
Posts: 47
Joined: 20 Jun 2015, 05:12
Distribution: KDE4
Location: Kolkata

Re: How to find out the space used in save.dat file

Post#16 by anandisrocking007 » 23 Jun 2015, 04:54

Seva wrote:ext4
like i said before i wanted a pendrive in which there is windows partition but that was not the point the point of asking this question is to know if there is a way if to find out how much data is saved in the persistance file and delete the extra data or rezie the dat file

Seva
Samurai
Samurai
Posts: 134
Joined: 30 Apr 2015, 12:00
Distribution: XFCE Porteus Desktop 3.1 64bit
Location: Moscow, Russia

Re: How to find out the space used in save.dat file

Post#17 by Seva » 23 Jun 2015, 05:00

i took the courage and reformatted the flash drive into ext4, and it became a fish in the water, i recommend all users to use linux filesystem when using porteus
posted from Porteus

User avatar
Ed_P
Contributor
Contributor
Posts: 3200
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

Re: How to find out the space used in save.dat file

Post#18 by Ed_P » 23 Jun 2015, 05:30

anandisrocking007 wrote:Thanks a lot in telling me that you can only loop the save.dat file in freshor copy2ram mode i thought i was doing something wrong they should add this line in the the porteus tutorial.
Hi anandisrocking007

Glad the script worked for you. :) If you want to run the script as before and in Always Fresh mode use this version:

savedatspaceused.sh

Code: Select all

#!/bin/sh
#  http://forum.porteus.org/viewtopic.php?f=81&t=1941&start=15#p13272
#  http://forum.porteus.org/viewtopic.php?f=117&t=3205&p=25099#p25097

#  mloop requires changes= cheatcodes not used (Always Fresh mode)

# Color definitions
txtbld=$(tput bold)               # Bold
txtred=${txtbld}$(tput setaf 1)   # Red
rst=$(tput sgr0)                  # Reset

function redpswd() {
  echo -e "$1" $txtred  
}

if [ `whoami` != "root" ]; then
    redpswd "Enter root's password"
    su -c "sh $0 $1"
    exit
fi
echo $rst

if [ -a /mnt/live/memory/images/changes ]; then
   SPACEDATDIR=/mnt/live/memory/images/changes 
else
   mloop /mnt/sdb1/porteus/save.dat
   SPACEDATDIR=/mnt/loop
fi
# Change the mloop command to match the name and location of your save.dat file.

echo
echo du -sh
du -sh ${SPACEDATDIR}     # Show the amount used   
echo df -h
df -h  ${SPACEDATDIR}     # Show filesystem summary
echo
du -sh ${SPACEDATDIR}/etc
du -sh ${SPACEDATDIR}/home
du -sh ${SPACEDATDIR}/opt
du -sh ${SPACEDATDIR}/root
du -sh ${SPACEDATDIR}/usr
du -sh ${SPACEDATDIR}/var

if [ -a /mnt/live/memory/images/changes ]; then
   echo  
else
   uloop 
fi
:)
Seva wrote:i took the courage and reformatted the flash drive into ext4, and it became a fish in the water, i recommend all users to use linux filesystem when using porteus
While that works it limits access to files on the flash drive by Windows systems. Probably by Android and Apple systems too. It depends on the environment the flash drive will be used in.
Ed

Bogomips
Full of knowledge
Full of knowledge
Posts: 2560
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: How to find out the space used in save.dat file

Post#19 by Bogomips » 24 Jun 2015, 14:14

anandisrocking007 wrote:Overall thanks a lot you guys for the reply now found out that 90% of my save.dat was being eaten by the google chrome cache
If you haven't already done so, magic folder the google chrome cache. That's what I've done with the PaleMoon cache, but to hard disk. 8)
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

User avatar
Ed_P
Contributor
Contributor
Posts: 3200
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

Re: How to find out the space used in save.dat file

Post#20 by Ed_P » 25 Jun 2015, 05:04

anandisrocking007 wrote:found out that 90% of my save.dat was being eaten by the google chrome cache
In firefox the cache's size is a variable that the user can set, I have to suspect Chrome has the same option. If so try setting it for 10-20MB.

BTW My save.dat file is 320MB.
Ed

long123
White ninja
White ninja
Posts: 5
Joined: 17 Jun 2015, 08:20
Distribution: long123
Location: hefei

Re: [SOLVED] How to find out the space used in save.dat file

Post#21 by long123 » 25 Jun 2015, 07:22

Thats true but once the the datfile gets full then it would cause problem.

Seva
Samurai
Samurai
Posts: 134
Joined: 30 Apr 2015, 12:00
Distribution: XFCE Porteus Desktop 3.1 64bit
Location: Moscow, Russia

Re: [SOLVED] How to find out the space used in save.dat file

Post#22 by Seva » 25 Jun 2015, 08:44

@Ed_P

Yes, if i have only one flash drive for many different devices i should better go with fat32.
posted from Porteus

User avatar
francois
Contributor
Contributor
Posts: 4984
Joined: 28 Dec 2010, 14:25
Distribution: kde xfce porteus manjaro kubun
Location: Enfin l'été, le changement climatique attendu: le soleil.

Re: [SOLVED] How to find out the space used in save.dat file

Post#23 by francois » 25 Jun 2015, 12:07

If the save.dat becomes full, you can mount it and modify it. See:
https://forum.porteus.org/viewtopic.php?f=46&t=137
viewtopic.php?f=81&t=3435
Voltaire: Le mieux est l'ennemi du bien.

long123
White ninja
White ninja
Posts: 5
Joined: 17 Jun 2015, 08:20
Distribution: long123
Location: hefei

Re: [SOLVED] How to find out the space used in save.dat file

Post#24 by long123 » 26 Jun 2015, 08:08

Been a while since I used persistence, but if my memory serves me correctly, you need to find out the size of the image in the save,dat file.

Post Reply