I am trying to connect an external drive in my C ++ application. At first I tried to use mount (2), but this failed:
int ret = mount(deviceName.c_str(), mountPoint.c_str(), fsType.c_str(), 0, NULL);
errno - 19, ENODEV (file system type not configured in the kernel)
However, if I switch to using mount (8), it works fine:
std::string cmd = "mount -t " + fsType + " " + deviceName + " " + mountPoint; int ret = system(cmd.c_str());
Does mount (2) have a different list of valid file system types? This is an ntfs device, so I used ntfs-3g as fstype. I checked / proc / filesystems and saw that it was not on the list, so I tried fuseblk , but it just changed the error to 22, EINVAL .
What is the correct way to connect NTFS devices using mount (2)?
source share