How to save the 'boot to ram' option?

New to Puppy and have questions? Start here

Moderator: Forum moderators

Post Reply
justtox
Posts: 2
Joined: Wed Jan 27, 2021 10:21 am
Has thanked: 1 time
Been thanked: 1 time

How to save the 'boot to ram' option?

Post by justtox »

Hi guys,
my name is Thomas. I need your help in order to understand better how Puppy works. I would like to boot puppy entirely on ram (in order to remove the usb stick) by means of boot to ram or copy to ram boot settings, but I need to save a session in order to make the modification I need to perform my programs. I cant understand how to load on ram the modification since the boot to ram mode doesnt work with pup save files and the copy to ram mode doesnt allow me to eject the usb.
With the copy to ram mode I managed only to unmount the usb using:
- sudo umount /dev/sdb1 -l
but I use the eject command:
- sudo eject /dev/sdb1
things start to not work.
How can I save a session to use after with this two modes? I think that on copy to ram mode I can write a script in order to copy all the files I need to ram through this steps:
- Mounting the partition at boot;
- Creating a tmpfs partition on ram;
- Coping all the files I need;
- Change the .jmwrc file with the modified one;
- Unmounting the partition.

Thank you

User avatar
puddlemoon
Posts: 189
Joined: Sun Sep 06, 2020 9:26 pm
Location: In between
Has thanked: 89 times
Been thanked: 64 times

Re: Pup save and boot to ram

Post by puddlemoon »

HI Thomas, welcome puppy. :)
so the simplest way to achieve what you are after is to do a "remaster". This will incorporate the changes you've made into a new puppy.sfs and custom puppy.iso. You can then replace your puppy.sfs on your current install, with the newly created one without having to reinstall. You can also use the .iso to create more bootable usbs of your custom puppy, for sharing or portability.

There is a applet to help you through the remaster process in menu >> setup.
So just boot with the save loaded, run the script, follow the prompts (takes a few minutes) and enjoy your custom puppy.iso...

User avatar
mikeslr
Posts: 2858
Joined: Mon Jul 13, 2020 11:08 pm
Has thanked: 173 times
Been thanked: 869 times

Re: Pup save and boot to ram

Post by mikeslr »

Hi justtox and welcome to the Kennels, :thumbup:

There's an easier-(less error prone) alternative to remastering. First you create a SaveFile or SaveFolder, and install nicOS-Utility-Suite, viewtopic.php?f=106&t=1694. One of its components is Save2SFS. What that does is convert your SaveFile/Folder into either an adrv or a ydrv which will automatically be used on bootup. See the discussion beginning here about its usage including discontinuing the use of the SaveFile/Folder, viewtopic.php?p=7761#p7761 paying particular attention to william2's post here, viewtopic.php?p=7791#p7791 and the qualification "if there is sufficient RAM".

Frankly, except for puli, viewtopic.php?p=2555#p2555 and EasyOS, viewtopic.php?f=63&t=1730 I don't think any Puppy is structured so that after bootup from a USB-Stick you can unplug the Stick. However, if you have sufficient RAM, the following boot argument may still work:

When grub4dos is use to write a boot-loader to a USB-Key, it automatically writes a menu.lst with a "kernel" line such as the following:
kernel /bionic64/vmlinuz pmedia=usbflash psubdir=bionic64 pfix=fsck

Translating that to Human-speak, it says 'You are to use the kernel (vmlinuz) located in the /bionic64 folder which (pmedia=usbflash) you'll find on the usbflash drive, emphasizing 'look in the sub-directory named 'bionic64' and do a check (fsck) of the medium's integrity.

You can open menu.lst in a text editor and add or change the pfix='s argument to 'compel' puppy to copy all the files in the Puppy_Version_Number.sfs into RAM by editing the kernel line to read something like:
kernel /bionic64/vmlinuz pmedia=usbflash psubdir=bionic64 pfix=copy

or kernel... pfix=copy,fsck

Boot-loaders other than grub4dos don't use a menu.lst. They have instead a config file which calls the desired kernel (vmlinuz) with a line beginning with the word linux. AFAIK, these will also respond to the 'copy' argument. So, an example might be:
}
menuentry "Start Bionicpup64" {
...
linux /bionic64/vmlinuz pmedia=usbflash psubdir=bionic64 pfix=copy
...

At least, that's the theory. I can't tell you from experience when or whether the copy argument works, except to again stress that a significant factor may be how much RAM your system has. If your Puppy's Puppy_Version_Number.sfs is 400 Mb, and your SaveFile is 1500 Mbs --even ignoring the other system files and any application SFS-- the 'copy' argument will be telling Puppy to copy 1900 Mbs into RAM.
}

justtox
Posts: 2
Joined: Wed Jan 27, 2021 10:21 am
Has thanked: 1 time
Been thanked: 1 time

Re: How to save the 'boot to ram' option?

Post by justtox »

Thank you so much guys!
I managed how to do it and I would like to explain for a future me that spent about two week to learn how to do it.
This was tested on bionicpup64_8.0 but as soon as you install nicOS-Utility-Suite you can do it, I guess (that needs to be a standard default package for every puppy linux installation for what it can do). Also I use grub4dos and a frugal install through the bionic installer made onto a usb stick.
Start the os in ram mode and create a session as you want. Next use the nicOS-Utility to create a new ydrv. Select RAMDISK and ydrv if you need to save modification on all the os. Substitute the ydrv file generated with the one inside your usb.
At next boot a persistence in ram will be created and the usb stick can be uplugged as soon as you see the desktop environment. Now I can load in ram an entire os with my custom modification with 1.1GB.

User avatar
mikeslr
Posts: 2858
Joined: Mon Jul 13, 2020 11:08 pm
Has thanked: 173 times
Been thanked: 869 times

Re: How to save the 'boot to ram' option?

Post by mikeslr »

Thanks for posting the successful recipe. :thumbup: Like many 'old-timers' I sometimes have an idea which 'might work' or 'should work'. But Murphy's Law always being a factor, posts which tell us 'this did work' enable us to uncross our fingers and exhale. :)

Clarity
Posts: 3454
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1420 times
Been thanked: 456 times

Re: How to save the 'boot to ram' option?

Post by Clarity »

Hello @justbox

The methods mentioned above are accurate in how they accomplish managing the saving of your session data for the PUP being booted.

History: In 2020, the PUP builders (WoofCE) began addressing a way to boot on any platform, be that an old platform using BIOS or the PCs which come with UEFI instead. That method they settle upon is a combination GRUB2+EFI to take care of booting on either platform. There is enormous benefit to their doing this: namely worldwide development and support of those elements in booting. This bit of history has NOTHING to do with your question, YET, it lays a foundation of what is to follow because their efforts enabled the following.

I use a method which is simple to me. The PRIMARY reason it is simple is because I keep both my boot ISOs in one folder and my all my saves for each ISO in a separate folder.

On my HDD, I have

  • /boot-isos for every ISO I download

  • /Sessions where sessions are saved and access from when booting and ISO file

So let's assume you place some 2020-2021 PUP/DOG ISO files in "/boot-isos".

tree.jpg
tree.jpg (6.22 KiB) Viewed 939 times

With that understanding, this is how I accomplish the objective you ask about: There is 1 single (only one-time, ever) thing I do with a USB.
I get a 15MB bootable distro from here and burn it to a USB: This USB, now, will find all ISOs in /boot-isos allowing me to select which ISO I want to boot. I can even remove the USB at desktop, as, it is only used to find and present your ISOs for booting..

AT the PUP's boot menu, I hit "e" to edit the boot menu item, adding

Code: Select all

linux /vmlinuz ... PSAVE=sdXn:/Sessions/

to the linux-line and hit F10 to start the PUP boot. (sdX, as you know is whichever partition you have your /Session on. So if it on 1st PC drive-partition, its "sda1" or "sda2" or wherever you have your /Sessions saved.)

Use your PUP as you would normal, making any changes you desire. At 1st shutdown, you will be asked if you want to save. If so, your work efforts will be saved automatically in /Sessions.

On reboot, do the same thing as above; namely boot the USB, it finds your ISOs, select your choice, edit the PUP boot linux line adding psave, and away you go.

The key to answering your question is the "PSAVE=" bootparm IMHO.

P.S. A document for FossaPUP64 using this method is here

Post Reply

Return to “Beginners Help”