[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

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

Post#1 by anandisrocking007 » 22 Jun 2015, 11:31

Hi everyone i guess the topic tells it all i have made a save.dat file but lets say i saved to much it and it became full or i made a made a magic folder and linked it to a folder in porteus can you show me a way to findout how much space i have used in the save.dat file would appreciate an answer..... :D
Last edited by anandisrocking007 on 23 Jun 2015, 05:52, edited 1 time in total.

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#2 by Seva » 22 Jun 2015, 11:34

i dont know, it use ext4 formatted drive, and i think its better for porteus than fat32
posted from Porteus

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#3 by anandisrocking007 » 22 Jun 2015, 11:45

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: How to find out the space used in save.dat file

Post#4 by Seva » 22 Jun 2015, 11:55

when using ext4 there is no .dat containers, everything becomes better
posted from Porteus

Bogomips
Full of knowledge
Full of knowledge
Posts: 2564
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#5 by Bogomips » 22 Jun 2015, 12:01

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.
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

donald
Full of knowledge
Full of knowledge
Posts: 2064
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

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

Post#6 by donald » 22 Jun 2015, 12:22

@ anandisrocking007
as root:
mloop /path/savefile.dat

Filemanager > /mnt/loop

I don't know if one can do this when the savefile is in use.
(I don't have one)

when finished type uloop

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#7 by anandisrocking007 » 22 Jun 2015, 12:24

Bogomips wrote: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.
Well can you help me with that i have heard you have to type some commands in the terminal any idea what those are would help a lot as for the ext4 i would prefer to keep it windows readable and it would not heart if i learnt something along the way...... :good:

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#8 by anandisrocking007 » 22 Jun 2015, 12:29

donald wrote:@ anandisrocking007
as root:
mloop /path/savefile.dat

Filemanager > /mnt/loop

I don't know if one can do this when the savefile is in use.
(I don't have one)

when finished type uloop
Been there done that but it mounts it does not tells the exact amount of data used also i was thinking of asking this in another thread it seems i can use the mloop command to read iso file,dat file which have been used as magic folder but it seems that i can not use this for the persistant sav.dat file it comes up empty for some reason and but i know there are settings saved in it

User avatar
Ed_P
Contributor
Contributor
Posts: 8343
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

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

Post#9 by Ed_P » 22 Jun 2015, 12:50

anandisrocking007 wrote:Hi everyone i guess the topic tells it all i have made a save.dat file but lets say i saved to much it and it became full or i made a made a magic folder and linked it to a folder in porteus can you show me a way to findout how much space i have used in the save.dat file would appreciate an answer..... :D
I understand. Been there, done that. Save this script to your /home/guest/ folder:

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

# 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 
fi

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
echo
In a terminal window enter: sh ./savedatspaceused.sh

You should see what you're seeking.
Ed

donald
Full of knowledge
Full of knowledge
Posts: 2064
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

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

Post#10 by donald » 22 Jun 2015, 18:48

@ anandisrocking007
sorry,my bad
you have to reboot into the "allways fresh" mode to make it work.(mloop the save.dat)

hmm..doesn't a df -h /mnt/live/memory/changes/
(normal boot) show the save file values.?

Bogomips
Full of knowledge
Full of knowledge
Posts: 2564
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#11 by Bogomips » 22 Jun 2015, 20:19

Code: Select all

guest@porteus:~$ df -h /mnt/live/memory/changes/ 
Filesystem      Size  Used Avail Use% Mounted on
-               265M  4.0M  261M   2% /mnt/live/memory/changes
guest@porteus:~$ df -h .
Filesystem      Size  Used Avail Use% Mounted on
aufs            265M  4.0M  261M   2% /
cpy2ram and not using changes, Get same values.
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

donald
Full of knowledge
Full of knowledge
Posts: 2064
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

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

Post#12 by donald » 23 Jun 2015, 03:03

@Bogomips
normal boot with save.dat (save changes)

guest@porteus:~$ df -h /mnt/live/memory/changes/
Filesystem Size Used Avail Use% Mounted on
- 509M 37M 472M 8% /mnt/live/memory/changes

root@porteus:/home/guest# du -sh /mnt/live/memory/changes/
11M /mnt/live/memory/changes/

copy2ram without save.dat (also allways fresh)

guest@porteus:~$ df -h /mnt/live/memory/changes/
Filesystem Size Used Avail Use% Mounted on
- 606M 408K 605M 1% /mnt/live/memory/changes

root@porteus:/home/guest# du -sh /mnt/live/memory/changes/
408K /mnt/live/memory/changes/

mloop /mnt/sdb1/porteus/save.dat

guest@porteus:~$ df -h /mnt/loop/
Filesystem Size Used Avail Use% Mounted on
/dev/loop5 509M 37M 473M 8% /mnt/loop

root@porteus:/home/guest# du -sh /mnt/loop/
11M /mnt/loop/

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#13 by anandisrocking007 » 23 Jun 2015, 04:38

Ed_P wrote:
anandisrocking007 wrote:Hi everyone i guess the topic tells it all i have made a save.dat file but lets say i saved to much it and it became full or i made a made a magic folder and linked it to a folder in porteus can you show me a way to findout how much space i have used in the save.dat file would appreciate an answer..... :D
I understand. Been there, done that. Save this script to your /home/guest/ folder:

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

# 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 
fi

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
echo
In a terminal window enter: sh ./savedatspaceused.sh

You should see what you're seeking.
@ Ed_P thanks a lot your script is awesome and it told precicely what i wanted to know :lol:
Here is the result of the script
Image

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#14 by anandisrocking007 » 23 Jun 2015, 04:43

donald wrote:@ anandisrocking007
sorry,my bad
you have to reboot into the "allways fresh" mode to make it work.(mloop the save.dat)

hmm..doesn't a df -h /mnt/live/memory/changes/
(normal boot) show the save file values.?
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. But the df -h /mnt/live/memory/changes/ does not show the value i think it shows the amount of memory used in ram or so
Bogomips wrote:

Code: Select all

guest@porteus:~$ df -h /mnt/live/memory/changes/ 
Filesystem      Size  Used Avail Use% Mounted on
-               265M  4.0M  261M   2% /mnt/live/memory/changes
guest@porteus:~$ df -h .
Filesystem      Size  Used Avail Use% Mounted on
aufs            265M  4.0M  261M   2% /
cpy2ram and not using changes, Get same values.
Nope thats not it checked it Ed_P 's script gives the right value
donald wrote:@Bogomips
normal boot with save.dat (save changes)

guest@porteus:~$ df -h /mnt/live/memory/changes/
Filesystem Size Used Avail Use% Mounted on
- 509M 37M 472M 8% /mnt/live/memory/changes

root@porteus:/home/guest# du -sh /mnt/live/memory/changes/
11M /mnt/live/memory/changes/

copy2ram without save.dat (also allways fresh)

guest@porteus:~$ df -h /mnt/live/memory/changes/
Filesystem Size Used Avail Use% Mounted on
- 606M 408K 605M 1% /mnt/live/memory/changes

root@porteus:/home/guest# du -sh /mnt/live/memory/changes/
408K /mnt/live/memory/changes/

mloop /mnt/sdb1/porteus/save.dat

guest@porteus:~$ df -h /mnt/loop/
Filesystem Size Used Avail Use% Mounted on
/dev/loop5 509M 37M 473M 8% /mnt/loop

root@porteus:/home/guest# du -sh /mnt/loop/
11M /mnt/loop/
yours only this command say the size of the save.dat file filled
mloop /mnt/sdb1/porteus/save.dat

guest@porteus:~$ df -h /mnt/loop/
Filesystem Size Used Avail Use% Mounted on
/dev/loop5 509M 37M 473M 8% /mnt/loop

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 i guess the best way is Ed_p 's Script
Last edited by anandisrocking007 on 23 Jun 2015, 04:51, edited 2 times in total.

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#15 by Seva » 23 Jun 2015, 04:46

ext4
posted from Porteus

Post Reply