Read and mount local disk

Here you can post about the issues related to modifications performed manually (not through the kiosk wizard). Example: swapped kernel, added 3rd party modules or files.
Please describe in detail what has been changed and hopefully other kiosk user will be able to help.
Porteus team wont resolve bugs posted in this category as we support only modifications made by the kiosk wizard.
Post Reply
balrok69
White ninja
White ninja
Posts: 7
Joined: 07 Apr 2016, 17:08
Distribution: porteus-kiosk-3.4
Location: Spain

Read and mount local disk

Post#1 by balrok69 » 11 Nov 2016, 11:46

Hi,

Im a little bit loss, so any help is appreciated.
I want to be able to mount the local disk where Porteus Kiosk is installed, /dev/sda appears to be recognized by the kernel but no /dev/sda is created at startup by udev.
I spent days searching the root of the cause, but now im not sure if the problem is the init script, the kernel, udev or a conjuntion of all.

The main idea about this, is to be able to send it a Porteus modified image to /tmp and dd it directly to the whole disk.

User avatar
fanthom
Site Admin
Site Admin
Posts: 4626
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

Re: Read and mount local disk

Post#2 by fanthom » 11 Nov 2016, 12:57

Hello balrok69,

If full persistence is not enabled then you need to put the kiosk into debug mode (using remote config) in order to get an access to the hard drive.

Thank you.
Please add [Solved] to your thread title if the solution was found.

balrok69
White ninja
White ninja
Posts: 7
Joined: 07 Apr 2016, 17:08
Distribution: porteus-kiosk-3.4
Location: Spain

Re: Read and mount local disk

Post#3 by balrok69 » 14 Nov 2016, 10:05

Hi Phantom,

Thanks for your response, debug mode isn't showing me the local disk. Probably I'm doing it wrong, are you referring to porteus kiosk remote managment feature?

I'm looking closer the to the linuxrc/init script, I made some test puting an sh before switch_root and i could affirm that before switch_root i can see the whole disk at /proc/partitions.
So now im sure that udev is removing block devices or whatever. Udev, that "usual suspect" haha!

balrok69
White ninja
White ninja
Posts: 7
Joined: 07 Apr 2016, 17:08
Distribution: porteus-kiosk-3.4
Location: Spain

Re: Read and mount local disk

Post#4 by balrok69 » 18 Nov 2016, 10:38

Some updates here,

The local disk appears to be there until the start of the runlevel 4, and after this I can see in dmesg that local disk goes offline. Looking closer to the rc.4, I can see that the problem is directly related to the execution of "exec /usr/bin/xdm".
Any hints? Maybe a config related to xdm?

Thanks,

balrok69
White ninja
White ninja
Posts: 7
Joined: 07 Apr 2016, 17:08
Distribution: porteus-kiosk-3.4
Location: Spain

Re: Read and mount local disk

Post#5 by balrok69 » 18 Nov 2016, 12:08

Update:

udevmadm monitor shows this only when i start X:


--------
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[23.842486] change /devices/platform/regulatory.0 (platform)
UDEV [23.842520] change /devices/platform/regulatory.0 (platform)
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[36.413599] change /devices/platform/regulatory.0 (platform)
UDEV [36.413635] change /devices/platform/regulatory.0 (platform)
KERNEL[39.556315] change /devices/platform/regulatory.0 (platform)
UDEV [39.556349] change /devices/platform/regulatory.0 (platform)
KERNEL[40.365040] add /devices/virtual/vc/vcs2 (vc)
UDEV [40.365056] add /devices/virtual/vc/vcs2 (vc)
KERNEL[40.365069] add /devices/virtual/vc/vcsa2 (vc)
UDEV [40.365079] add /devices/virtual/vc/vcsa2 (vc)
KERNEL[41.607233] remove /devices/pci0000:00/0000:00:10.0/host32/target32:0:0/32:0:0:0/bsg/32:0:0:0 (bsg)
UDEV [41.607484] remove /devices/pci0000:00/0000:00:10.0/host32/target32:0:0/32:0:0:0/bsg/32:0:0:0 (bsg)
KERNEL[41.607513] remove /devices/pci0000:00/0000:00:10.0/host32/target32:0:0/32:0:0:0/scsi_device/32:0:0:0 (scsi_device)
UDEV [41.607645] remove /devices/pci0000:00/0000:00:10.0/host32/target32:0:0/32:0:0:0/scsi_device/32:0:0:0 (scsi_device)
KERNEL[41.607694] remove /devices/pci0000:00/0000:00:10.0/host32/target32:0:0/32:0:0:0/scsi_disk/32:0:0:0 (scsi_disk)
UDEV [41.607815] remove /devices/pci0000:00/0000:00:10.0/host32/target32:0:0/32:0:0:0/scsi_disk/32:0:0:0 (scsi_disk)
KERNEL[41.608035] remove /devices/pci0000:00/0000:00:10.0/host32/target32:0:0/32:0:0:0/block/sda (block)
UDEV [41.608674] remove /devices/pci0000:00/0000:00:10.0/host32/target32:0:0/32:0:0:0/block/sda (block)
KERNEL[41.608713] remove /devices/pci0000:00/0000:00:10.0/host32/target32:0:0/32:0:0:0 (scsi)
UDEV [41.608838] remove /devices/pci0000:00/0000:00:10.0/host32/target32:0:0/32:0:0:0 (scsi)
KERNEL[41.610276] remove /devices/virtual/bdi/8:0 (bdi)
UDEV [41.610419] remove /devices/virtual/bdi/8:0 (bdi)
---------------


Here is the root of the cause I think, how could i fix that? Udev rules?

balrok69
White ninja
White ninja
Posts: 7
Joined: 07 Apr 2016, 17:08
Distribution: porteus-kiosk-3.4
Location: Spain

Re: Read and mount local disk (SOLVED)

Post#6 by balrok69 » 21 Nov 2016, 11:15

/etc/xdg/openbox/autostart calls to /opt/porteus-scripts/power_saver , power_saver tweaks...(nice joke!...)


Content of: /opt/porteus-scripts/power_saver
---------------------
#!/bin/sh
# Apply power saving tweaks.

# Spin down everything we can.
# Never remove optical devices if removable media support is enabled:
if grep -q ^removable=yes /etc/xdg/openbox/autostart; then
for drive in `ls -1 /sys/block | egrep -v '^loop|^sr'`; do echo 1 > /sys/block/$drive/device/delete; done
else
for drive in `ls -1 /sys/block | grep -v ^loop`; do echo 1 > /sys/block/$drive/device/delete; done
fi
--------

Which is the purpose of this script?

User avatar
fanthom
Site Admin
Site Admin
Posts: 4626
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

Re: Read and mount local disk

Post#7 by fanthom » 11 Jun 2017, 09:21

"Which is the purpose of this script?"
See here:
http://porteus-kiosk.org/news.html#140707
Please add [Solved] to your thread title if the solution was found.

Post Reply