OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Mount Confusion
qx773
post Aug 31 2005, 10:49 PM
Post #1





Group: Members
Posts: 219
Joined: 10-February 04
Member No.: 1,807



In the Sharp ROM on my SL-C760, if your present working directory is "/mnt/card" and you type at a shell prompt:

mount directoryname

Then the computer acts as if you typed:

mount /usr/mnt.rom/card/directoryname

because /mnt/card is a symbolic link to /usr/mnt.rom/card.

However, if your present working directory is not /mnt/card and you type:

mount /mnt/card/directoryname

Then the computer acts as if you typed

mount /mnt/card/directoryname

The program that implements the mount command, busybox, looks through the /etc/fstab file and looks for an exact string match to either /usr/mnt.rom/card or /mnt/card, but not both. If you have one or the other string on a line in /etc/fstab, then the mount command will fail in one of the instances that I described above. This failure is what is probably stopping most people from installing the dev-img1.5 setup script on Zauruses that have the Sharp ROM. If you have two separate entries in /etc/fstab with the /usr/mnt.rom/card and /mnt/card strings to mount the same directory and use the "mount -a" command to mount everything mentioned in /etc/fstab, then there will be two separate mounts for the same directory, which is undesirable if you are mounting loop devices and have a limited number of loop devices.

Here is a work-around. The mount command exists as a symbolic link in /bin/mount to busybox. Write a shell script called mount and put it in a directory that is closer to the beginning of the $PATH environment variable. On my computer, the /home/QtPalmtop/bin directory is earlier in the path than /bin. You have to be the root user by executing the "su root" command in order to be able to place the new mount script in the /home/QtPalmtop/bin directory. The content of this /home/QtPalmtop/bin/mount shell script is one line:

CODE
/bin/mount $(echo $* | sed "s/\/mnt\/card/\/usr\/mnt.rom\/card/" | sed "s/\/mnt\/cf/\/usr\/mnt.rom\/cf/")


This script can be made executable with the commands:

su root
chmod 755 mount


What this script does is replace the first "/mnt/card" string in the parameter list with "/usr/mnt.rom/card". The script also replaces the first instance of "/mnt/cf" with "/usr/mnt.rom/cf". The script then passes the altered parameters to the original "/bin/mount" to process. This script makes the path names consistent when you use the mount command.

You also need to do one more thing. In your /etc/fstab file, you have to replace "/mnt/card" with "/usr/mnt.rom/card", and you have to replace "/mnt/cf" with "/usr/mnt.rom/cf". That way, the /bin/mount command will find an exact string match in /etc/fstab.
Go to the top of the page
 
+Quote Post
qx773
post Sep 3 2005, 12:44 AM
Post #2





Group: Members
Posts: 219
Joined: 10-February 04
Member No.: 1,807



When I try to mount some loop devices in

/etc/rc.d/rc.local

with a line like:

mount /home/zaurus/develop 2> /home/zaurus/mount.err

after editing

/root/etc/rc.d/rc.sysinit

to enable the execution of

/etc/rc.d/rc.local

then after rebooting, the mount.err file contains:

mount: ioctl: LOOP_SET_FD: Bad file descriptor
mount: Could not setup loop device


When do the loop devices become active?
Go to the top of the page
 
+Quote Post
qx773
post Jan 1 2006, 08:35 PM
Post #3





Group: Members
Posts: 219
Joined: 10-February 04
Member No.: 1,807



It seems that rc.local is a bad place to execute the mount command. A better place is:

/etc/rc.d/rc5.d/S99local

You can create the S99local file if it does not exist:

cd /etc/rc.d/rc5.d
su root
echo mount -a >> S99local
chmod 755 S99local
exit


I am attaching a copy of my file.

The S99local file can act like the AUTOEXEC.BAT file in MSDOS/Windows once everything else has initialized. The number after the letter S indicates the order in which the initialization scripts execute, so a high number of 99 will make the S99local script run last.
Attached File(s)
Attached File  s99local.zip ( 231bytes ) Number of downloads: 13
 
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 30th October 2014 - 11:47 PM