USB connection problem , /dev/sdb1 is mounted error.
-
Dear all, First of all thanking you ALL for the time and support.
When my Qt project try to read USB data (music file ) through QDBusInterface, QDBusMessage. i am getting following error:
ErrorName: " Org.freedesktop.UDisks.Error.Busy "
ErrorMessage: "/dev/sdb1" is mounted.I am getting this error , because my Ubuntu system already showing this USB content, But here i want my Qt application to use the USB instead of UBUNTU.
Could any one kindly suggest me ,as i am very new to this platform.
-Ramesh.
-
What are you trying to do when you get that error? Mount that drive?
-
Tobias Hunger, Thanks for the reply.
My requirement, If USB device is already connected to Ubuntu system, by that if my Qt application wants to access USB, it should access it.
Case1: By that time of Plug in ,my Qt app getting control on USB.
Case2: If USB already connected , in that case it shows Busy and Job is pending message.Kindly let us know, how to stop Ubuntu to access USB , i want only my Qt get access USB always.
Thanks in advance for the time and effor.
-Ramesh.
-
Tobias asked that question because the error message implies that you are trying to mount a USB drive in order to read the content on the device as files. The error indicates that the device is already mounted, so you should be able to just read the content. It doesn't matter who mounted the drive.
-
Hi ChrisW67 thanks for the time.
First i want to read "FilesystemMount" path of my USB device . i.e: "/media/KINGSTON"
I am using folowing to read USB file mounted path.
devLocation i am getting is "/org/freedesktop/UDisks/devices/sdb1"
dBus= new QDBusInterface(DISK_SERV,devLocation,"org.freedesktop.UDisks.Device",QDBusConnection::systemBus(),this);
QDBusMessage msg = dBus->callWithArgumentList(QDBus::AutoDetect,"FilesystemMount",args);
Here i am getting ErrorName: “ Org.freedesktop.UDisks.Error.Busy “ ErrorMessage: “/dev/sdb1” is mounted.
After i get File mounted path only i can read files in USB.
It would be a great help, if someone suggested me the way to proceed.
-
Someone please suggest me the solution. i am struck with this problem.
-
You are trying to mount a filesystem that is already mounted. Seems simple enough, query the 'DeviceIsMounted' property and don't try to mount it again if it is already mounted. The 'DeviceMountPaths' should tell you where it already mounted.
-
ChrisWQ67,
http://qt-project.org/forums/viewthread/8595 , this link answered my questions. Thanks all.