LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Distributions (https://www.linuxquestions.org/questions/linux-distributions-5/)
-   -   mount system call is failing. (https://www.linuxquestions.org/questions/linux-distributions-5/mount-system-call-is-failing-750790/)

paldebojyoti 08-28-2009 12:55 AM

mount system call is failing.
 
Hi,

I am facing problem while using mount() system call in my ubuntu 8.10 PC. Within my application, I am calling the mount call to mount a USB device to a specific directory, like this:
mount("/dev/sdb", "/media/myusb/", "ext3", MS_RDONLY, 0))
But every time I am getting the errors either "EBUSY" or "EINVAL". I changed the mount flag options also, but the error remains.
Instead if I use this command line option "mount /dev/sdb /media/myusb/", it works fine.

Could you please tell me what error I have made? Any help is appreciated.

Regards,
Deb

RaptorX 08-28-2009 06:08 PM

I am not sure but you can start checking maybe there: 0))?
is that a typo or is part of the syntax?

also check if the data type you are entering is correct...

paldebojyoti 08-30-2009 11:44 PM

Hi All,

This is solved, I use mount(("/dev/sdb", "/media/myusb/", "vfat", MS_SYNCHRONOUS, 0)) and it is working now. So instead of "ext3" using "vfat" solved the problem.

Regards,
Deb


All times are GMT -5. The time now is 09:27 AM.