VMware Cloud Community
wilhelmnetworks
Contributor
Contributor

ESX 4 and USB Hard Drives

Hi,

This is probably more of a general Linux question, but here's the deal...

I've connected an external 1TB USB HDD to an ESX host to move certian files off site from time to time. Connect the drive, mount to a predefined mount point, copy, umount, move drive off site. This works fine.

My issue is that I would like to script the actions, but every time I connect the USB drive it is assigned a different file in the /dev folder. First connect, the drive is /dev/sdc. second, /dev/sdd, then /dev/sde and so on.

How can I fix this so that the USB drive is always assigned the same file under /dev? Is this possible? I'm not a scripting expert (nor am I a Linux expert) by any means, so possibly there is a way to mount the drive to the mount point no matter what the drive is under /dev?

0 Kudos
2 Replies
AndreTheGiant
Immortal
Immortal

I suppose that you are use a ext2/ext3 filesystem, cause FAT has the limit of the file size.

In this case you can use mount with the UUID or the VOLUME mode.

For the UUID mode just have a look at your /etc/fstab file.

Andre

Andrew | http://about.me/amauro | http://vinfrastructure.it/ | @Andrea_Mauro
0 Kudos
Texiwill
Leadership
Leadership

Hello,

For each USB disk there is a UID associated with it, this UID is used by udev to assign a drive letter. If the UID is changed (i.e. reformating can do this) then udev will assign a new drive letter.

Look in /etc/udev/rules.d for something referring to /dev/sdd, etc. to debug. Sounds like a new rule is being created as it does not recognize something it should. Also remember, that the USB is being passed to the SC via the vmkernel and that could actually strip things out as well.

I have yet to try this, but this is what happens within Linux with relation to driver lettering, etc.


Best regards,
Edward L. Haletky VMware Communities User Moderator, VMware vExpert 2009

Virtualization Practice Analyst[/url]
Now Available: 'VMware vSphere(TM) and Virtual Infrastructure Security'[/url]
Also available 'VMWare ESX Server in the Enterprise'[/url]
[url=http://www.astroarch.com/wiki/index.php/Blog_Roll]SearchVMware Pro[/url]|Blue Gears[/url]|Top Virtualization Security Links[/url]|
[url=http://www.astroarch.com/wiki/index.php/Virtualization_Security_Round_Table_Podcast]Virtualization Security Round Table Podcast[/url]

--
Edward L. Haletky
vExpert XIV: 2009-2023,
VMTN Community Moderator
vSphere Upgrade Saga: https://www.astroarch.com/blogs
GitHub Repo: https://github.com/Texiwill
0 Kudos