If I hit any key it won't save but if I hit Enter or space it will save.Bogomips wrote:Think you need:This way you are starting with last changes and then no longer saving changes, if that is what you wish to do.Code: Select all
changes=/porteus/porteussave.dat changes-ro
Save.dat / changes confusion
-
- Contributor
- Posts: 1955
- Joined: 09 Aug 2013, 14:25
- Distribution: Nemesis Cinnamon 64
- Location: USA
Re: Save.dat / changes confusion
I just like Slackware because I think it teach you about Linux to build packages where Ubuntu is like Windows you just install programs you want.
- Ed_P
- Contributor
- Posts: 8908
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Re: Save.dat / changes confusion
Yup.Jack wrote:If I hit any key it won't save but if I hit Enter or space it will save.

-
- Contributor
- Posts: 1955
- Joined: 09 Aug 2013, 14:25
- Distribution: Nemesis Cinnamon 64
- Location: USA
Re: Save.dat / changes confusion
How can I tell how much been used? That 4GB has 2.4 free. One thing I did was I made a copy of porteussave.dat file and put it here "/mnt/sdb1/backup" backup is a directory on the same USB just to be safe.
I just like Slackware because I think it teach you about Linux to build packages where Ubuntu is like Windows you just install programs you want.
- Ed_P
- Contributor
- Posts: 8908
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Re: Save.dat / changes confusion
An excellent question Jack. And it is good to be concerned because a) it can fill up and b) you can loose your files should it fill up.Jack wrote:How can I tell how much been used?
If you are using the save.dat file these commands should help:
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
du -sh /mnt/live/memory/images/changes # Show the amount used
echo
df -h /mnt/live/memory/images/changes # 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
savedatspaceck.sh
Code: Select all
#!/bin/sh
# Add to /etc/rc.d/rc.local_shutdown. And make sure rc.local_shutdown is executable.
# Bogomips help: http://forum.porteus.org/viewtopic.php?f=140&t=6069&p=47591#p47589
# http://forum.porteus.org/viewtopic.php?f=140&t=6069&p=47614#p47598
# Color definitions
txtbld=$(tput bold) # Bold
txtred=${txtbld}$(tput setaf 1) # Red
rst=$(tput sgr0) # Reset
function redwarning() {
echo -e $txtred "$1" $rst
}
if [ -a /mnt/live/memory/images/changes ]; then
SDspace=$(df -BM --output=size,used,avail,pcent /mnt/live/memory/images/changes | tail -n1)
read size used avail percent <<< $SDspace
if [ ${percent%\%} -gt 85 ]; then
echo
redwarning "Warning! save.dat file $percent full. Used: $used Free: $avail"
echo
else
echo "save.dat file $percent full. Used: $used Free: $avail"
fi
fi
Excellent.I made a copy of porteussave.dat file


https://en.wikipedia.org/wiki/Kung_Fu_(TV_series)
- brokenman
- Site Admin
- Posts: 6105
- Joined: 27 Dec 2010, 03:50
- Distribution: Porteus v4 all desktops
- Location: Brazil
Re: Save.dat / changes confusion
I should look at implementing this in the shutdown scripts. If there is not enough room then the changes are not saved in order to prevent the container file from becoming corrupt.
How do i become super user?
Wear your underpants on the outside and put on a cape.
Wear your underpants on the outside and put on a cape.
-
- Contributor
- Posts: 1955
- Joined: 09 Aug 2013, 14:25
- Distribution: Nemesis Cinnamon 64
- Location: USA
Re: Save.dat / changes confusion
Should I rename mind to save.dat or is it ok to leave mind porteussave.dat? And do I use the 2nd script so it will auto do it for me?Ed_P wrote:If you are using the save.dat file these commands should help:
EDIT:
This what happen.
Code: Select all
root@porteus:/mnt/sdb1/backup# sh savedatspacesused.sh
sh: savedatspacesused.sh: No such file or directory
root@porteus:/mnt/sdb1/backup# sh savedatspacesck.sh
sh: savedatspacesck.sh: No such file or directory
root@porteus:/mnt/sdb1/backup#
I just like Slackware because I think it teach you about Linux to build packages where Ubuntu is like Windows you just install programs you want.
-
- Contributor
- Posts: 1955
- Joined: 09 Aug 2013, 14:25
- Distribution: Nemesis Cinnamon 64
- Location: USA
Re: Save.dat / changes confusion
Here is my output on both scripts. It works great.
Code: Select all
root@porteus:/mnt/sdb1/porteus# sh savedatspaceused.sh porteussave.dat
133M /mnt/live/memory/images/changes
Filesystem Size Used Avail Use% Mounted on
/dev/loop14 509M 164M 346M 33% /mnt/live/memory/images/changes
5.9M /etc
du: cannot access '/home/guest/.gvfs': Permission denied
96M /home
666M /opt
53K /root
1.1G /usr
24M /var
root@porteus:/mnt/sdb1/porteus# sh savedatspaceck.sh porteussave.dat
save.dat file 33% full. Used: 164M Free: 346M
root@porteus:/mnt/sdb1/porteus#
I just like Slackware because I think it teach you about Linux to build packages where Ubuntu is like Windows you just install programs you want.
- Ed_P
- Contributor
- Posts: 8908
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Re: Save.dat / changes confusion
Thank you. I am honored you would consider an idea of mine.brokenman wrote:I should look at implementing this in the shutdown scripts.

By all means leave it named as porteussave.dat. save.dat is just it's nickname.Jack wrote:Should I rename mind to save.dat or is it ok to leave mind porteussave.dat?

Well I would try the 1st script periodically to get a feel for the space usage. See how it's allocated and such.And do I use the 2nd script so it will auto do it for me?
Did you save the script as that name? And where did you save it? Mine is in my /home/guest/ folder.EDIT:
This what happen.You might need some kind of built in Help but just a idea.Code: Select all
root@porteus:/mnt/sdb1/backup# sh savedatspacesused.sh sh: savedatspacesused.sh: No such file or directory root@porteus:/mnt/sdb1/backup# sh savedatspacesck.sh sh: savedatspacesck.sh: No such file or directory root@porteus:/mnt/sdb1/backup#
Last edited by Ed_P on 07 Aug 2016, 23:55, edited 1 time in total.
- Ed_P
- Contributor
- Posts: 8908
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Re: Save.dat / changes confusion
Excellent!!Jack wrote:Here is my output on both scripts. It works great.

You don't need to added "porteussave.dat" to the commands to run them. Both scripts read the contents of the files in use.
For the automatic check version this is my /etc/rc.d/rc.local_shutdown file:
Code: Select all
#!/bin/sh
#
# rc.local_shutdown
#
# This script is executed at shutdown (rc0) and reboot (rc6).
# You need to make it executable before using.
#
# Example:
# /etc/rc.d/rc.samba stop
#
/home/guest/savedatspaceck.sh
-
- Contributor
- Posts: 1955
- Joined: 09 Aug 2013, 14:25
- Distribution: Nemesis Cinnamon 64
- Location: USA
Re: Save.dat / changes confusion
This is your. And you just added to the end of the line?
I could put mind in the same place./home/guest/savedatspaceck.sh
I just like Slackware because I think it teach you about Linux to build packages where Ubuntu is like Windows you just install programs you want.
- Ed_P
- Contributor
- Posts: 8908
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Re: Save.dat / changes confusion
Yup.Jack wrote:This is your. And you just added to the end of the line?
Yup.I could put mind in the same place.
But you have to be root to do it.
- brokenman
- Site Admin
- Posts: 6105
- Joined: 27 Dec 2010, 03:50
- Distribution: Porteus v4 all desktops
- Location: Brazil
Re: Save.dat / changes confusion
save.dat file 33% full. Used: 164M Free: 346M
There is something wrong with the math here.
Thank you. I am honored you would consider an idea of mine.
The idea was introduced many years ago, but sat on the backburner. Thanks for bringing it back up, and thanks for the legwork Bogomips. If time permits I will try to incorporate it into the shutdown. Perhaps if the container is not big enough an offer could be made to create a module on a real file system instead.
There is something wrong with the math here.
Thank you. I am honored you would consider an idea of mine.
The idea was introduced many years ago, but sat on the backburner. Thanks for bringing it back up, and thanks for the legwork Bogomips. If time permits I will try to incorporate it into the shutdown. Perhaps if the container is not big enough an offer could be made to create a module on a real file system instead.
How do i become super user?
Wear your underpants on the outside and put on a cape.
Wear your underpants on the outside and put on a cape.
- Ed_P
- Contributor
- Posts: 8908
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Re: Save.dat / changes confusion
Not by much.brokenman wrote:save.dat file 33% full. Used: 164M Free: 346M
There is something wrong with the math here.
164 / (164 + 346) = 164 / 510 = 0.321568
And the numbers are from Porteus's df command not calculated by a script.
Yes. Thank you. Or offer to stop the shutdown and let the user decide how to proceed.Perhaps if the container is not big enough an offer could be made to create a module on a real file systemr instead.
I was considering adding a 15 second delay to the warning to allow the user time to consider a plan of action.
-
- Full of knowledge
- Posts: 2564
- Joined: 25 Jun 2014, 15:21
- Distribution: 3.2.2 Cinnamon & KDE5
- Location: London
Re: Save.dat / changes confusion
Another approach could be to change the way the save.dat file is created, as illustrated thru dabblings with container file http://forum.porteus.org/viewtopic.php? ... 800#p47800. In the example the amount of free and used space is always ascertainable offline.brokenman wrote:If time permits I will try to incorporate it into the shutdown.
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
- Ed_P
- Contributor
- Posts: 8908
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Re: Save.dat / changes confusion
Pardon me but that approach is something the user has to run manually and it may not be done when most needed, when shutting down.Bogomips wrote:Another approach could be to change the way the save.dat file is created, as illustrated thru dabblings with container file http://forum.porteus.org/viewtopic.php? ... 800#p47800. In the example the amount of free and used space is always ascertainable offline.
I've used this script for a few years now to manually check my save.dat space files both online and offline. And it works for versions 3.0, 3.1 and 3.2 rc3, 4 & 5. But it only works if you remember to use it.
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 be used (Always Fresh mode)
# nor modsavedat/porteussave.dat.xzm!!
BOOTDEV=`grep -A1 "Booting" /var/log/porteus-livedbg|tail -n1|sed 's^//^/^g'`
if [ "$BOOTDEV" == "/mnt/isoloop" ]; then
BOOTDEV=`grep -A1 "ISO=" /var/log/porteus-livedbg`
BOOTDEV=${BOOTDEV:4:9}
fi
VERSION=$(cat /etc/porteus-version)
FOLDER=porteus${VERSION:9:3}
GUEST="$BOOTDEV/$FOLDER/Guest"
MODULES="$BOOTDEV/$FOLDER/Modules"
# 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 [ "$1" == "" ]; then
if [ -a /mnt/live/memory/images/changes ]; then
SPACEDATDIR=/mnt/live/memory/images/changes
else
echo mloop $BOOTDEV/$FOLDER/changes/porteussave.dat
mloop $BOOTDEV/$FOLDER/changes/porteussave.dat
SPACEDATDIR=/mnt/loop
fi
else
echo mloop $1
mloop $1
SPACEDATDIR=/mnt/loop
fi
if [ ! -d ${SPACEDATDIR}/home ]; then
echo " Error!! "
dmesg | tail > t
UUIDck=$(grep -A1 "duplicate UUID" t)
if [ ! "$UUIDck" == "" ]; then
echo
echo " * This is NOT Always Fresh mode. * "
echo
else
echo
echo "dmesg | tail "
dmesg | tail
fi
rm t
uloop
exit
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
if [ -d "${SPACEDATDIR}/home/guest/.PlayOnLinux" ]; then
du -sh ${SPACEDATDIR}/home/guest/.PlayOnLinux
fi
du -sh ${SPACEDATDIR}/home/guest/.wine
echo
echo Press Enter for more details, Ctrl+C to end.
read
du -sh ${SPACEDATDIR}/etc/usm
echo ls ${SPACEDATDIR}/etc/usm
ls ${SPACEDATDIR}/etc/usm
#cat ${SPACEDATDIR}/etc/usm/usm.conf
echo
du -sh ${SPACEDATDIR}/var/log
du -sh ${SPACEDATDIR}/var/usm
du -h ${SPACEDATDIR}/var/usm/*
echo
du -sh ${SPACEDATDIR}/home/guest/Downloads
du -sh ${SPACEDATDIR}/home/guest/Desktop
du -h ${SPACEDATDIR}/home/guest/Backups
echo
echo ls -s ${SPACEDATDIR}/home/guest/Backups/FireFox
ls -s ${SPACEDATDIR}/home/guest/Backups/FireFox
echo
du -h ${SPACEDATDIR}/*|grep '[0-9][0-9]M'
if [ -a /mnt/live/memory/images/changes ]; then
echo
echo "For more info use:"
echo " du -h /mnt/live/memory/images/changes/home/guest*"
echo " du -h /mnt/live/memory/images/changes/home/*" and
echo " du -h /mnt/live/memory/images/changes/*|grep '[0-9][0-9]M'"
else
uloop
fi