Kodi Community Forum

Full Version: Mounting external hard drive
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I am having a problem that I hope someone with unix skills can help with!

I have an external hdd that holds all my media. If I boot my Revo htpc with it plugged in, it will mount to /media/sdb1/ but if I plug it in while running, it will mount to /media/Passport, so whichever way the media has been added to the library, it may or may not still be at that location when next used.

Does anyone know how to mount this to a consistent location?

Thanks,

Mark
Hey check my post on how to automount from fstab here: http://forum.xbmc.org/showpost.php?p=577...stcount=12

If you edit fstab to mount your drive at /media/Passport, then it ought to mount at the same location everytime whether plugged in at boot or not.
Hi, I dont know exactly if it is the same problem, but I will try to explain.

I use a normal installation of Ubuntu 10.04 with XBMC SVN. But external drives, not matter if Fat32 or NTFS, doesnt get recognized within XBMC.

In Gnome everything is fine.

BUT: If I first connect the external in Gnome an THEN start XBMC I see the drives in "Video".
Hi, thanks for your reply.

I have given it a read, but I now have a problem I cannot get my head around..

The drive is currently mounted to /media/Passport. It is not quite as clear when it mounts to either location. the command 'ls /media/sdb1' doesn't return anything though. running 'ls -l /dev/disk/by-uuid' gives 5 locations found, but none of which are '/media/Passport'.

It does list '../../sdb1', but the UUID does not look like the others - it is a 16 digit hex string, no dashes.

Do you have any ideas what could be going on?!

Thanks.

Mark
Sorry sylvio, just saw your reply. The drive always mounts, just not always in the same place.
Yeah I'm guessing your drive is formatted to NTFS. FAT and NTFS filesystems do not actually support UUID really, so they're given a "fake" one when mounted on a Linux system. FAT gets an 8 digit code, NTFS gets a 16 digit. It should still work the same, but you need to make your fstab line look like this:

Code:
UUID=xxxxxxxxxxxxxxxx   /media/Passport  ntfs  defaults  0 1

I'm not sure how Ubuntu handles this (which is what's running underneath the XBMC live) but with any bit of luck this should work just fine. If you do have problems let me know, it'll most likely be read/write or permission problems and they are fixable.

/media/Passport won't show in /dev/disk-by-uuid since it's just a label used by sdb1. If you are sure sdb1 is the correct disk, use that. You can do a "ls -l /dev/disk/by-label" to see what labels are assigned to what disks.
Hi, Thanks for another helpful reply!

It is indeed ntfs! So that is comforting that it is not a problem!

It does appear that Passport is assigned to ../../sdb1, which is good. It just seems strange that I cannot currently access it through sdb1..

So this may be a silly question.. but am I best to mount it in fstab as Passport or sdb1?

Thanks,

Mark
Also, I assume the UUID will always be the same for the drive, even though it is not a part of the file system? Will this be the same across devices?

Thanks again!

Mark
Sorry, me again!!

I also noticed that you recommend ext4.. I use ntfs for the media drive, since I transfer the data from xp, but for the main partition, is it worth changing to ext4 - will this make boot/operation quicker?

Is it possible to check what partition each drive uses now? And is it possible to change this without a complete format, losing the data?

Sorry - a bit of a barrage of messages!

Mark
markh86 Wrote:Hi, Thanks for another helpful reply!

It is indeed ntfs! So that is comforting that it is not a problem!

It does appear that Passport is assigned to ../../sdb1, which is good. It just seems strange that I cannot currently access it through sdb1..

So this may be a silly question.. but am I best to mount it in fstab as Passport or sdb1?

Devices under /dev are all devices seen by your system when you boot, even those that are not mounted. Devices under /media (and /mnt) are those that are currently mounted and accessible by your session. So sdb1 can still be known by your system without being mounted in /media.

You are better off setting your drive to mount at /media/Passport if that is where it mounts when you plug it in while your system is running. fstab entries are only mounted during boot (or if you manually run "mount -a") so if you always want the drive to mount at the same location tell fstab to mount it where it also mounts when hotplugged (which would be /media/Passport).

markh86 Wrote:Also, I assume the UUID will always be the same for the drive, even though it is not a part of the file system? Will this be the same across devices?

UUID is always the same. On ext filesystems it is stored within the device when you format it so it will always be the same even if you move it to another computer. Your ntfs UUID is stored somewhere on your computer since it isn't a real UUID, so it will always be consistent on that one computer but not if you move the drive to another machine. At least I don't think so, though I have never actually tried it.

markh86 Wrote:Sorry, me again!!

I also noticed that you recommend ext4.. I use ntfs for the media drive, since I transfer the data from xp, but for the main partition, is it worth changing to ext4 - will this make boot/operation quicker?

Is it possible to check what partition each drive uses now? And is it possible to change this without a complete format, losing the data?

There's no way you can reformat a ntfs drive to ext4 without loosing what data is already on it. Also I doubt Windows will be able to read it, of course. If you installed the latest live cd of XBMC I'm pretty sure your main partition is already ext4.

Running "sudo parted -l" shoudl give you pretty detailed info on all your partitions.

Hope it helps.
Thanks a lot for all your help! It looks like it fixed it!

All your help is much appreciated!

Mark
Can you explain what you did to resolve this? I am having the same problem.

Would like it to always mount in the same place, not fussed where as long as I can tell XBMC where to look for the files.
I do not have access to my system for a couple of weeks, but I followed the advice above. It was an fstab issue. Simply adding this, as described in the above posts should do it. Get the UUID and add it to fstab. If you have a specific problem, I will try to help or I am sure that someone more knowledgeable here can help!

Mark
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=-