Page 1 of 1

Read and mount local disk

Posted: 11 Nov 2016, 11:46
by balrok69
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.

Re: Read and mount local disk

Posted: 11 Nov 2016, 12:57
by fanthom
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.

Re: Read and mount local disk

Posted: 14 Nov 2016, 10:05
by balrok69
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!

Re: Read and mount local disk

Posted: 18 Nov 2016, 10:38
by balrok69
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,

Re: Read and mount local disk

Posted: 18 Nov 2016, 12:08
by balrok69
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?

Re: Read and mount local disk (SOLVED)

Posted: 21 Nov 2016, 11:15
by balrok69
/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?

Re: Read and mount local disk

Posted: 11 Jun 2017, 09:21
by fanthom
"Which is the purpose of this script?"
See here:
http://porteus-kiosk.org/news.html#140707