View Single Post
debernardis's Avatar
Posts: 2,142 | Thanked: 2,054 times | Joined on Dec 2006 @ Sicily
#264
The following version of the /opt/mount.sh script seems to mount correctly also multipartition devices. I am not convinced of the unmounting, it seems not to work, or at least unmounting should be confirmed before you proceed quitting hostmode.
For now it's true that it's better to mount and umount by hand so that you have feedback in xterm of what you do

Code:
#!/bin/sh


monta() {
echo mounting
lista=`awk '$4~"[0-9]$"{print $4}' /proc/partitions | grep -v "mmcblk*" | grep -v "loop*"`
for partitions in $lista
    do echo mkdir -p $partitions
    mkdir -p /media/$partitions
    echo mount /dev/$partitions /media/$partitions
    mount /dev/$partitions /media/$partitions
done
}

unmount() {
echo unmounting
lista=`awk '$4~"[0-9]$"{print $4}' /proc/partitions | grep -v "mmcblk*" | grep -v "loop*"`
for partitions in $lista
        do echo umount /media/$partitions
    umount /media/$partitions
done
}    

if [ "$1" = "--mount" ]
    then
        monta
fi

if [ "$1" = "--unmount" ]
    then
        unmount
fi
    
exit
Of course should you should be root to copy it in /opt/mount.sh and chmod 755
__________________
Ernesto de Bernardis


Last edited by debernardis; 2010-11-12 at 11:29.
 

The Following 2 Users Say Thank You to debernardis For This Useful Post: