Kodi Community Forum
USB drive not appearing - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Linux (https://forum.kodi.tv/forumdisplay.php?fid=52)
+---- Thread: USB drive not appearing (/showthread.php?tid=58764)

Pages: 1 2 3 4 5 6 7


- Serverov - 2009-11-29

topfs2 Wrote:The way you are fixing this isnt very recommended. the correct way is to use polkit-auth --grant.

Thanks Tobias! Tts very useful advice about using polkit-auth. I resolved automount issue by this way:

Code:
sudo polkit-auth --user xbmc --grant org.freedesktop.hal.storage.mount-removable
sudo polkit-auth --user xbmc --grant org.freedesktop.hal.device.volume

Thank you for your help!


- topfs2 - 2009-11-30

yeah thats the correct way, thx for writing it back (will help others with same problem searching) and glad you got it working.

Hope you'll have a continued wonderfull XBMC experience Smile

Cheers,
Tobias


- FireMan - 2009-12-08

Hi All,

Thanks for the help. This topic was really helpful! After these command lines from Serverov, XBMC is mounting any USB!

But I notice the USB is really SLOW to write.

No matter which USB device is attached, it will be much slower than running the same hardware in Windows.
After some hours of google search, I found several information about slow USB in linux. Is almost unanimous that the problem stops when mounting the device in async mode. So, I made a few tests.

This is the speed with the device mounted by XBMC, copying a file with a size close to 3gb to a Sandisc Cruizer 16gb:
Code:
xbmc@MARK1:~$ time cp test.iso /media/JEJE-16GB/

real    78m49.573s
user    0m0.152s
sys     0m24.658s
And this is the same file being copied after remount the Cruizer in async mode (sudo mount -o remount,async /dev/sdb1):
Code:
xbmc@MARK1:~$ time cp test.iso /media/JEJE-16GB/

real    8m59.551s
user    0m0.104s
sys     0m5.788s

8min59s is almost the the same time it took to copy in Windows.

So, comparing the results:
Sync: 1h19min
Async: 9min
Sync mode is almost 9x slower then async!

The same happens when copying files to a USB HDD (ext3). Over the network (SAMBA 3.3.2), this is the transfer speed from a Windows 7 desktop to an ASRock running ubuntu 9.04 + XBMC 9.11 beta1:
Image

The upload speed (saving to USB HDD) is stable @ 57mbps, while the download speed is arround 270~280mbps (reading from HDD). When the HDD is mounted in async mode the upload speed is the same as download.

In time, I'm running XBMC 9.11 beta 1 for linux, with a minimal install of Ubuntu 9.04 in a ASRock ION330. To make sure, I've repeated the USB stick (Sandisc Cruizer) tests on my desktop (Intel Q9650+Asus Formula Rampage, also running XBMC 9.11beta1 on Ubuntu 9.04 minimal). The results are identical.

So, I must ask: there is any way to make XBMC always auto mount USB devices in asynchronous mode? If not, is there any other way to make USB devices fast as they are in Windows?

Thanks in advance.


- topfs2 - 2009-12-08

FireMan Wrote:Hi All,

Thanks for the help. This topic was really helpful! After these command lines from Serverov, XBMC is mounting any USB!

But I notice the USB is really SLOW to write.

No matter which USB device is attached, it will be much slower than running the same hardware in Windows.
After some hours of google search, I found several information about slow USB in linux. Is almost unanimous that the problem stops when mounting the device in async mode. So, I made a few tests.

This is the speed with the device mounted by XBMC, copying a file with a size close to 3gb to a Sandisc Cruizer 16gb:
Code:
xbmc@MARK1:~$ time cp test.iso /media/JEJE-16GB/

real    78m49.573s
user    0m0.152s
sys     0m24.658s
And this is the same file being copied after remount the Cruizer in async mode (sudo mount -o remount,async /dev/sdb1):
Code:
xbmc@MARK1:~$ time cp test.iso /media/JEJE-16GB/

real    8m59.551s
user    0m0.104s
sys     0m5.788s

8min59s is almost the the same time it took to copy in Windows.

So, comparing the results:
Sync: 1h19min
Async: 9min
Sync mode is almost 9x slower then async!

The same happens when copying files to a USB HDD (ext3). Over the network (SAMBA 3.3.2), this is the transfer speed from a Windows 7 desktop to an ASRock running ubuntu 9.04 + XBMC 9.11 beta1:
Image

The upload speed (saving to USB HDD) is stable @ 57mbps, while the download speed is arround 270~280mbps (reading from HDD). When the HDD is mounted in async mode the upload speed is the same as download.

In time, I'm running XBMC 9.11 beta 1 for linux, with a minimal install of Ubuntu 9.04 in a ASRock ION330. To make sure, I've repeated the USB stick (Sandisc Cruizer) tests on my desktop (Intel Q9650+Asus Formula Rampage, also running XBMC 9.11beta1 on Ubuntu 9.04 minimal). The results are identical.

So, I must ask: there is any way to make XBMC always auto mount USB devices in asynchronous mode? If not, is there any other way to make USB devices fast as they are in Windows?

Thanks in advance.

Try doing cp and then unmount directly after, async would take lots of time to unmount since it haven't written all the data yet.

Cheers,
Tobias


- FireMan - 2009-12-08

topfs2 Wrote:Try doing cp and then unmount directly after, async would take lots of time to unmount since it haven't written all the data yet.

Cheers,
Tobias

Hi Tobias,

First, I like to thank you for the reply.
I know what you are thinking and I also consider this option to. But isn't the case. It takes 5 seconds to umount:

Code:
xbmc@MARK1:~$ sudo mount -o remount,async /dev/sdb1
[sudo] password for xbmc:
xbmc@MARK1:~$ date ; time cp -v ./test.iso /media/JEJE-16GB/ ; time umount /media/JEJE-16GB/ ; date
Tue Dec  8 15:29:32 BRST 2009
`./test.iso' -> `/media/JEJE-16GB/test.iso'

real    9m01.280s
user    0m0.064s
sys     0m5.676s

real    0m5.241s
user    0m0.000s
sys     0m0.004s
Tue Dec  8 15:38:39 BRST 2009
xbmc@MARK1:~$

Besides, if the same file is copied in 9 minutes in Windows, can't be normal take almost 1,5 hour to copy in Linux.
This async/sync problem, concerning USB devices, looks be very know in linux (at least, this was the 1st impression I have after a google search). Anyway, if there is other way to let USB devices fast in linux as they are in Windows, I will be very happy Big Grin

Thanks.


- kizer - 2009-12-08

I have the same problem. Takes forever to write to a memory stick. I started a thread about it and nobody seems to address it unless its just something nobody else cares about.

http://forum.xbmc.org/showthread.php?tid=63566


- hellsing - 2009-12-08

kizer Wrote:I have the same problem. Takes forever to write to a memory stick. I started a thread about it and nobody seems to address it unless its just something nobody else cares about.

http://forum.xbmc.org/showthread.php?tid=63566

What's the average speed? Mine lies around 600kb/s on a couple of different USB-devices.


- kizer - 2009-12-08

Mine shows the transfer speed then it goes away and I don't see anything other than a machine sitting there.


- FireMan - 2009-12-08

hellsing Wrote:What's the average speed? Mine lies around 600kb/s on a couple of different USB-devices.

I've tested with 2 sticks:

Sync mode (as mounted by XBMC):

Corsair Voyager GT 16gb: 380kb/s ~ 600kb/s
Cruizer Micro 16gb: 950kb/s ~ 1050kb/s

After remount to async mode (sudo mount -o remount,async /meda/flashname):

Corsair Voyager GT 16gb: 13.700kb/s ~ 14.200kb/s
Cruizer Micro 16gb: 6.000kb/s ~ 6.500kb/s

As you can see, in sync mode the faster USB stick (Voyager GT) is slower than the other.
The speeds in async are the average after stabilize. When start the copy, XBMC show a very high value (like 50.000kb/s) then it slows down until fully stabilize.

Regards.


- hellsing - 2009-12-08

FireMan Wrote:I've tested with 2 sticks:

Sync mode (as mounted by XBMC):

Corsair Voyager GT 16gb: 380kb/s ~ 600kb/s
Cruizer Micro 16gb: 950kb/s ~ 1050kb/s

After remount to async mode (sudo mount -o remount,async /meda/flashname):

Corsair Voyager GT 16gb: 13.700kb/s ~ 14.200kb/s
Cruizer Micro 16gb: 6.000kb/s ~ 6.500kb/s

As you can see, in sync mode the faster USB stick (Voyager GT) is slower than the other.
The speeds in async are the average after stabilize. When start the copy, XBMC show a very high value (like 50.000kb/s) then it slows down until fully stabilize.

Regards.

Wow, i just remounted to async mode and the speed was like you reported. I tried on a Corsair Voyager GT 2gb now.

Is there a way to make async the default way to automount devices?


- FireMan - 2009-12-08

hellsing Wrote:Wow, i just remounted to async mode and the speed was like you reported. I tried on a Corsair Voyager GT 2gb now.

Is there a way to make async the default way to automount devices?

That's the answer I'm waiting too Blush
Let's hope some Linux guru has this answer. Or, maybe, a new feature/option in the next XBMC revision (like select between sync or async in settings?).

Don't forget to umount any async USB device before remove it (it's a good idea umount/safe remove even if is in sync mode!).

Regards.


- topfs2 - 2009-12-08

FireMan Wrote:That's the answer I'm waiting too Blush
Let's hope some Linux guru has this answer. Or, maybe, a new feature/option in the next XBMC revision (like select between sync or async in settings?).

Don't forget to umount any async USB device before remove it (it's a good idea umount/safe remove even if is in sync mode!).

Regards.

Ok, I've searched abit for it and your claims seems to check out Smile

async uses a writebuffer wereas sync does not, the first makes the writing much better for the program but if the user yank the device it might be worse, and if you turn off the machine instantly (hard) when finished copying lookwise it might not be done copying so the user will destroy the data.

But since you are seeing so much improvement with async I think it sounds like the benefits outwins the gains, I've added it in r25470. Since I can't test hal I won't be adding it in there for stable (pre-karmic). but karmic and devicekit based distros will use os default now (async it turns out Smile )

Thx for the thourough testing regarding the matter!

Cheers,
Tobias


- kizer - 2009-12-08

Is there anything we can do now opposed to updating to another build? I ask because I have my system right where I really like it and if I can make a config file change or something of the sort I would be very happy to do so before trying another build unless there is no other way.

I first pointed this out and Fireman confirmed it and I'm glad it was enough to prove it to a Dev for future releases, but it would be great to be able to use now. Wink

I'm running a Jaunty build myself.


- FireMan - 2009-12-09

But, just to register, thare are several complains in Karmic about slow USB right. I don't know if async is standard in 9.10:

https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/457768
http://ubuntuforums.org/showthread.php?t=1306333

Looks like users are a little lost in this second link above. They are trying acpi kernel mode, and this doesn't make difference in my tests.

Regards.


- topfs2 - 2009-12-09

kizer Wrote:Is there anything we can do now opposed to updating to another build? I ask because I have my system right where I really like it and if I can make a config file change or something of the sort I would be very happy to do so before trying another build unless there is no other way.

I first pointed this out and Fireman confirmed it and I'm glad it was enough to prove it to a Dev for future releases, but it would be great to be able to use now. Wink

I'm running a Jaunty build myself.

No way to do it via config, and jaunty builds won't have async. only karmic and beyond.