New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

Changing the web interface mount funtionality to use ntfs-3g

Got problems with your B2 or B3? Share and get helped!
Post Reply
Cheeseboy
Posts: 789
Joined: 08 Apr 2007, 12:16

Changing the web interface mount funtionality to use ntfs-3g

Post by Cheeseboy »

Hello again, here comes another one:

I added the etch backport repository to sources.list and installed ntfs-3g for write access to NTFS USB drives.
It works just fine if I mount it manually. I had a look at your script behind the mount button in the web interface looking to change the default behaviour to use ntfs-3g rather than ntfs.
I saw a function called mount which seemed to do it (sorry haven't got the file name I was looking at, no access to bubba2 now), and it was calling a function called user_mount without specifying the file system of the device. Where can I find this user_mount function source code or documentation?

Sorry if this is a stupid question, I could find no such function in your scripts, no documentation in man or google...

Is it possible to do what I want? (I don't care if my changes will be overwritten by a future update, I can document the changes an redo them)

Thanks in advance!

Cheeseboy

EDIT: Clarified subject.
pa
Posts: 308
Joined: 06 Dec 2006, 04:38
Location: Sweden
Contact:

Post by pa »

Hi,

The "user_mount" function is a call that traces back through the system to "our" scripts handling all system access rather than the UI it self.

The actual script doing the work of mounting the disk is located here:
"/usr/lib/web-admin/disk.pl", but you do not need to go that far.
The "user_mount" fuction takes a last argument that is the fs-type. If this is not set, the functions tries to auto-detect the fs-type.

If you do need to add the fstype, try to do this in the file:
"/usr/share/web-admin/admin/system/application/controllers/disk.php"
Cheeseboy
Posts: 789
Joined: 08 Apr 2007, 12:16

Post by Cheeseboy »

Hi pa,

Thanks for this reply, it cleared things up!
I will not be able to use the 3rd argument of the user_mount function as I do not want to hard code it, (I might be using other file systems) and I do not have the skills to add a conditional statement that will actually check the file system of the device.

Looking at the code in /usr/lib/web-admin/disk.pl it looks like it is actually /bin/mount that does the figuring out of what file system to use so my problem/quest has now become more related to the OS and/or ntfs-3g (how to configure what driver to use when NTFS is detected on the device when the -t switch is not used in the munt command).
I will inform you if I ever manage to sort it out.
Right now the motivation is minimal though, as it is not so hard to mount the disks manually...

Thanks again for your very helpful reply!

Cheers,

Cheeseboy

Edit: Some spelling/grammar corrections (probably not complete)
Post Reply