The officially official Devuan Forum!

You are not logged in.

#1 2023-11-01 20:46:48

TeacherFromAustria
Member
Registered: 2023-11-01
Posts: 2  

[SOLVED] Refracta created live system with auto mounted FAT32 partition

Dear Forum Members,
I am new to Devuan and Refracta and a mediocre Linux user so please be patient with me ;-)

Background information:
I am a teacher in an technical school in Austria. The pupils need to sit an 100min long programming (python) exam. Because of budget limitations we don't have school PCs, but the pupils have their own laptops (mostly running windows). To give them a realistic programming environment (instead of pen and paper), we decided on preparing a linux live usb system, which the pupils should boot on their own laptops. I prepared the system in a VM and customized it (offline python doc, severals IDEs, prepared maria DB, no network access, no sudo rights and no mounting of their own hard drives) and made an live iso with the help of the refracta tools.
So far so good, but I have one significant problem ...
At the end of the exam, the pupils should safe their python programs on this or another usb stick and carry it to a windows PC with an printer attached to it, to print their work to paper.
 
My problem:
I masked the udisks2 service on the VM system, such that the pupils (as live users later on) are unable to mount their own hard disks and look for solutions to the exam questions. This means that they can not mount a second usb stick to safe their programs. So I thought it would be good to create a second fat32 partition with a label on the live usb stick and mount it during startup with systemd. I put a line in /etc/fstab on my VM to mount it and created the iso with refracta tools. But the /etc/fstab file on the live system is completely different from the one in my VM.
Is there a way to influence the /etc/fstab for the live system to auto mount the fat32 partition or do you guys know a better way of reaching my goal?

p.s. I know that with refracta2usb it is possible to create persistence, but only with linux file systems, which will not be readable on the windows pc with the printer.

Thank you for your help and please excuse poor my English.
Markus

Offline

#2 2023-11-01 23:41:03

aitor
Member
From: basque country
Registered: 2016-12-03
Posts: 211  
Website

Re: [SOLVED] Refracta created live system with auto mounted FAT32 partition

TeacherFromAustria wrote:

I masked the udisks2 service on the VM system, such that the pupils (as live users later on) are unable to mount their own hard disks and look for solutions to the exam questions.

Why not a program that restores the service with the need of a secret password? You can write it in the blackboard at the end of the exam.


If you work systematically, things will come by itself (Lev D. Landau)

Offline

#3 2023-11-02 14:55:26

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,395  

Re: [SOLVED] Refracta created live system with auto mounted FAT32 partition

You can preserve the /etc/fstab in the source system by commenting out the line for it in /usr/lib/refractasnapshot/snapshot_exclude.list

If that doesn't work for you, there's probably a way to do it with a hook script, which I've used in the past but don't recall how to do it. See the man pages for live-boot and live-config and maybe even the debian-live manual.

Offline

#4 2023-11-02 17:50:55

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,395  

Re: [SOLVED] Refracta created live system with auto mounted FAT32 partition

You might need to add the word 'skipconfig' to the boot command for the live system. It looks like that is an undocumented option.
See /lib/live/boot/9990-fstab.sh and 9990-cmdline-old

I'm away from home right now and can't test any of this. Please let me know what you find.

Offline

#5 2023-11-03 18:54:58

TeacherFromAustria
Member
Registered: 2023-11-01
Posts: 2  

Re: [SOLVED] Refracta created live system with auto mounted FAT32 partition

Thanks for your hints - especially for the snapshot_exluded.list - I was not aware of that.
However in the meantime I found a solution using systemd.
I created the file:

sudo nano /etc/systemd/system/home-user-Meine_FSST_Daten.mount 
########
[Unit]
Description=Mount second fat32 partion on the boot stick to /home/user/Meine_FSST_Daten>

[Mount]
What=/dev/disk/by-label/MY_DATA
Where=/home/user/Meine_FSST_Daten
Type=vfat
Options=rw,umask=0000

[Install]
WantedBy=multi-user.target
##############

and enabled the service:

sudo systemctl enable home-user-Meine_FSST_Daten.mount 

The mount option umask=0000 was necessary because the ownership of my mount directory always changed to root. Now it is still owned by root, but the live user can also read and write.

After that I created the refracta snapshot and now it works smile
Thanks for your help!

Offline

Board footer