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
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. Downloading 5 videos, and being taken by the hand by the shutdown script could be seen as an added luxury.
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: 8374
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Re: Save.dat / changes confusion
Helping a user of your system to not loose all their files could hardly be called a luxury. Do you consider security updates a luxury? Driver support for new hardware? Obviously we disagree. But I now have a system that will help me so it's a moot point.Bogomips wrote: luxury.
Ed
-
- Full of knowledge
- Posts: 2564
- Joined: 25 Jun 2014, 15:21
- Distribution: 3.2.2 Cinnamon & KDE5
- Location: London
Re: Save.dat / changes confusion
It's all a matter of relativity. Looking at it from the point of view of the mountain of work facing brokenman to get out this release all shipshape, there are more essential issues to be resolved like the blueing out of the cinnamon screen, vlc crashing cinnamon, etc.
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
- brokenman
- Site Admin
- Posts: 6105
- Joined: 27 Dec 2010, 03:50
- Distribution: Porteus v4 all desktops
- Location: Brazil
Re: Save.dat / changes confusion
I understand the point being made here. Porteus has gone without a save.dat space checker until now. It can continue a little longer until more pressing issues are ironed out. It is on my TODO list which has a priority order. I think the word luxury here meant that once the house is built firmly we can add the luxuries.
Thanks for the valuable input here guys.
Thanks for the valuable input here guys.
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: 8374
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Re: Save.dat / changes confusion
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.
Last edited by Ed_P on 10 Aug 2016, 01:36, edited 1 time in total.
Ed
- brokenman
- Site Admin
- Posts: 6105
- Joined: 27 Dec 2010, 03:50
- Distribution: Porteus v4 all desktops
- Location: Brazil
Re: Save.dat / changes confusion
As an example
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.
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.
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: 8374
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Re: Save.dat / changes confusion
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
-
- Full of knowledge
- Posts: 2564
- Joined: 25 Jun 2014, 15:21
- Distribution: 3.2.2 Cinnamon & KDE5
- Location: London
Re: Save.dat / changes confusion
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. 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 $"
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: 8374
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Re: Save.dat / changes confusion
We are talking apples & oranges imo. Space concerns for the standard porteus save.dat file verses space usage of non-standard porteus files that can used as save.dat. yes?
Ed
- Ed_P
- Contributor
- Posts: 8374
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Re: Save.dat / changes confusion
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
-
- Full of knowledge
- Posts: 2564
- Joined: 25 Jun 2014, 15:21
- Distribution: 3.2.2 Cinnamon & KDE5
- Location: London
Re: Save.dat / changes confusion
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. Anyway it is there for anyone to try. 8)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 $"
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
-
- Contributor
- Posts: 1857
- Joined: 09 Aug 2013, 14:25
- Distribution: Porteus and Nemesis
- Location: USA
Re: Save.dat / changes confusion
I try it and here it output. What do I need to do?
Here is the file I made mksavfile.sh and the code I use.
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 $"
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: 8374
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Re: Save.dat / changes confusion
An initialized save.dat file created by the Porteus Savefile Manager. Unused at this point.
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
-
- Full of knowledge
- Posts: 2564
- Joined: 25 Jun 2014, 15:21
- Distribution: 3.2.2 Cinnamon & KDE5
- Location: London
Re: Save.dat / changes confusion
The Difference:
@Jack
Thanks for helping out. You are helping debug our scripts, and you are doing nothing wrong! The function works, but don't know why script is not functioning. There could be a character hidden somewhere which is gumming up the works! Will try and correct it.
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! The function works, but don't know why script is not functioning. There could be a character hidden somewhere which is gumming up the works! Will try and correct it.
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: 8374
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Re: Save.dat / changes confusion
The single quote character at the end the cause of the error?Bogomips wrote:Code: Select all
savefile $"
Ed