Save.dat / changes confusion
-
- Full of knowledge
- Posts: 2564
- Joined: 25 Jun 2014, 15:21
- Distribution: 3.2.2 Cinnamon & KDE5
- Location: London
Re: Save.dat / changes confusion
Post#31 by Bogomips » 09 Aug 2016, 23:16
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB
Bogomips
- Ed_P
- Contributor
- Posts: 8968
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Re: Save.dat / changes confusion
Post#32 by Ed_P » 09 Aug 2016, 23:49
Bogomips wrote: luxury.


Ed_P
-
- Full of knowledge
- Posts: 2564
- Joined: 25 Jun 2014, 15:21
- Distribution: 3.2.2 Cinnamon & KDE5
- Location: London
Re: Save.dat / changes confusion
Post#33 by Bogomips » 10 Aug 2016, 00:29
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB
Bogomips
- brokenman
- Site Admin
- Posts: 6105
- Joined: 27 Dec 2010, 03:50
- Distribution: Porteus v4 all desktops
- Location: Brazil
Re: Save.dat / changes confusion
Post#34 by brokenman » 10 Aug 2016, 01:05
Thanks for the valuable input here guys.
Wear your underpants on the outside and put on a cape.
brokenman
- Ed_P
- Contributor
- Posts: 8968
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Re: Save.dat / changes confusion
Post#35 by Ed_P » 10 Aug 2016, 01:23
I must be missing something. It's not that easy from what I see using those commands.Bogomips wrote:Point being made is no need to run a script to check up. Just a simple ls -sh / du -h would suffice to check occupancy of file, and makes it easy for user to keep tabs on file.
Code: Select all
guest@porteus:~$ ls -sh /mnt/sda5/porteus3.0/changes/porteussave.dat
512M /mnt/sda5/porteus3.0/changes/porteussave.dat*
guest@porteus:~$ du -h /mnt/sda5/porteus3.0/changes/porteussave.dat
512M /mnt/sda5/porteus3.0/changes/porteussave.dat
guest@porteus:~$ ls -sh /mnt/live/memory/changes
total 0
0 dev/ 0 etc/ 0 home/ 0 mnt/ 0 root/ 0 tmp/ 0 usr/ 0 var/
guest@porteus:~$ du -h /mnt/live/memory/changes
du: cannot read directory ‘/mnt/live/memory/changes/root’: Permission denied
0 /mnt/live/memory/changes/root
0 /mnt/live/memory/changes/tmp/.wine-1000/server-10-12db
0 /mnt/live/memory/changes/tmp/.wine-1000
54M /mnt/live/memory/changes/tmp/google-chrome/Cache
54M /mnt/live/memory/changes/tmp/google-chrome
0 /mnt/live/memory/changes/tmp/.X11-unix
54M /mnt/live/memory/changes/tmp
0 /mnt/live/memory/changes/var/cache/cups/rss
8.0K /mnt/live/memory/changes/var/cache/cups
du: cannot read directory ‘/mnt/live/memory/changes/var/cache/ldconfig’: Permission denied
0 /mnt/live/memory/changes/var/cache/ldconfig
8.0K /mnt/live/memory/changes/var/cache
du: cannot read directory ‘/mnt/live/memory/changes/var/db/sudo’: Permission denied
:
:
:
:
8.0K /mnt/live/memory/changes/home/guest/.config/google-chrome/Default/Local Storage
28K /mnt/live/memory/changes/home/guest/.config/google-chrome/Default/GPUCache
4.5M /mnt/live/memory/changes/home/guest/.config/google-chrome/Default
27M /mnt/live/memory/changes/home/guest/.config/google-chrome
27M /mnt/live/memory/changes/home/guest/.config
43M /mnt/live/memory/changes/home/guest
43M /mnt/live/memory/changes/home
103M /mnt/live/memory/changes
guest@porteus:~$
guest@porteus:~$ ls -sh /mnt/live/memory/images/changes
total 8.0K
4.0K etc/ 0 home/ 0 opt/ 4.0K root/ 0 usr/ 0 var/
guest@porteus:~$
guest@porteus:~$ du -h /mnt/live/memory/images/changes
:
:
:
0 /mnt/live/memory/images/changes/home/guest/.cache/keyring-LI3E4M
0 /mnt/live/memory/images/changes/home/guest/.cache/keyring-ba6wgg
0 /mnt/live/memory/images/changes/home/guest/.cache/keyring-mroWKz
0 /mnt/live/memory/images/changes/home/guest/.cache/keyring-OFnuAT
0 /mnt/live/memory/images/changes/home/guest/.cache/keyring-HpeGzz
0 /mnt/live/memory/images/changes/home/guest/.cache/keyring-XERJ8r
0 /mnt/live/memory/images/changes/home/guest/.cache/keyring-tlE6Yc
0 /mnt/live/memory/images/changes/home/guest/.cache/keyring-NhXdeJ
0 /mnt/live/memory/images/changes/home/guest/.cache/keyring-tBUnvV
0 /mnt/live/memory/images/changes/home/guest/.cache/keyring-rkIcUA
0 /mnt/live/memory/images/changes/home/guest/.cache/keyring-DgKgEP
0
:
:
:
368K /mnt/live/memory/images/changes/home/guest/.local/share/icons/hicolor
368K /mnt/live/memory/images/changes/home/guest/.local/share/icons
8.0K /mnt/live/memory/images/changes/home/guest/.local/share/mime/image
20K /mnt/live/memory/images/changes/home/guest/.local/share/mime/application
4.0K /mnt/live/memory/images/changes/home/guest/.local/share/mime/text
44K /mnt/live/memory/images/changes/home/guest/.local/share/mime/packages
4.0K /mnt/live/memory/images/changes/home/guest/.local/share/mime/message
112K /mnt/live/memory/images/changes/home/guest/.local/share/mime
0 /mnt/live/memory/images/changes/home/guest/.local/share/desktop-directories
0 /mnt/live/memory/images/changes/home/guest/.local/share/Trash/info
0 /mnt/live/memory/images/changes/home/guest/.local/share/Trash/files
0 /mnt/live/memory/images/changes/home/guest/.local/share/Trash
524K /mnt/live/memory/images/changes/home/guest/.local/share
524K /mnt/live/memory/images/changes/home/guest/.local
8.0K /mnt/live/memory/images/changes/home/guest/.config/autostart
4.0K /mnt/live/memory/images/changes/home/guest/.config/lxterminal
4.0K /mnt/live/memory/images/changes/home/guest/.config/keepassx
4.0K /mnt/live/memory/images/changes/home/guest/.config/leafpad
76K /mnt/live/memory/images/changes/home/guest/.config/spacefm
:
:
:
4.0K /mnt/live/memory/images/changes/var/log/packages
du: cannot read directory ‘/mnt/live/memory/images/changes/var/log/setup/tmp’: Permission denied
0 /mnt/live/memory/images/changes/var/log/setup/tmp
0 /mnt/live/memory/images/changes/var/log/setup
4.8M /mnt/live/memory/images/changes/var/log
216K /mnt/live/memory/images/changes/var/usm/slackwarepatches
644K /mnt/live/memory/images/changes/var/usm/ponce
580K /mnt/live/memory/images/changes/var/usm/slacky
1.3M /mnt/live/memory/images/changes/var/usm/slackware
700K /mnt/live/memory/images/changes/var/usm/salix
448K /mnt/live/memory/images/changes/var/usm/alien
9.2M /mnt/live/memory/images/changes/var/usm/slackonly
2.8M /mnt/live/memory/images/changes/var/usm/sbo
224K /mnt/live/memory/images/changes/var/usm/local
16M /mnt/live/memory/images/changes/var/usm
37M /mnt/live/memory/images/changes/var
215M /mnt/live/memory/images/changes
Code: Select all
guest@porteus:~$ savedatspaceck.sh
save.dat file 52% full. Used: 260M Free: 249M
guest@porteus:~$
-update-
brokenman posted while I was composing.
Ed_P
- brokenman
- Site Admin
- Posts: 6105
- Joined: 27 Dec 2010, 03:50
- Distribution: Porteus v4 all desktops
- Location: Brazil
Re: Save.dat / changes confusion
Post#36 by brokenman » 10 Aug 2016, 01:33
ls -sh /mnt/sda5/porteus3.0/changes/porteussave.dat
du -sh /mnt/live/memory/changes
BTW: I would advise when coding arithmetic to work in bytes.
Wear your underpants on the outside and put on a cape.
brokenman
- Ed_P
- Contributor
- Posts: 8968
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Re: Save.dat / changes confusion
Post#37 by Ed_P » 10 Aug 2016, 01:45
Code: Select all
guest@porteus:~$ ls -sh /mnt/sda5/porteus3.0/changes/porteussave.dat
512M /mnt/sda5/porteus3.0/changes/porteussave.dat*
guest@porteus:~$ du -sh /mnt/live/memory/changes
du: cannot read directory ‘/mnt/live/memory/changes/root’: Permission denied
du: cannot read directory ‘/mnt/live/memory/changes/var/cache/ldconfig’: Permission denied
du: cannot read directory ‘/mnt/live/memory/changes/var/db/sudo’: Permission denied
du: cannot read directory ‘/mnt/live/memory/changes/var/spool/cups’: Permission denied
du: cannot read directory ‘/mnt/live/memory/changes/var/run/cups/certs’: Permission denied
du: cannot read directory ‘/mnt/live/memory/changes/etc/cups/ssl’: Permission denied
du: cannot read directory ‘/mnt/live/memory/changes/.wh..wh.orph’: Permission denied
du: cannot read directory ‘/mnt/live/memory/changes/.wh..wh.plnk’: Permission denied
103M /mnt/live/memory/changes
guest@porteus:~$ su
Password:
root@porteus:/home/guest# du -sh /mnt/live/memory/changes
103M /mnt/live/memory/changes
root@porteus:/home/guest#
Ed_P
-
- Full of knowledge
- Posts: 2564
- Joined: 25 Jun 2014, 15:21
- Distribution: 3.2.2 Cinnamon & KDE5
- Location: London
Re: Save.dat / changes confusion
Post#38 by Bogomips » 10 Aug 2016, 12:43
Missing the appropriate file.Ed_P wrote:Bogomips wrote:Point being made is no need to run a script to check up. Just a simple ls -sh / du -h would suffice to check occupancy of file, and makes it easy for user to keep tabs on file.Ed_P wrote:I must be missing something. It's not that easy from what I see using those commands.

No need to rely on the system. Make own save file.

Code: Select all
savefile()
{
dd if=/dev/null of=$1 bs=1M seek=${2:-512}; # Size in MB
ls -lh $1
/sbin/mkfs.xfs -b size=${3:-1024} -l internal $1; # Block Size to Use
file $1
ls -sh $1; du -h $1
mkdir f; sudo mount $1 f
df -h f
du -sh f
sudo umount f
}
savefile $"
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB
Bogomips
- Ed_P
- Contributor
- Posts: 8968
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Re: Save.dat / changes confusion
Post#39 by Ed_P » 10 Aug 2016, 17:17
Ed_P
- Ed_P
- Contributor
- Posts: 8968
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Re: Save.dat / changes confusion
Post#40 by Ed_P » 11 Aug 2016, 03:59
In that the standard Porteus Savefile Manager creates 512 MB files in .xfs format how is this file different?Bogomips wrote:No need to rely on the system. Make own save file.And since we like talking script (no check for filespace or errors, just example for XFS) mksavefile.sh:
Code: Select all
savefile() { dd if=/dev/null of=$1 bs=1M seek=${2:-512}; # Size in MB ls -lh $1 /sbin/mkfs.xfs -b size=${3:-1024} -l internal $1; # Block Size to Use file $1 ls -sh $1; du -h $1 mkdir f; sudo mount $1 f df -h f du -sh f sudo umount f } savefile $"

Ed_P
-
- Full of knowledge
- Posts: 2564
- Joined: 25 Jun 2014, 15:21
- Distribution: 3.2.2 Cinnamon & KDE5
- Location: London
Re: Save.dat / changes confusion
Post#41 by Bogomips » 11 Aug 2016, 11:42
From the limited testing done so far, it looks like it could be different in that it always shows the amount of used space, but you never know until tested in real life situation.Ed_P wrote:Porteus Savefile Manager creates 512 MB files in .xfs format how is this file different?

Code: Select all
#!/bin/bash
# 11.08.2016
# sh mksavfile.sh <[/Path/to/]savefile> [ <Size of file in MB> [ Block size for XFS ] ]
# sh mksavfile.sh savefile.dat
# sh mksavfile.sh MyPort/mysave.dat 256
# sh mksavfile.sh savechanges 400 2048
savefile()
{
dd if=/dev/null of=$1 bs=1M seek=${2:-512}; # Size in MB
ls -lh $1
/sbin/mkfs.xfs -b size=${3:-1024} -l internal $1; # Block Size to Use
file $1
ls -sh $1; du -h $1
mkdir f; sudo mount $1 f
df -h f
du -sh f
sudo umount f
}
savefile $"
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB
Bogomips
-
- Contributor
- Posts: 1955
- Joined: 09 Aug 2013, 14:25
- Distribution: Nemesis Cinnamon 64
- Location: USA
Re: Save.dat / changes confusion
Post#42 by Jack » 11 Aug 2016, 14:36
Code: Select all
root@porteus:/home/guest/Downloads# sh mksavfile.sh savefile.dat
mksavfile.sh: line 19: unexpected EOF while looking for matching `"'
mksavfile.sh: line 20: syntax error: unexpected end of file
root@porteus:/home/guest/Downloads# sh mksavfile.sh savefile.dat 256
mksavfile.sh: line 19: unexpected EOF while looking for matching `"'
mksavfile.sh: line 20: syntax error: unexpected end of file
root@porteus:/home/guest/Downloads#
Code: Select all
#!/bin/bash
# 11.08.2016
# sh mksavfile.sh <[/Path/to/]savefile> [ <Size of file in MB> [ Block size for XFS ] ]
# sh mksavfile.sh savefile.dat
# sh mksavfile.sh MyPort/mysave.dat 256
# sh mksavfile.sh savechanges 400 2048
savefile()
{
dd if=/dev/null of=$1 bs=1M seek=${2:-512}; # Size in MB
ls -lh $1
/sbin/mkfs.xfs -b size=${3:-1024} -l internal $1; # Block Size to Use
file $1
ls -sh $1; du -h $1
mkdir f; sudo mount $1 f
df -h f
du -sh f
sudo umount f
}
savefile $"
Jack
- Ed_P
- Contributor
- Posts: 8968
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Re: Save.dat / changes confusion
Post#43 by Ed_P » 11 Aug 2016, 16:58
Code: Select all
guest@porteus:~$ file -s /mnt/sda5/porteus3.2/porteussave.dat/mnt/sda5/porteus3.2/porteussave.dat: SGI XFS filesystem data (blksz 4096, inosz 512, v2 dirs)
guest@porteus:~$ ls -sh /mnt/sda5/porteus3.2/porteussave.dat
256M /mnt/sda5/porteus3.2/porteussave.dat*
guest@porteus:~$ du -h /mnt/sda5/porteus3.2/porteussave.dat
256M /mnt/sda5/porteus3.2/porteussave.dat
guest@porteus:~$
Ed_P
-
- Full of knowledge
- Posts: 2564
- Joined: 25 Jun 2014, 15:21
- Distribution: 3.2.2 Cinnamon & KDE5
- Location: London
Re: Save.dat / changes confusion
Post#44 by Bogomips » 11 Aug 2016, 19:28
Code: Select all
guest@porteus:~$ savefile /mnt/sda1/tmp/K3B_Space/savedchanges 256 4096
0+0 records in
0+0 records out
0 bytes copied, 0.000484226 s, 0.0 kB/s
-rw-r--r-- 1 guest users 256M Aug 11 21:10 /mnt/sda1/tmp/K3B_Space/savedchanges
meta-data=/mnt/sda1/tmp/K3B_Space/savedchanges isize=512 agcount=4, agsize=16384 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=0
data = bsize=4096 blocks=65536, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal log bsize=4096 blocks=855, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
/mnt/sda1/tmp/K3B_Space/savedchanges: SGI XFS filesystem data (blksz 4096, inosz 512, v2 dirs)
3.9M /mnt/sda1/tmp/K3B_Space/savedchanges
3.9M /mnt/sda1/tmp/K3B_Space/savedchanges
Filesystem Size Used Avail Use% Mounted on
/dev/loop11 253M 13M 240M 6% /home/guest/f
0 f
Thanks for helping out. You are helping debug our scripts, and you are doing nothing wrong!

NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB
Bogomips
- Ed_P
- Contributor
- Posts: 8968
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Re: Save.dat / changes confusion
Post#45 by Ed_P » 11 Aug 2016, 19:53
The single quote character at the end the cause of the error?Bogomips wrote:Code: Select all
savefile $"
Ed_P