Save.dat / changes confusion

Technical issues/questions of an intermediate or advanced nature.
User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Save.dat / changes confusion

Post#1 by Ed_P » 24 Jul 2016, 03:17

:%)

Code: Select all

guest@porteus:~$ df -h  /mnt/live/memory/changes/ 
Filesystem      Size  Used Avail Use% Mounted on
-               1.4G   38M  1.4G   3% /mnt/live/memory/changes
guest@porteus:~$ df -h  /mnt/live/memory/images/changes/
Filesystem      Size  Used Avail Use% Mounted on
-               508M  252M  256M  50% /mnt/live/memory/images/changes
guest@porteus:~$ 
If my 508MB save.dat file has used 252M how is it my /mnt/live/memory/changes/ folder is only 38M?? :o I thought the changes in the save.dat file got loaded into the /mnt/live/memory/changes/ folder when booting and was updated while Porteus was running.
Ed

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3924
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

Re: Save.dat / changes confusion

Post#2 by ncmprhnsbl » 24 Jul 2016, 06:12

/mnt/live/memory/changes/ holds the changes made in the current session, after any /changes folder/.dat/.xzm is loaded...
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

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

Re: Save.dat / changes confusion

Post#3 by Ed_P » 25 Jul 2016, 13:54

Thanks ncmprhnsbl. I was beginning to suspect that. And some of the new changes replace some of the old changes so the 2 numbers added together are not the size of the save.dat used space after a reboot.
Ed

Jack
Contributor
Contributor
Posts: 1857
Joined: 09 Aug 2013, 14:25
Distribution: Porteus and Nemesis
Location: USA

Re: Save.dat / changes confusion

Post#4 by Jack » 06 Aug 2016, 15:27

ED, First off I have never done this I have always use ext4. I was told that you could or might help me.

What I want is to boot up in Alway Fresh mode or Text mode. I have use Porteus save file manager and built a 512MB file. I want to setup Porteus Mate the way I want it and save it. When I setup the porteus.cfg I want both Alway Fresh mode or Text mode to be setup.

The USB is a 32GB and the partition are 4GB fat32 (porteus) and 28GB ext4 (save data).

If anything needs change please tell me and how it can be done.
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.

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

Re: Save.dat / changes confusion

Post#5 by Ed_P » 06 Aug 2016, 18:44

Well Jack the term Always Fresh implies no changes, save.dat or otherwise. So I don't think that's the option you're referring to.

I do indeed use a save.dat file. Two in fact kinda. One I use to save changes I make and the other is a backup copy that I use when the grandkids are here and I don't want them to change anything when they use the netbook. My current save.dat file is 512MB the same as yours and is approx 51% full. I do not store/save large files in my save.dat file, files that would go into the Downloads or Music or Video folders I save outside the /home/guest system on my hard drive or USB drive so 512MB is a lot of space for system type of changes. /home/guest/.config and alike and bookmarks and etc.

To save changes I boot with the changes=EXIT option, which supports saving changes as an option when I shutdown. This way if I screw up my system, and am aware of it, when I shutdown I can choose to not save my changes and reboot the way I was before I screwed up.

My changes= option is on my grub boot menu as such:

Code: Select all

kernel /boot/syslinux/vmlinuz    from=/ISOs/%ISO30% changes=EXIT:/porteus3.0/changes/porteussave.dat extramod=/porteus3.0/Modules volume=40 reboot=cold ramsize=80%
In that my save.dat file is on the same drive as I boot from I don't need to specify a mnt/sda* drive.

If your using the porteus.cfg file the changes= parameter would work the same way.

As I note earlier I have two save.dat files. The second one is named porteussave.dat.xzm and is created with this script:

Code: Select all

#!/bin/sh

# http://forum.porteus.org/viewtopic.php?f=81&t=2866&p=20331#p20292

BDEV=`grep -A1 "Booting" /var/log/porteus-livedbg|tail -n1|sed 's^//^/^g'`
# http://forum.porteus.org/viewtopic.php?f=53&t=3801&start=30#p28472

VERSION=$(cat /etc/porteus-version)
FOLDER=porteus${VERSION:9:3}
MODULES="$BDEV/$FOLDER/Modules"
SAVEDAT="$BDEV/$FOLDER"

DIR () {
#  echo "$1"
#  ls -ghlst --full-time $1 | awk '{print $1 " " $2 " "$6 " " $7 " " $8 " " $9}' | more 
ls -lght --time-style long-iso $1 | awk '{print $5,$6,$4,$7}'
# http://forum.porteus.org/viewtopic.php?f=81&t=3965#p29205
}

DIR "$SAVEDAT/modsavedat/" 
DIR "$SAVEDAT/changes/"
echo 
echo -en "Press Enter to backup .dat to .xzm, Ctrl+C to end.\n"
read answer  
 
echo Pls wait, copying in progress
cp -p $SAVEDAT/changes/porteussave.dat $SAVEDAT/modsavedat/porteussave.dat.xzm
DIR "$SAVEDAT/modsavedat/"  

The key command being the cp one at the bottom which you could do manually in cli mode.

The xzm file is a copy if the dat file and in addition to being a backup it allows me to boot to a nochange safe mode with all my changes. That menu entry looks like this for me:

Code: Select all

kernel /boot/syslinux/vmlinuz    from=/ISOs/%ISO30% extramod=/porteus3.0/Modules;/porteus3.0/modsavedat volume=33 reboot=cold
The key being the extra directory added to the extramod= option, and no changes= option.

BTW The drive with my Porteus systems is configured as:

Code: Select all

porteus#.#
 |
 __ changes
   |
   __ porteussave.dat
 | 
 __ modsavedat
   |
   __ porteussave.dat.xzm
 |
 __ Modules
    |
    __ firefox.xzm
    __ etc
Hope this helps you Jack.
Ed

Jack
Contributor
Contributor
Posts: 1857
Joined: 09 Aug 2013, 14:25
Distribution: Porteus and Nemesis
Location: USA

Re: Save.dat / changes confusion

Post#6 by Jack » 06 Aug 2016, 20:32

For me I want to just setup Porteus Mate, FireFox bookmark and some other stuff. This will be in Text mode. Take look at I did below and if it need's change post any change.

Code: Select all

    LABEL text
    MENU LABEL Text mode
    KERNEL vmlinuz
    APPEND initrd=initrd.xz 3     <- I think this the line I need to use.
    TEXT HELP
    TEXT HELP
        Run Porteus in text mode and
        start the command prompt only
    ENDTEXT
Add this?

Code: Select all

APPEND initrd=initrd.xz  changes=EXIT: /porteus/porteussave.dat 3
I'm going to use a 32GB USB 4GB fat32 or ext4 for Porteus and 28GB ext4 for downloads, document, picture, video and other stuff. Can I use fat32 or ext4 for the first partition too?

If it looks good I will do it.
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.

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

Re: Save.dat / changes confusion

Post#7 by Ed_P » 07 Aug 2016, 00:53

Jack wrote:Add this?

Code: Select all

APPEND initrd=initrd.xz  changes=EXIT: /porteus/porteussave.dat 3
No, add it this way:

Code: Select all

APPEND initrd=initrd.xz  changes=EXIT:/porteus/porteussave.dat 3
No space after EXIT:.
I'm going to use a 32GB USB 4GB fat32 or ext4 for Porteus and 28GB ext4 for downloads, document, picture, video and other stuff. Can I use fat32 or ext4 for the first partition too?
I don't think Porteus supports save.dat files on linus formated drives, I believe it is limited to FAT and NTFS drives. And other than my save.dat file everything is formatted as FAT or NTFS on my drives and Porteus has no problem accessing files on them.
Ed

Jack
Contributor
Contributor
Posts: 1857
Joined: 09 Aug 2013, 14:25
Distribution: Porteus and Nemesis
Location: USA

Re: Save.dat / changes confusion

Post#8 by Jack » 07 Aug 2016, 01:16

Thanks for your help. I will format both partition NTFS and use it that way that way my Windows 7 will be able to write to it. If I have a problem I might be back.
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.

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

Re: Save.dat / changes confusion

Post#9 by Ed_P » 07 Aug 2016, 05:18

For USB drives I recommend FAT & exFAT rather than NTFS. And with Windows it can only see the 1st partition on removable drives. Unless you are going to boot the flash drive on EFI systems I recommend a single FAT partition. If you plan on files larger than 4 GB than use exFAT.
Ed

Jack
Contributor
Contributor
Posts: 1857
Joined: 09 Aug 2013, 14:25
Distribution: Porteus and Nemesis
Location: USA

Re: Save.dat / changes confusion

Post#10 by Jack » 07 Aug 2016, 12:09

I learn a lot from you. Thanks
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.

Jack
Contributor
Contributor
Posts: 1857
Joined: 09 Aug 2013, 14:25
Distribution: Porteus and Nemesis
Location: USA

Re: Save.dat / changes confusion

Post#11 by Jack » 07 Aug 2016, 13:47

I'm using a 4GB USB and going to use another one for save data.

When I try it here is the ERROR I received.

Code: Select all

couldn't find EXIT/porteus/porteussave.dat correct your cheatcode
I use this and it is what you told me. And porteussave.dat is in porteus

Code: Select all

APPEND initrd=initrd.xz  changes=EXIT:/porteus/porteussave.dat 3
Here is a tree view of my sdb1.

Code: Select all

guest@porteus:~$ tree /mnt/sdb1
/mnt/sdb1
├── EFI
│   └── BOOT
│       ├── background.png
│       ├── bootx64.efi
│       ├── drivers_x64
│       │   ├── LICENSE.txt
│       │   ├── LICENSE_GPL.txt
│       │   ├── btrfs_x64.efi
│       │   ├── ext2_x64.efi
│       │   ├── ext4_x64.efi
│       │   ├── hfs_x64.efi
│       │   ├── iso9660_x64.efi
│       │   └── reiserfs_x64.efi
│       ├── icons
│       │   ├── func_about.png
│       │   ├── func_exit.png
│       │   ├── func_firmware.png
│       │   ├── func_reset.png
│       │   ├── func_shutdown.png
│       │   ├── os_arch.png
│       │   ├── os_debian.png
│       │   ├── os_elementary.png
│       │   ├── os_fedora.png
│       │   ├── os_freebsd.png
│       │   ├── os_gentoo.png
│       │   ├── os_linux.png
│       │   ├── os_linuxmint.png
│       │   ├── os_mac.png
│       │   ├── os_pclinuxos.png
│       │   ├── os_porteus.png
│       │   ├── os_slackware.png
│       │   ├── os_ubuntu.png
│       │   ├── os_unknown.png
│       │   ├── os_win.png
│       │   ├── tool_apple_rescue.png
│       │   ├── tool_memtest.png
│       │   ├── tool_mok_tool.png
│       │   ├── tool_part.png
│       │   ├── tool_shell.png
│       │   ├── tool_windows_rescue.png
│       │   ├── transparent.png
│       │   ├── vol_external.icns
│       │   ├── vol_external.png
│       │   ├── vol_internal.icns
│       │   ├── vol_internal.png
│       │   ├── vol_optical.icns
│       │   └── vol_optical.png
│       └── refind.conf
├── USB_INSTALLATION.txt
├── bookmarks-2016-07-24.json
├── boot
│   ├── Porteus-installer-for-Linux.com
│   ├── Porteus-installer-for-Windows.exe
│   ├── docs
│   │   ├── GNU_GPL
│   │   ├── License.txt
│   │   ├── cheatcodes.txt
│   │   ├── install.txt
│   │   └── requirements.txt
│   └── syslinux
│       ├── boot.cat
│       ├── chain.c32
│       ├── extlinux.conf
│       ├── initrd.xz
│       ├── isolinux.bin
│       ├── isolinux.boot
│       ├── isolinux.cfg
│       ├── ldlinux.sys
│       ├── lilo.conf
│       ├── plpbt
│       ├── porteus.cfg
│       ├── porteus.png
│       ├── syslinux.cfg
│       ├── vesamenu.c32
│       └── vmlinuz
└── porteus
    ├── base
    │   ├── 000-kernel.xzm
    │   ├── 001-core.xzm
    │   ├── 002-xorg.xzm
    │   ├── 003-mate.xzm
    │   └── 009-caches.xzm
    ├── make_iso.sh
    ├── modules
    │   ├── flashplayer-plugin-22.0.0.209-x86_64-1.xzm
    │   ├── fprintd-0.4.1-x86_64-bundle.xzm
    │   ├── glabels-3.4.0-x86_64-1_bundle.xzm
    │   ├── guvcview-2.0.4-x86_64-1_bundle.xzm
    │   ├── libreoffice-5.1.4.2-x86_64.xzm
    │   ├── mozilla-firefox-47.0.1-x86_64-1.xzm
    │   ├── tree-1.6.0-x86_64-1.xzm
    │   └── youtube-dl-2016.06.23.1-x86_64-1_bundle.xzm
    ├── optional
    ├── porteus-v3.2-x86_64.sgn
    ├── porteussave.dat
    └── rootcopy
        └── etc
            └── rc.d
                └── rc.bluetooth

14 directories, 87 files
guest@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.

Bogomips
Full of knowledge
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#12 by Bogomips » 07 Aug 2016, 14:03

Jack wrote: When I try it here is the ERROR I received.

Code: Select all

couldn't find EXIT/porteus/porteussave.dat correct your cheatcode
Jack, it thinks it is looking for file EXIT/porteus/porteussave.dat, which you don't have. Need to put this EXIT:/porteus/porteussave.dat..
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

Jack
Contributor
Contributor
Posts: 1857
Joined: 09 Aug 2013, 14:25
Distribution: Porteus and Nemesis
Location: USA

Re: Save.dat / changes confusion

Post#13 by Jack » 07 Aug 2016, 14:10

Bogomips wrote:
Jack wrote: When I try it here is the ERROR I received.

Code: Select all

couldn't find EXIT/porteus/porteussave.dat correct your cheatcode
Jack, it thinks it is looking for file EXIT/porteus/porteussave.dat, which you don't have. Need to put this EXIT:/porteus/porteussave.dat..
I forgot the : I will fix it it and try again. Thanks Bogomips
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.

Jack
Contributor
Contributor
Posts: 1857
Joined: 09 Aug 2013, 14:25
Distribution: Porteus and Nemesis
Location: USA

Re: Save.dat / changes confusion

Post#14 by Jack » 07 Aug 2016, 14:47

It now works. Thanks everyone that help me.

If I don't want to write when power down can I remove EXIT or EXIT: which one? And when I want to save again put it back in?
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.

Bogomips
Full of knowledge
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#15 by Bogomips » 07 Aug 2016, 14:57

Think you need:

Code: Select all

changes=/porteus/porteussave.dat changes-ro
This way you are starting with last changes and then no longer saving changes, if that is what you wish to do.
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

Post Reply