PDA

View Full Version : Is this possible?, how?



joselb
03-05-2016, 06:58 PM
I don't know if this is possible or not but I wanted to ask if you can help me:

1.- Booting from cd/dvd
2.- After booting from it, then: Loading from hard drive or pendrive some configurations (network, programs, etc).
3.- When I shutdown the computer only what I want will be saved in this hard drive or pen drive configuration (only browser updates and add-ons updates)

I know I could use a pen drive with persistence, but I don't want my knoppix to be changed in any way when I am using it (to avoid virus, malware or who knows what). That's why I need to boot with cd/dvd and load some minimal configurations.

Ideas?
Thanks a lot.

knp
03-05-2016, 07:25 PM
Hi

Also I am an almost newbie.

I think that the best way to avoid "viruses, malwares etc.." is to work with he Knoppix_CD/DVD...It is intended ESSENTIALLY for this kind of working.

I repeat that I am an almost newbie.

So do'nt worry anymore with my reply...

I hope that some senior members will give a good solution.

Regards

knp

joselb
03-05-2016, 08:00 PM
Thank you for the answer knp, the problem is that I don't want to configure the network, install firefox browser, add-ons, etc... everytime I load Knoppix with the cd/dvd. So, I thought that maybe there is a solution if we can save some configurations in another place and load them when we want.

Capricorny
03-05-2016, 08:11 PM
I don't see why you should have to boot from CD/DVD. Even if you have a persistent image on a USB stick, you can run from the stick without mounting it. Just start with knoppix(64) noimage. You can mount a volume where you have work files, config files etc, read them in and save - just be careful with modifications of browser function. One way is to keep a "pristine" copy of /home/knoppix, and return to that whenever you have a suspicion of something.
The most flexible way of doing this, is updating/installing all software to a persistent image, do all modifications to setup (e.g. auto-mounting data volume(s) ) and then remaster. Running with the remastered image should then give you what(ever) you want.
You can also have several persistent images, and keep them more or less pristine. The simplest is to make a separate Knoppix directory for each of them, though. Then starting with the cheatcode knoppix_dir=....

joselb
03-05-2016, 08:38 PM
That's very interesting Capricorny, but I don't know how to do it, maybe some examples?.
Thanks


I don't see why you should have to boot from CD/DVD. Even if you have a persistent image on a USB stick, you can run from the stick without mounting it. Just start with knoppix(64) noimage. You can mount a volume where you have work files, config files etc, read them in and save - just be careful with modifications of browser function. One way is to keep a "pristine" copy of /home/knoppix, and return to that whenever you have a suspicion of something.
The most flexible way of doing this, is updating/installing all software to a persistent image, do all modifications to setup (e.g. auto-mounting data volume(s) ) and then remaster. Running with the remastered image should then give you what(ever) you want.
You can also have several persistent images, and keep them more or less pristine. The simplest is to make a separate Knoppix directory for each of them, though. Then starting with the cheatcode knoppix_dir=....

joselb
03-05-2016, 08:41 PM
I normally use only a VPN program, network configuration, firefox browser, tor browser and some add-ons. I don't know how can I mount only these configurations once I boot with "noimage", and if some day I update the browser or add-ons then how to save them to mount them in the next reboot.

Capricorny
03-05-2016, 08:47 PM
You simply prepare a USB stick, boot Knoppix from the ISO in some way (for 7.6.1 I used kvm, booted it as a virtual machine, see my posting about that) and run the flash-install utility. Then you can have it set up a persistent image, but whenever you don't want to use it, you use the noimage cheatcode on startup. If you don't do any remastering, you will have to manually issue a command like mount /media/sda3 (if your config files are on /dev/sda3) and copy them to their right place, for example using the rsync -axu command.

Capricorny
03-05-2016, 09:03 PM
Your approach will not allow program updates, but there is a way around that. You should look at posting from user utu, who has worked with (I think a series of) cloop images (overlays to the original KNOPPIX cloop image) created from ramdisk. That way, Knoppix is incrementally modifiable, but still used "read-only". Personally, I find it a hassle to handle the multiple overlays I will soon get with that method, but if you concentrate on doing all modifications in one session, then save that, you may be able to use only one overlay.
For config data, I would think the easiest way to proceed is to have a few copies of /home/knoppix on the USB stick, and save/restore to/from one of them. Then you don't have to do any extra mounting, and you could set up scripts to do the house-keeping tasks for you.

joselb
03-05-2016, 09:11 PM
Thank you very much for those ideas and recommendations Capricorny :)

Capricorny
03-05-2016, 09:54 PM
Good luck! If you find a good solution, I think quite a few of us would like to read about it here :-)

utu
03-06-2016, 12:16 AM
You should look at posting from user utu...
Capricorny refers to this, I think:
http://knoppix.net/forum/threads/30672-Using-Overlay-Updates-in-Knoppix-7-2-LiveUSBs?highlight=persistence
I still use this method, only now I define a similar function in ~/.bashrc,
rather than /etc/profile.

Since Knoppix 7.6.1 initially comes with both KNOPPIX and KNOPPIX1 cloops,
my current unique cloop compacted addition is KNOPPIX2.
I generally don't require more than one additional cloop to capture all
my unique stuff. My KNOPPIX2 is about half the size of Klaus K's KNOPPIX1,
for example.

Operating this way protects me from over-writing that
persistence material which I have converted to cloop form. It does not
protect me from overwriting new persistence material in read-write
reiserfs form.

There still remains an ever-present danger of spoiling by filesystem
corruption, either or both KNOPPIX partitions by inadvertently
removing the LiveUSB without an orderly shut-down. I have no
solution for that and have never been able to resurrect and correct
a filesystem corrupted by improper shutdown.

Re-mastering is conceptually purer, certainly produces a smaller
final cloop collection of material, but requires about twice the
amount of space in which to perform the compaction, and much more
time in which to do what needs to be done. Re-mastering does not
solve the improper shutdown hazard either, unfortunately.

joselb
03-06-2016, 09:18 AM
Thank you both. I will read your thread utu :)

joselb
03-09-2016, 07:28 AM
What I finally did was only to copy KNOPPIX to my hard disk (knoppix tohd=/dev/sda2), it copies all my settings from the pen drive in the hard disk (even persistence). So, in my pen drive I keep all my settings and Knoppix saved but I am not using it anymore, I only need to boot with my pen drive and when I type the persistence password I can remove the pen drive and use KNOPPIX from my hard disk, without the pen drive plugged. When i boot with the pen drive knoppix automatically boots from the hard disk, founding Knoppix in there. If some day I get some problems in this configuration I only need to delete KNOPPIX folder in my hard disk and again from the pen drive: knoppix tohd=/dev/sda2, but from time to time I will update my pen drive booting as: knoppix fromhd=/dev/sdb1

Capricorny
03-13-2016, 01:44 PM
That's a simple way of a Poor Man's Install. You could edit the booting config file to include the parameter alternatives for simpler typing. You could also use more than one Knoppix install on the HD, for example if you want to experiment with different alternatives and don't want to ruin the main working version while experimenting.

joselb
03-13-2016, 07:04 PM
Yes, I changed some parameters to boot. About more than 1 knoppix on the hd, do you mean to change the name KNOPPIX to the folder and if something changes then delete the previous folder and use this one changing the name to KNOPPIX to boot?. As I said, knoppix boots automatically from the hd (searching first in it, not in the pendrive).

Capricorny
03-21-2016, 09:30 PM
If you use syslinux boot, you can edit boot/syslinux/syslinux.cfg, and eventually add more alternatives to suit your needs
The stanza for booting the 64-bits kernel in 7.6.1 is



LABEL knoppix64
KERNEL linux64
APPEND lang=en apm=power-off initrd=minirt.gz nomce libata.force=noncq hpsa.hpsa_allow_any=1 loglevel=1


Here you may add another entry, for example if you have KNOPPIX in a directory KNOPPIX761_0 on /dev/sda1 - using knoppi65-0p at the boot prompt:



LABEL knoppix64-0p
KERNEL linux64
APPEND lang=en apm=power-off initrd=minirt.gz fromhd=/dev/sda1 nosound knoppix_dir=KNOPPIX761_0 nomce libata.force=noncq hpsa.hpsa_allow_any=1 loglevel=1


And the same without persistent image



LABEL knoppix64-0
KERNEL linux64
APPEND lang=en apm=power-off initrd=minirt.gz fromhd=/dev/sda1 noimage nosound knoppix_dir=KNOPPIX761_0 nomce libata.force=noncq hpsa.hpsa_allow_any=1 loglevel=1


I haven't used syslinux for a long time, so there may be some errors here, but you get the idea. I have a version number on the KNOPPIX directories, as there may be several remasterings of a release on the same partition. Furthermore, you may want to patch minirt.gz, for example going over to squashfs instead of cloop. Then you save it under another name, and use that for the initrd boot parameter. Same if you change the kernel.

joselb
03-22-2016, 09:04 AM
Thank you! I have never used syslinux.cfg in that way and now I am wondering why... ;) I will test it asap.

Capricorny
03-24-2016, 11:19 PM
I should add that syslinux isn't limited to booting Knoppix, even if it comes up with Knoppix screen. I just copied kernel and initrd for Debian 8.3 into the syslinux directory, added entry for Debian 8.3, and placed the compressed and persistent images in right places. No problem multi-booting Debian 8.3 and Knoppix. For more routine multiboot use, I prefer legacy grub, though.