You are not logged in.

#1 2018-04-01 03:41

MichaelBlucher
Member
Registered: 2018-04-01
Posts: 9

Q4OS USB with persistence?

Hi

Creating a Q4OS USB seems to be quite easy, however how do you setup the USB with Persistence?

Is there a simple way to set up Persistence on a Q4OS USB?

Please assume I have minimal knowledge of Linux

Michael B.

Offline

#2 2018-04-01 09:30

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 4,222
Website

Re: Q4OS USB with persistence?

You would need to remaster Q4OS live-cd, see https://www.q4os.org/forum/viewtopic.php?id=1214 . In addition, you need to understand how to add a persistence to a Debian live media as described here:
https://debian-live.alioth.debian.org/l … al.en.html
https://debian-live.alioth.debian.org/l … n.html#556

Unfortunately, there is no simple procedure available, as it requires a higher level of the Linux/Debian knowledge.

Offline

#3 2018-04-02 03:07

MichaelBlucher
Member
Registered: 2018-04-01
Posts: 9

Re: Q4OS USB with persistence?

Hi

This is not going to be so easy as I'd like.  My main problem is my keyboard is badly mapped.
I can't access any of the shift keys and my function keys are inverted, so typing any command line instructions is a problem.
I simply can't use certain keys. Even after I gone through and changed the keyboard parameters to suit my keyboard.
One of the reasons I need persistence.

I already have a "persistence" partition setup, but booting with "live persistence" does not seem to pick it up.

Regards

Michael

Offline

#4 2018-04-02 06:12

bin
Member
From: U.K.
Registered: 2016-01-28
Posts: 1,295

Re: Q4OS USB with persistence?

You say your keyboard is badly mapped - if you're using a laptop then watch out for num lock which defaults to ON in Q4OS

If that does not resolve it then please provide more information about your machine and we'll see what we can do to sort smile

If you are able to get on to internet with it then please do

sudo apt-get install inxi

then

inxi -F

use mouse to copy output and paste back here please.

Offline

#5 2018-04-02 12:25

MichaelBlucher
Member
Registered: 2018-04-01
Posts: 9

Re: Q4OS USB with persistence?

Hi Bin

Yes, I'm using a laptop, its an old Acer aspire one.   I'll give those instructions a try once I've sorted out the persistence issue.
Until that's sorted, anything I change under Q4OS Live will not stick.

I'm using the same laptop with Knoppix 8.1 installed to try and alter the iso image using the information provided earlier.
https://www.q4os.org/forum/viewtopic.php?id=1214

This enables me to edit this ISO and rebuild it. However, the instructions don't seem to create a bootable ISO.
When I copy the resultant ISO to the USB it is not bootable.

The base instructions below seem to be missing something:
----------------------------------------------------------------------------------------------------------------------------------------------------
$ XORRISO_OPTIONS="-R -r -J -joliet-long -l -cache-inodes -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin -partition_offset 16 -A "Q4OS Live" -p "" -publisher "" -V "Q4OS" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table"
$ sudo xorriso -as mkisofs "$XORRISO_OPTIONS" -o output_file.iso dir_structure
----------------------------------------------------------------------------------------------------------------------------------------------------

How do I alter the base above to incorporate creation of a bootable ISO?

Regards
Michael.

Offline

#6 2018-04-02 13:05

MichaelBlucher
Member
Registered: 2018-04-01
Posts: 9

Re: Q4OS USB with persistence?

Hi Bin

i'll keep this short.  typing on a shitty keyboard mapping is a pain.
The information from the command you provided is below. Very useful that, its a keeper.
---------------------------------------------------------------------------------------------------------------------------------

System:    Host: debian Kernel: 4.9.0-6-686-pae i686 (32 bit)
           Desktop: KDE Plasma 3 Distro: Debian GNU/Linux 9 (stretch)
Machine:   Device: other-vm? System: Acer product: Aspire One 753 v: V1.24
           Mobo: Intel model: JV10_CS BIOS: INSYDE v: V1.24 date: 05/06/2011
Battery    BAT0: charge: 44.9 Wh 97.4% condition: 46.1/58.0 Wh (79%)
CPU:       Dual core Intel Celeron U3600 (-MCP-) cache: 2048 KB
           clock speeds: max: 1199 MHz 1: 799 MHz 2: 933 MHz
Graphics:  Card: Intel Core Processor Integrated Graphics Controller
           Display Server: X.Org 1.19.2 drivers: modesetting (unloaded: fbdev,vesa)
           Resolution: 1366x768@60.00hz
           GLX Renderer: Mesa DRI Intel Ironlake Mobile x86/MMX/SSE2
           GLX Version: 2.1 Mesa 13.0.6
Audio:     Card Intel 5 Series/3400 Series High Definition Audio
           driver: snd_hda_intel
           Sound: Advanced Linux Sound Architecture v: k4.9.0-6-686-pae
Network:   Card-1: Qualcomm Atheros AR8151 v2.0 Gigabit Ethernet
           driver: atl1c
           IF: enp1s0 state: down mac: 20:6a:8a:64:f3:1a
           Card-2: Intel Centrino Advanced-N 6205 [Taylor Peak]
           driver: iwlwifi
           IF: wlp2s0 state: up mac: 08:11:96:c4:f9:44
Drives:    HDD Total Size: NA (-)
           ID-1: /dev/sda model: TOSHIBA_MK3265GS size: 320.1GB
           ID-2: USB /dev/sdb model: TransMemory size: 7.8GB
Partition: ID-1: / size: 878M used: 241M (28%) fs: overlay dev: N/A
Sensors:   System Temperatures: cpu: 56.0C mobo: 42.0C
           Fan Speeds (in rpm): cpu: N/A
Info:      Processes: 140 Uptime: 10 min Memory: 273.4/1756.0MB
           Client: Shell (bash) inxi: 2.3.5

---------------------------------------------------------------------------------------------------------------------------------

Thanks
michael
p.s.
This is from /var/log/live/boot.log 
Note; my persistence partition is on /dev/sdb
adminq@debian:/var/log/live$ cat boot.log
mount: mounting /dev/sda2 on /live/persistence/sda2 failed: No such device
mount: mounting /dev/sda on /live/persistence/sda failed: No such device
mount: mounting /dev/sdb2 on /live/persistence/sdb2 failed: Device or resource busy
mount: mounting /dev/sdb1 on /live/persistence/sdb1 failed: Device or resource busy
/init: line 230: can't open /tmp/custom_mounts.list: no such file

Offline

#7 2018-04-03 06:12

bin
Member
From: U.K.
Registered: 2016-01-28
Posts: 1,295

Re: Q4OS USB with persistence?

Hmmm.....OK lets assume that you've booted from a USB key and that you've got the system live and connected to the net.

Next open Konsole and

 sudo kcmodules --unlock

Then go through the Control Panel to Regional and Accesibilty>Keyboard Layout
Click the Keyboard Model drop down and go to Acer Laptop.

I don't know what country you're in. If it is UK then it may also help to install the UK English support files

sudo apt-get install tde-i18n-engb-trinity

You need to logout and back in again. There is no password for the default q4 user whose name you get from the command prompt before you log out.

I know it sounds silly but I'd also look at the Orion release which was Debian Jessie

https://sourceforge.net/projects/q4os/files/oldstable/q4os-live-1.8.8-i686pae.iso

to see if it does better. I recall using linux on an Acer of 2003 vintage and there being something to do with Acer WMI but it was a long long time ago.

Sorry - but as regards the ISO the only suggestion I have is to install Systemback which will create a bootable ISO - there is I think one folder the Q4OS installation creates in / which is non standard and therefore you'd have to add by hand. Not sure if it works with Stretch - sorry but my 2006 Dell won't work properly with Debian 9.

Offline

#8 2018-04-03 08:46

MichaelBlucher
Member
Registered: 2018-04-01
Posts: 9

Re: Q4OS USB with persistence?

Hi Bin

That works.  The key board works fine after that.
Note: I am in Australia by the way.

All I need now is to solve the issue of persistence. And of course how to re-build the ISO as bootable.

Thanks again

Michael B.

Offline

#9 2018-04-03 09:15

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,989

Re: Q4OS USB with persistence?

MichaelBlucher wrote:

I'm using the same laptop with Knoppix 8.1 installed to try and alter the iso image using the information provided earlier.
https://www.q4os.org/forum/viewtopic.php?id=1214

This enables me to edit this ISO and rebuild it. However, the instructions don't seem to create a bootable ISO.
When I copy the resultant ISO to the USB it is not bootable.

The base instructions below seem to be missing something:
----------------------------------------------------------------------------------------------------------------------------------------------------
$ XORRISO_OPTIONS="-R -r -J -joliet-long -l -cache-inodes -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin -partition_offset 16 -A "Q4OS Live" -p "" -publisher "" -V "Q4OS" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table"
$ sudo xorriso -as mkisofs "$XORRISO_OPTIONS" -o output_file.iso dir_structure
----------------------------------------------------------------------------------------------------------------------------------------------------

How do I alter the base above to incorporate creation of a bootable ISO?

Regards
Michael.

Hi Michael, I have created a bootable image using the method in the post you linked, but I did have to jump through a few hoops before I got there,

Firstly you will need to make sure you have set your environment correctly with the correct mounts made to the system directories,

Secondly I used a Q4OS installation to do this and don't know if Knoppix may have different file structures for needed files.

I will have another go at creating a bootable image tonight when I am free as I haven't done this in a while and don't recall the exact process I used originally, I will post here if I find some missing important steps. And just to note I will be using Q4OS installation again as I don't have knoppix available to test at the moment but if I get everything working I will try it with knoppix in a VM afterwards.

Offline

#10 2018-04-03 10:44

MichaelBlucher
Member
Registered: 2018-04-01
Posts: 9

Re: Q4OS USB with persistence?

Hi Dai_Trying

I've downloaded the Q4OS install ISO in a sub-folder within my home folder in Knoppix and deconstructed it.
So I'm using the Q4OS file structure.

The command to bind the data back into an ISO file appears to lack the commands to make said ISO bootable.
If some-one out there knows the missing commands that need to be added that would help.

Regards

Michael.

Offline

#11 2018-04-03 12:35

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,989

Re: Q4OS USB with persistence?

I found my original cheat sheet, this was used with the Orion iso image but should give you an idea of what I had to do. I have not had a chance to check the instructions will work with Scorpion but I should have time tonight to test it.
HTH

sudo apt-get install bsdtar 
sudo apt-get install isolinux 
sudo apt-get install squashfs-tools
sudo apt-get install syslinux
sudo apt-get install syslinux-utils 
sudo apt-get install xorriso 

sudo mkdir my_temp_dir
cd my_temp_dir/
sudo bsdtar xfp ~/Documents/q4os-live-1.8.1-x64.iso 
sudo unsquashfs -d some_work_dir/ live/filesystem.squashfs 

sudo mount --bind /dev ~/my_temp_dir/some_work_dir/dev
sudo mount --bind /dev/pts ~/my_temp_dir/some_work_dir/dev/pts
sudo mount --bind /proc ~/my_temp_dir/some_work_dir/proc
sudo mount --bind /sys ~/my_temp_dir/some_work_dir/sys
sudo mount --bind /etc ~/my_temp_dir/some_work_dir/etc

sudo chroot some_work_dir/
apt-get update
apt-get install virtualbox-guest-dkms virtualbox-guest-x11 virtualbox-guest-utils
exit

sudo umount ~/my_temp_dir/some_work_dir/dev/pts
sudo umount ~/my_temp_dir/some_work_dir/dev
sudo umount ~/my_temp_dir/some_work_dir/sys/
sudo umount ~/my_temp_dir/some_work_dir/proc
sudo umount ~/my_temp_dir/some_work_dir/etc/

sudo mksquashfs some_work_dir filesystem.squashfs -comp xz -b 262144
sudo mv ~/my_temp_dir/some_work_dir/filesystem.squashfs ~/my_temp_dir/live/filesystem.squashfs 
sudo chmod -w ~/my_temp_dir/live/filesystem.squashfs 
sudo mv some_work_dir/ ../
sudo xorriso -as mkisofs -R -r -J -joliet-long -l -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin -partition_offset 16 -A "Q4os Live" -publisher "Dai Trying" -V "Q4OS 1.8.1 Orion" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o ~/output_file.iso ~/my_temp_dir

############################################################################################################################################


In general, you will need to proceed following steps:

- extract iso file:
$ sudo bsdtar xfp input_file.iso

- extract squashed filesystem:
$ sudo unsquashfs -d /some_work_dir/ filesystem.squashfs

- chroot into filesystem and install needed packages:
$ sudo chroot /some_work_dir
# apt-get update
# apt-get install virtualbox-guest-dkms virtualbox-guest-x11 virtualbox-guest-utils and-other-required-packages
# exit

- create new squashfs filesystem:
$ sudo mksquashfs /some_work_dir filesystem.squashfs -comp xz -b 262144

- replace old 'filesystem.squashfs' with the created one
- create iso file:
$ XORRISO_OPTIONS="-R -r -J -joliet-long -l -cache-inodes -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin -partition_offset 16 -A "Q4OS Live" -p "" -publisher "" -V "Q4OS 1.8.1 Orion" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table"
$ sudo xorriso -as mkisofs $XORRISO_OPTIONS -o output_file.iso dir_structure
modify XORRISO_OPTIONS to suite your needs



XORRISO_OPTIONS="
-R
-r
-J
-joliet-long
-l
-cache-inodes
-isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin
-partition_offset 16
-A "Q4OS Live"
-p ""
-publisher "Dai Trying"
-V "Q4OS 1.8.1 Orion"
-b isolinux/isolinux.bin
-c isolinux/boot.cat
-no-emul-boot
-boot-load-size 4
-boot-info-table"

The first section is what I have done to add virtualbox guest additions to the image, the second part is just general info.

I would imagine it could need some tweaking with a Scorpion image but will find out later. smile

Offline

#12 2018-04-03 12:54

MichaelBlucher
Member
Registered: 2018-04-01
Posts: 9

Re: Q4OS USB with persistence?

Hi Dai_Trying

I'm picking out the code I think will do the trick and adapting to my own little script.
Touch wood it might even work, baring in mind of course that I have no real idea what I'm doing.

I'll let you know the result.

Thanks

Michael B.

Offline

#13 2018-04-03 16:57

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,989

Re: Q4OS USB with persistence?

Ok, I managed to get a few minutes to test this and have a (modified) working image that boots without issue.

these are the exact commands I used :-

sudo apt install bsdtar isolinux squashfs-tools syslinux syslinux-utils xorriso 
sudo mkdir my_temp_dir
cd my_temp_dir/
sudo bsdtar xfp ~/Downloads/q4os-2.4-x64.r8.iso
sudo unsquashfs -d some_work_dir live/filesystem.squashfs
sudo mount --bind /dev/pts/ some_work_dir/dev/pts/
sudo cp /etc/resolv.conf some_work_dir/etc/
sudo chroot some_work_dir/

Then while in the chroot environment I ran these commands :-

mount -t proc /proc /proc
mount -t sysfs /sys /sys
apt update
apt upgrade
exit

Then after leaving the chroot environment i ran the following :-

sudo umount /home/dai/my_temp_dir/some_work_dir/sys
sudo umount /home/dai/my_temp_dir/some_work_dir/proc
sudo umount /home/dai/my_temp_dir/some_work_dir/dev/pts
sudo rm some_work_dir/etc/resolv.conf 
sudo mksquashfs some_work_dir filesystem.squashfs
cd live/
sudo mv ../filesystem.squashfs filesystem.squashfs
cd ..
sudo chmod -w live/filesystem.squashfs
sudo mv some_work_dir/ ../
sudo xorriso -as mkisofs -R -r -J -joliet-long -l -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin -partition_offset 16 -A "Q4os Live" -publisher "Dai Trying" -V "Q4OS 2.4.8 Scorpion" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o ~/output_file.iso ~/my_temp_dir

And I now have a working Live-Cd which has 18 packages updated.

This is only a minimal test and I have not used the image to make an installation although I see no reason it would not work, it boot without issue in MBR mode and also in EFI mode (both tested only in VirtualBox)

I think it is likely that the problems you are having are the same as I originally had (and again had this time) with setting the XORRISO_OPTIONS variable which seems to always give me problems, I resolved it by entering them directly as you can see from my final command. Hopefully you will have better luck with this information to help you.

Just one more thing to say though, I'm not sure this will be able to run with persistence as you want, but if you do get it to work please post here as it would be useful to know. smile

Offline

#14 2018-04-04 06:53

MichaelBlucher
Member
Registered: 2018-04-01
Posts: 9

Re: Q4OS USB with persistence?

Hi Dai_Trying

Last night I used some of your code to modify my script.  It produced a bootable ISO image, that I was able to copy to USB.
The resultant USB was bootable.

The new image now picks up my "persistence" partition as well and I now have persistence.

I'm not sure it's fully functional though. While a lot of my changes seem to "persist", desktop changes are not.

I'll have to experiment some more to see what's going on with that. I'll let you know how it goes.

Thanks again.

Michael B.

Offline

#15 2018-04-04 08:22

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,989

Re: Q4OS USB with persistence?

You're welcome, I'm glad we got it resolved (well mostly...) smile

Offline

#16 2018-04-05 01:32

MichaelBlucher
Member
Registered: 2018-04-01
Posts: 9

Re: Q4OS USB with persistence?

Hi Dai_Trying

Here's the end result.

A bootable USB of Q4OS with persistence, although imperfect.

No matter what I do, I don't seem to be able to get persistence on the user logins desktop.
The problem is NOT tied to the adminq login either.  The problem occurs for other users that I create.

Things to note:
The original Q4OS distro did not copy to USB correctly. It always looked "hinky".
By "hinky", I mean it would have a small boot partition and everything else was "hidden" and not recognized by gparted.
Thus when adding the persistence partition, things would not work.

By unpacking the ISO, "making a few adjustments for my Australia, Melbourne timezone", and repacking the ISO with information kindly provided by yourself, the problem with copying the ISO to USB went away. 
Persistence was also functional, but slightly deficient as described above.

This has been a great learning exercise.  I would make one recommendation to the Q4OS team.

Q4OS already provides an "Install Q4OS" icon/procedure for hared drive install.
It would make sense to add another icon/procedure for USB/sdhc install, i.e. Install "Q4OS to USB". With persistence of course.
With USB/sdhc cards these days being quite large 64Gig, 128Gig etc., having a portable OS on USB/sdhc makes a lot of sense.

Other Linux distributions already do this, i.e PC Linux and Knoppix (Flash Knoppix) for example. 
Many other distributions have other methods of producing live USBs with persistence, using various Windows tools.
Although on them, the persistence is usually limited to 4Gig (there are of course ways around this).

Again thanks for your help.

Michael B.

Last edited by MichaelBlucher (2018-04-05 09:23)

Offline

#17 2018-04-05 15:08

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,989

Re: Q4OS USB with persistence?

I'm wondering if the problems you are seeing with some files not being persistent could be due to permissions, I think the Live image uses an admin user and it might be that some of the files that are needed to be updated might not be owned correctly? Only a bit of a guess but it's where I would start looking, and thank you for posting what you have managed to do so far, it will undoubtedly be useful to know. smile

Offline

#18 2019-06-16 01:41

hitsware
Member
Registered: 2019-05-15
Posts: 31

Re: Q4OS USB with persistence?

What I did was simply install (using live install usb)
to a second usb (as if it were a hard drive)
Presto ! true persistance

Last edited by hitsware (2019-06-16 01:43)

Offline

#19 2021-05-30 19:21

LanceHaverkamp
Member
Registered: 2021-05-23
Posts: 13

Re: Q4OS USB with persistence?

hitsware wrote:

What I did was simply install (using live install usb)
to a second usb (as if it were a hard drive)
Presto ! true persistance


Exactly!  It's easy!  I do it fully encrypted, so if someone steals the flash drive, they can't access it.  It would be a nice addon if we could specify how much of the USB should be used when doing an encrypted install.

Offline

Board footer

Powered by FluxBB