From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Date: Mon, 01 Jun 2009 21:13:54 +0000 Subject: Re: Udev rule for external HD Message-Id: <20090601211354.GA28544@kroah.com> List-Id: References: <1f8bbe3c0906011354h475b065u8eec1eed9619f3f7@mail.gmail.com> In-Reply-To: <1f8bbe3c0906011354h475b065u8eec1eed9619f3f7@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Tue, Jun 02, 2009 at 02:24:35AM +0530, unni krishnan wrote: > Hello, > > I have written a udev rule to change the name of the external hard > disk to /dev/external. > > SUBSYSTEM="block", SUBSYSTEMS="scsi", ATTRS{model}="ST3120827AS", > NAME="external" > > The code is like the above. That works also. But the problem is that. > without that rule my device creates 2 device nodes. > > 1. sdb for the drive > 2. sdb1 for the one partition in it. > > The mount command without the rule will show that the device sdb1 is > mounted on /media. But after adding that rule only one device node is > created at /dev/external and there is no second device like I expected > ( ie /dev/external1 ). Why it is like that ? Any idea ? > > Is there anything wrong in my udev rule ? You shouldn't need it at all, just use the links in /dev/disk/ instead. You can label your partition "external" and then mount /dev/disk/by-label/external/ just fine. good luck, greg k-h