Hi,
I try to write a C program that can detect whether usb flash disc is enable as a non-root user. Consequently, it will copy some files from the hard disc to the USB flash.
I tried this code in C:
Code:
system("mount /dev/sda1 /mnt/usb");
Shell has warned me like:
Code:
mount: Only root can do this.
(sorry about bad translation)
It failed until I log in as root. In order to allow all users to mount, I inserted this code in fstab:
/dev/sda1 /mnt/usb vfat noauto,users,rw,umask=0 0 0
It did not work,it gave same result.
I would be happy if anyone can solve my problem or give an idea. Thanks