
Re: Major Problem - Drive Mapping Inconsistent
GregiBoy wrote:
Re: Major Problem - Drive Mapping Inconsistent
Sorry I haven't answered sooner but am away visiting family with limited internet connection.
Will provide when I'm back Wed/Thu,
I did setup 2 disks formatted the same as yours.
I 've tested it and one problem comes to notice:
There are 2 situations that exist.
Situation 1
Disk1.
Swap= C: , Partition2=D: Partition3=E:
Disk2
Swap2=F:, Partition2=G:
Situation 2
Labels that are created are D:E:G:
The required situation
Disk2.
Swap=C:,Partition2=D:
Disk1.
Swap=E: Partition2=F: Partition3=G:
Labels that are created D:F:G:
Above is also applicable for the USB labels.
The disk Labels and USB labels are created by the program DVDPLayer.
The letters and USB labels are symbolic links and I can manage to change them.
The Disk letters are used by the DVDPlayer to access the drive locally.
The USB labels are used with a network connection.
For the situation access locally.
If I change the symbolic links between D F and G, D and G will work but drive F: cannot be changed It remains visible in the players USB menu . It's possible that the drive letters are stored in the DVDPlayer, as I am changing the the label within Linux the program DVDPlayer will not see this change.
For the network situation the above problem does not exist and I can manage to change the symbolic links/labels and it should work correctly.
What I did further I reformatted the Hard disk with the 2 partitions and then I can change the symbolic links.
The Volumes that are created D:E:F:G: and it does not matter which disk is first.
I can change the symbolic link because they're always be the right combination of letter.
So in general terms the symbolic links can be changed, but when having a swap partition it needs to be on both disks and the number of volumes must be equal and partition structure must be the same sequence on both disks.
e.g swap, ext3, ext3.Is it possible to add another Ext3 partition? Size does not really matter as long as it exist.
Setup proposal
The rcS script needs to be added with one line.
I will create a small script which will test if a file exist (the swap_symbolic_links file).
The swap_symbolic_links fill will test if a directory exist on both drive and if they're in the correct order.
If one of the directory does not exist it it will quit the script. Seeing your playing around with 8 disk you would not want to change the symbolic links.
It would also be easier to update just by copying the swap_symbolic_links file.
I propose to create a directory .Disk_label_1 and .Disk_label_2. So no requirement for you to give me a directory name. The directory will also be hidden.
Another possibility to test for directory (but is really a dirty way of fixing it) is to reboot the system until the right situation exist.
I hope it is a little bit clear, it really does not matter I write it down for my own sake.
Of course it still need to be further tested.
The script is working only on a personal situation.
btw do you use any shortcuts within the player, because I have not tested that.
Well so far I got this.
Modification to th rcS the last line has been added.
Code:
echo 2 /tmp/hdd/volumes/HDD1/ > /sys/realtek_boards/misc_operations
/usr/local/etc/file_chck
Simple check to see if the script exist.
Code:
#!/bin/ash
LOGFILE=/tmp/log/script.log
FILE=/usr/local/etc/filechck
if [ -f $FILE ];
then
echo "filechck exist" 1>$LOGFILE
/usr/local/etc/filechck
fi
Actual script This can be upgraded by simply coping over it.
/ # cat /usr/local/etc/filechck
Code:
#!/bin/ash
LOGFILE=/tmp/log/script.log
DIR1=/tmp/usbmounts/sda2/.Disk_Label_1
DIR2=/tmp/usbmounts/sdb2/.Disk_Label_2
i=0
until [ -d $DIR1 ] ; do
let i+=1 ; sleep 5
if [ $i -ge 12 ] ; then
echo $i 1>>$LOGFILE
echo $DIR1 " does not exist." 1>>$LOGFILE
break ;
fi
done
let TIME=5*i
echo "disk wait time " $TIME " seconds," 1>>$LOGFILE
echo $DIR1 " exist" 1>>$LOGFILE
i=0
until [ -d $DIR2 ] ; do
let i+=1 ; sleep 5
if [ $i -ge 12 ] ; then
echo $i 1>>$LOGFILE
echo $DIR2 "does not exist." 1>>$LOGFILE
break ;
fi
done
let TIME=5*i
echo "disk wait time " $TIME "seconds." 1>>$LOGFILE
echo $DIR2 " exist" 1>>$LOGFILE
if [ -d $DIR1 ] && [ -d $DIR2 ];
then
echo "Directories exist" 1>>$LOGFILE
FILE=/tmp/ramfs/volumes/D:/.Disk_Label_1
if [ -d $FILE ];
then
echo $FILE "exist" 1>>$LOGFILE
else
echo $FILE "does not exist" 1>>$LOGFILE
rm /tmp/ramfs/volumes/D:
rm /tmp/ramfs/volumes/E:
rm /tmp/ramfs/volumes/G:
rm /tmp/ramfs/volumes/H:
cd /tmp/ramfs/volumes
ln -s /tmp/usbmounts/sda2 D:
ln -s /tmp/usbmounts/sda3 E:
ln -s /tmp/usbmounts/sdb2 G:
ln -s /tmp/usbmounts/sdb3 H:
/tmp/package/script/configsamba
echo "Swap disk labels complete." 1>>$LOGFILE
fi
else
echo "Not possible to swap disks labels." 1>>$LOGFILE
fi
sample of log file
/ # cat /tmp/log/script.log
filechck exist
disk wait time 35 seconds,
/tmp/usbmounts/sda2/.Disk_Label_1 exist
disk wait time 0 seconds.
/tmp/usbmounts/sdb2/.Disk_Label_2 exist
Directories exist
/tmp/ramfs/volumes/D:/.Disk_Label_1 does not exist
Swap disk labels complete.
Remember the above code is for both disk having a swap and 2 ext3 partitions.
If you want to go through with it I will make installation instructions.
Perhaps you got a spare disk to set it up so you can try it out. JR