Kodi Community Forum

Full Version: Auto-mount USB drive, some questions (Asrock ION 330, XBMCLive)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
The situation:

I want to add some gigabytes to my Asrock ION 330 (it has only 320 gb) system running XBMCLive, so I thought: Hey, why not buy a relatively cheap external USB drive, hook it up the Asrock ION and make XBMC see it as an internal drive? This guide should make that possible: http://forum.xbmc.org/showthread.php?tid=66534

Now, I have some small questions:

A) I would like to have full read and write on the usb drive and vice versa, does this mean I should format the external usb drive to ext4, as xbmc uses this filesystem? or should NTFS or something like that be fine too?

B) I also have SABnzb installed on the Asrock ION 330. Is it possible to let it download to the external USB drive?

C) When the drive is mounted in the Asrock ION 330, and shows up as a folder in my XBMC home folder, I should be able to manage the files on my USB drive via a network connection to a pc that runs Windows using the samba share?
A) If you are ONLY going to ever use the drive on your XBMC box, then ext4 is fine, since it features some usefull file recovery features incase of disk failure. However, if you plan to use the drive on a Windows machine at ANY time in the future, then use NTFS, since Windows can't read an ext4 drive, but Linux can read an NTFS drive.

B) So long as the drive is mounted when the system boots, then there is no reason why not, the system just sees teh drive as another folder. You will have to go into the SABnzb configuration files to find out how to tell it to store downloads on the external drive, but it should be simply a matter of changing a file path. Don't know how to do it though as I don't use SABnzb.

C) Yes, providing you have set up that folder to be shared under Samba so it can be seen in your network. I have only ever used a GUI app to configure Samba in Ubuntu's desktop, so I can't help you here I am afraid. I am sure there is a wiki page in the Ubuntu wiki about what to do though.
prupert Wrote:A) If you are ONLY going to ever use the drive on your XBMC box, then ext4 is fine, since it features some usefull file recovery features incase of disk failure. However, if you plan to use the drive on a Windows machine at ANY time in the future, then use NTFS, since Windows can't read an ext4 drive, but Linux can read an NTFS drive.

B) So long as the drive is mounted when the system boots, then there is no reason why not, the system just sees teh drive as another folder. You will have to go into the SABnzb configuration files to find out how to tell it to store downloads on the external drive, but it should be simply a matter of changing a file path. Don't know how to do it though as I don't use SABnzb.

C) Yes, providing you have set up that folder to be shared under Samba so it can be seen in your network. I have only ever used a GUI app to configure Samba in Ubuntu's desktop, so I can't help you here I am afraid. I am sure there is a wiki page in the Ubuntu wiki about what to do though.

Thank you for the elaborate answers, much appreciated!

I was wondering about the filesystem, because when you hook up a USB drive and fire up the file manager within xbmc, you can not copy files from the usb drive to the internal drive and vice versa...I thought maybe this had to do with the different filesystems of the drives?

So basically, I could format the USB drive as NTFS and still mount it and exchange files between the external and internal drive? That would be great.

And another question, what would happen if you unplug the USB when the drive is mounted?
Not being able to copy stuff from the Asus drive to the USB drive might be a limitation of the XBMC filemanager, rather than a problem with the different formats of the drives - though I am not sure. Remember, Linux has file security, implemented by User and Owner Group file permissions. If you don't have permission to write to the drive, then you can't copy anything,

If you can copy stuff over to the drive using a command line (try touch /path/to/your/USBdrive/testfile.txt if that works) then you have the correct privileges and it is a problem with the xbmc file manager. I never use the xbmc file manager so I can't say.

It doesn't matter what you format the USB drive is, so long as Linux supports it. I would recommend ext4 if you can use it, but if your Asus drive was ext4 your USB drive could be ext2, ext3, ext4, vfat, ntfs and it would still work fine, providing the privileges were ok.

If you want to disconnect your USB drive whilst your Asus is stil running, then make sure you safely remove if first, via:
sudo umount /path/to/USBdrive

on the commandline. It is not safe to just pull it out...
coendeurloo Wrote:And another question, what would happen if you unplug the USB when the drive is mounted?

your cat may catch on fire.

seriously, *most* of the time nothing.
if its busy you'll lose stuff, like if you're copying it wont finish.

unmounting checks if the drive is busy first
its the right thing to do
If I buy a regular external harddrive, format it to NTFS and mount it in xbmc, will it have the proper permissions by default, and if not, how do you change the permissions?

I know I could fire up WinSCP, connect to the xbmc's drive, browse to the folder that has my USB mounted and right click the folder, choose properties and set it to 777, but is that the correct way of doing it?
Well it WORKS!! I tested it at a friends place.

This is awesome and should be a part of the wiki in my opinion, it's quite essential and time saving in many, many cases!

One more question: Copying the files from the internal disk to the USB drive takes a lot of time when you do it via windows connected to the network (samba share). Of course it's logical because it sends it to windows, then back to the server.

So what is the best way to copy it from, say, /home/xbmc/Movies to the newly created /home/xbmc/usb folder? I presume you can do it in Putty, but what would be the command to copy a whole folder?

I've heard about a program called 'webmin' does any of you know that program? It should have an interface and that way you could easily copy files and folders without the help of windows, as it would be done 'internally'.
hi. i'm bumping this as I'd like to connect an external USB NTFS drive to my XBMC live box and I can't figure out from your posts exactly how you made XBMC live see the USB drive? could you expand please?
cable_guy Wrote:hi. i'm bumping this as I'd like to connect an external USB NTFS drive to my XBMC live box and I can't figure out from your posts exactly how you made XBMC live see the USB drive? could you expand please?
try this.
Flomaster Wrote:adding drives to your fstab

get you device UUID number

from terminal type

Code:
sudo blkid
it should return some thing like this

Code:
/dev/sda1: UUID="8ee3e8ab-33bb-481c-a298-09f435697277" TYPE="ext4"
/dev/sda5: UUID="6aebcb53-5d6e-4e4c-a1e8-e0fc40d759fd" TYPE="swap"
/dev/sdb1: LABEL="1TB" UUID="3FC1624A6DA7048F" TYPE="ntfs"
/dev/sdc1: LABEL="WD 250G" UUID="12A8E87AA8E85E2B" TYPE="ntfs"

copy the UUID of the drive you want to mount and run this

Code:
sudo nano /etc/fstab

add this line to the bottom but change the settings accordingly

Code:
UUID=[b]YOUR-UUIDNUMBER [/b]/[b]YOUR/DRIVE/LOCATION [/b]ntfs-3g defaults 0 0

-=Jason=-
Flomaster Wrote:try this.

thanks tons, will give it a go tomorrow Big Grin
cable_guy Wrote:thanks tons, will give it a go tomorrow Big Grin

You may also want to check out this blog post on mounting (USB) drives in XBMC. One of the comments explains some details on mounting NTFS USB drives with special permissions (eg. read/write).

To the original poster, I have USB drives hooked to my Revo running NTFS which is where my SABnzbd downloads go to (and they are shared across the network with Samba).
hi, does UUID=YOUR-UUIDNUMBER / ntfs defaults 0 0

sound right for an NTFS drive? I can't see it, tried stopping and starting the xbmc-live service.
Personally, I'd use ntfs-3g instead of ntfs for the filesystem fstab entry. In my experience it tends to be a little more robust in handling NTFS filesystems and is easier to work with.

Code:
sudo get install ntfs-3g
Change /etc/fstab entry for your drive from ntfs to ntfs-3g

Also, you didn't specify a full mount path in your statement.

Instead of:
Code:
UUID=UUID-of-DRIVE / ntfs defaults 0 0
You want:
Code:
UUID=UUID-of-DRIVE /mount/point ntfs-3g defaults 0 0
Where /mount/point is where you want it mounted, you're trying to mount it on the root partition i.e. /. I'm not sure if that's going to work.
pumkinut Wrote:Personally, I'd use ntfs-3g instead of ntfs for the filesystem fstab entry. In my experience it tends to be a little more robust in handling NTFS filesystems and is easier to work with.

Code:
sudo get install ntfs-3g
Change /etc/fstab entry for your drive from ntfs to ntfs-3g

Also, you didn't specify a full mount path in your statement.

Instead of:
Code:
UUID=UUID-of-DRIVE / ntfs defaults 0 0
You want:
Code:
UUID=UUID-of-DRIVE /mount/point ntfs-3g defaults 0 0
Where /mount/point is where you want it mounted, you're trying to mount it on the root partition i.e. /. I'm not sure if that's going to work.

thanks for that, I did a little playing with the mount point last night and was still unsucessful. When mounting manually rather than in fstab I got:

Code:
xbmc@XBMCLive:/$ sudo mount -a
Failed to read last sector (3907027119): Invalid argument
HINTS: Either the volume is a RAID/LDM but it wasn't setup yet,
or it was not setup correctly (e.g. by not using mdadm --build ...),
or a wrong device is tried to be mounted,
or the partition table is corrupt (partition is smaller than NTFS),
or the NTFS boot sector is corrupt (NTFS size is not valid).
Failed to mount '/dev/sdb1': Invalid argument
The device '/dev/sdb1' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?