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

Last edited by anandisrocking007 on 23 Jun 2015, 05:52, edited 1 time in total.
-
- 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
i dont know, it use ext4 formatted drive, and i think its better for porteus than fat32
posted from Porteus
- anandisrocking007
- 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
Thats true but once the the datfile gets full then it would cause problem
-
- 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
when using ext4 there is no .dat containers, everything becomes better
posted from Porteus
-
- 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
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
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB
-
- Full of knowledge
- Posts: 2104
- 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
@ 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
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
- anandisrocking007
- 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
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......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.

- anandisrocking007
- 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
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 itdonald 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
- Ed_P
- Contributor
- Posts: 8908
- 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
I understand. Been there, done that. Save this script to your /home/guest/ folder: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.....
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
You should see what you're seeking.
-
- Full of knowledge
- Posts: 2104
- 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
@ 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.?
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.?
-
- 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
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% /
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
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB
-
- Full of knowledge
- Posts: 2104
- 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
@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/
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/
- anandisrocking007
- 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
@ Ed_P thanks a lot your script is awesome and it told precicely what i wanted to knowEd_P wrote:I understand. Been there, done that. Save this script to your /home/guest/ folder: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.....
savedatspaceused.shIn a terminal window enter: sh ./savedatspaceused.shCode: 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
You should see what you're seeking.

Here is the result of the script

- anandisrocking007
- 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
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 sodonald 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.?
Nope thats not it checked it Ed_P 's script gives the right valueBogomips wrote:cpy2ram and not using changes, Get same values.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% /
yours only this command say the size of the save.dat file filleddonald 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/
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.