Hi, here's my way:
- In storage VM I've created '/rw/config/fstab' with content that will be 
appended to /etc/fstab on each boot. It contains UUIDs of partitions with 
target mount point. Note the 'auto' attribute:
---
[user@storage config]$ cat /rw/config/fstab 
# This should have been appended to /etc/fstab on boot

#Disk1
UUID=3f3564db-7df4-40af-d067-33ed2c049b65 /s/disk1       reiserfs   
auto,noatime,users,exec 0 2
UUID=a4e9a4fc-ef0a-962d-3cf2-a6fdfa35a00b /s/disk2    ext3       
auto,noatime,users,exec 0 2
---

File /rw/config/rc.local creates mount points and adds UUIDs
#!/bin/bash
mkdir -m 770 -p /s/disk1
mkdir -m 770 -p /s/disk2

cat /rw/config/fstab >> /etc/fstab

Then in dom0 we have similar script:
#!/bin/bash

qvm-start storage

list=`qvm-block -l | grep -v attached`

awk '
BEGIN{
  attach["HDID"]="dummy";
  attach["ST320ABC"]="dummy";
}

{
  if( ($1 ~ /sd.$/) && ($4 > 0) && attach[$2]){
    print "Attaching",$1,$2;
    system("qvm-block -a storage " $1);
  }
}
' <<< "$list" 

qvm-run storage 'sudo mount -a'
----
attach[] contains the names of white-listed devices to be attached to storage - 
this is 2nd column of table output by qvm-block command.
After devices are assigned to storageVM, auto-mount is executed in the VM.

I have similar script that unmounts and detaches devices from the storageVM.


Currently I have to find suitable place and time to run that script. 
Suggestions are welcomed.

Tomhet


-- 
You received this message because you are subscribed to the Google Groups 
"qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to qubes-users+unsubscr...@googlegroups.com.
To post to this group, send email to qubes-users@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-users/b4bfd29a-7a97-46da-a935-10602a6b1403%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to