* disk/by-label + label-change
@ 2006-12-12 15:36 T. Horsnell
2006-12-12 15:55 ` Kay Sievers
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: T. Horsnell @ 2006-12-12 15:36 UTC (permalink / raw)
To: linux-hotplug
If a disk with a persistence-entry in /dev/disk/by-label
is re-labelled with tune2fs, the by-label entry isnt
updated to match the new label and when the disk is mounted
with a 'mount -L ', the mounted-device shows up as something
like:
[root@dev1 ~]# mount
/dev/hdb2 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,modeb0)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
>>>> /dev/.tmp-8-17 on /test type ext3 (rw)
Is this as it should be?
Thanks,
Terry
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: disk/by-label + label-change
2006-12-12 15:36 disk/by-label + label-change T. Horsnell
@ 2006-12-12 15:55 ` Kay Sievers
2006-12-12 17:51 ` T. Horsnell
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Kay Sievers @ 2006-12-12 15:55 UTC (permalink / raw)
To: linux-hotplug
On 12/12/06, T. Horsnell <tsh@mrc-lmb.cam.ac.uk> wrote:
> If a disk with a persistence-entry in /dev/disk/by-label
> is re-labelled with tune2fs, the by-label entry isnt
> updated to match the new label and when the disk is mounted
> with a 'mount -L ',
You are writing to a raw sector of the disk, no part of the system
will notice that you did this and have changed something. You need to
tell the kernel to emit an event by doing:
echo "add" > /sys/block/sda/uevent
and the link will get updated.
> the mounted-device shows up as something
> like:
>
> [root@dev1 ~]# mount
> /dev/hdb2 on / type ext3 (rw)
> proc on /proc type proc (rw)
> sysfs on /sys type sysfs (rw)
> devpts on /dev/pts type devpts (rw,gid=5,modeb0)
> tmpfs on /dev/shm type tmpfs (rw)
> none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
> sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
> >>>> /dev/.tmp-8-17 on /test type ext3 (rw)
>
> Is this as it should be?
Looks like you mounted the device with a PROGRAM rule, right? This is
definitely not what it "should be". :)
Kay
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: disk/by-label + label-change
2006-12-12 15:36 disk/by-label + label-change T. Horsnell
2006-12-12 15:55 ` Kay Sievers
@ 2006-12-12 17:51 ` T. Horsnell
2006-12-12 18:34 ` Kay Sievers
2006-12-13 15:36 ` T. Horsnell
3 siblings, 0 replies; 5+ messages in thread
From: T. Horsnell @ 2006-12-12 17:51 UTC (permalink / raw)
To: linux-hotplug
>On 12/12/06, T. Horsnell <tsh@mrc-lmb.cam.ac.uk> wrote:
>> If a disk with a persistence-entry in /dev/disk/by-label
>> is re-labelled with tune2fs, the by-label entry isnt
>> updated to match the new label and when the disk is mounted
>> with a 'mount -L ',
>
>You are writing to a raw sector of the disk, no part of the system
>will notice that you did this and have changed something. You need to
>tell the kernel to emit an event by doing:
> echo "add" > /sys/block/sda/uevent
>and the link will get updated.
OK, thanks. But shouldnt tune2fs do this when it updates the label?
I guess I should make my own tune2fs script and do it there.
>
>> the mounted-device shows up as something
>> like:
>>
>> [root@dev1 ~]# mount
>> /dev/hdb2 on / type ext3 (rw)
>> proc on /proc type proc (rw)
>> sysfs on /sys type sysfs (rw)
>> devpts on /dev/pts type devpts (rw,gid=5,modeb0)
>> tmpfs on /dev/shm type tmpfs (rw)
>> none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
>> sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
>> >>>> /dev/.tmp-8-17 on /test type ext3 (rw)
>>
>> Is this as it should be?
>
>Looks like you mounted the device with a PROGRAM rule, right? This is
>definitely not what it "should be". :)
I do no mounting in udev, its all in fstab. I never thought to
do it in a udev PROGRAM rule...
I'm experimenting with stuff at the moment, prior to setting up
a set of rules for my production box. I currently use things like
echo "scsi add-single-device BUSNO 0 UNITNO 0" > /proc/scsi/scsi
echo "scsi remove-single-device BUSNO 0 UNITNO 0" > /proc/scsi/scsi
in conjunction with a site-specific rules file to play with individual
scsi disks on a running system.
I mounted it with:
mount -L whatever /test
Cheers,
Terry
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: disk/by-label + label-change
2006-12-12 15:36 disk/by-label + label-change T. Horsnell
2006-12-12 15:55 ` Kay Sievers
2006-12-12 17:51 ` T. Horsnell
@ 2006-12-12 18:34 ` Kay Sievers
2006-12-13 15:36 ` T. Horsnell
3 siblings, 0 replies; 5+ messages in thread
From: Kay Sievers @ 2006-12-12 18:34 UTC (permalink / raw)
To: linux-hotplug
On Tue, 2006-12-12 at 17:51 +0000, T. Horsnell wrote:
> >On 12/12/06, T. Horsnell <tsh@mrc-lmb.cam.ac.uk> wrote:
> >> If a disk with a persistence-entry in /dev/disk/by-label
> >> is re-labelled with tune2fs, the by-label entry isnt
> >> updated to match the new label and when the disk is mounted
> >> with a 'mount -L ',
> >
> >You are writing to a raw sector of the disk, no part of the system
> >will notice that you did this and have changed something. You need to
> >tell the kernel to emit an event by doing:
> > echo "add" > /sys/block/sda/uevent
> >and the link will get updated.
>
> OK, thanks. But shouldnt tune2fs do this when it updates the label?
> I guess I should make my own tune2fs script and do it there.
Right, that shouldn't be part of the tool that writes to the disk, it
can't know if it's safe to update the links.
> >> the mounted-device shows up as something
> >> like:
> >>
> >> [root@dev1 ~]# mount
> >> /dev/hdb2 on / type ext3 (rw)
> >> proc on /proc type proc (rw)
> >> sysfs on /sys type sysfs (rw)
> >> devpts on /dev/pts type devpts (rw,gid=5,modeb0)
> >> tmpfs on /dev/shm type tmpfs (rw)
> >> none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
> >> sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
> >> >>>> /dev/.tmp-8-17 on /test type ext3 (rw)
> >>
> >> Is this as it should be?
> >
> >Looks like you mounted the device with a PROGRAM rule, right? This is
> >definitely not what it "should be". :)
>
> I do no mounting in udev, its all in fstab. I never thought to
> do it in a udev PROGRAM rule...
But who is using udev's temporary device node for mount then?
/dev/.tmp-8-17 on /test type ext3 (rw)
That usually only exists during the udev event processing.
Kay
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: disk/by-label + label-change
2006-12-12 15:36 disk/by-label + label-change T. Horsnell
` (2 preceding siblings ...)
2006-12-12 18:34 ` Kay Sievers
@ 2006-12-13 15:36 ` T. Horsnell
3 siblings, 0 replies; 5+ messages in thread
From: T. Horsnell @ 2006-12-13 15:36 UTC (permalink / raw)
To: linux-hotplug
Sorry - forgot to CC: the list.
>On Tue, 2006-12-12 at 17:51 +0000, T. Horsnell wrote:
>> >On 12/12/06, T. Horsnell <tsh@mrc-lmb.cam.ac.uk> wrote:
>> >> If a disk with a persistence-entry in /dev/disk/by-label
>> >> is re-labelled with tune2fs, the by-label entry isnt
>> >> updated to match the new label and when the disk is mounted
>> >> with a 'mount -L ',
>> >
>> >You are writing to a raw sector of the disk, no part of the system
>> >will notice that you did this and have changed something. You need to
>> >tell the kernel to emit an event by doing:
>> > echo "add" > /sys/block/sda/uevent
>> >and the link will get updated.
>>
>> OK, thanks. But shouldnt tune2fs do this when it updates the label?
>> I guess I should make my own tune2fs script and do it there.
>
>Right, that shouldn't be part of the tool that writes to the disk, it
>can't know if it's safe to update the links.
>
>> >> the mounted-device shows up as something
>> >> like:
>> >>
>> >> [root@dev1 ~]# mount
>> >> /dev/hdb2 on / type ext3 (rw)
>> >> proc on /proc type proc (rw)
>> >> sysfs on /sys type sysfs (rw)
>> >> devpts on /dev/pts type devpts (rw,gid=5,modeb0)
>> >> tmpfs on /dev/shm type tmpfs (rw)
>> >> none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
>> >> sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
>> >> >>>> /dev/.tmp-8-17 on /test type ext3 (rw)
>> >>
>> >> Is this as it should be?
>> >
>> >Looks like you mounted the device with a PROGRAM rule, right? This is
>> >definitely not what it "should be". :)
>>
>> I do no mounting in udev, its all in fstab. I never thought to
>> do it in a udev PROGRAM rule...
>
>But who is using udev's temporary device node for mount then?
> /dev/.tmp-8-17 on /test type ext3 (rw)
>
>That usually only exists during the udev event processing.
Hmm. Of course, I cant reproduce this.
But would you mind a related question? The reason I'm doing
all this stuff is because of an NFS problem associated
with moving disks around on the SCSI bus.
I have a fileserver which NFS-exports a bunch of filesystems
to a compute farm. The compute farm clients mount these with
the 'hard' option so that they stall if they try and make NFS
requests while the server is offline.
From time-to-time I make changes in the SCSI configuration
of the server (like moving a SCSI shelf to a different SCSI
adapter).
Without udev persistence rules, the /dev/sdN device for
the SCSI disks may change as a result of the shuffle, and
my farm clients then sometimes mistakenly access the filesystem
on the *old* /dev/sdN. There are no NFS errors, just wrong
filesystem contents. I cant use the /dev/disk/by-whatever
symlinks because they resolve to the changing /dev/sdN
So I make persistence rules such that my disks *always* mount
on the same /dev/dskN regardless of where they are on the bus,
but then NFS complains of a 'stale filehandle' if server filesystems
are moved around. This is a bit better than continuing with the wrong
data, but it would be best if NFS knew that the disk was the same
disk, even tho it was on a different SCSi bus/slot in the server.
Should this be possible with persistent device names?
Thanks,
Terry
>
>Kay
>
>
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-12-13 15:36 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-12 15:36 disk/by-label + label-change T. Horsnell
2006-12-12 15:55 ` Kay Sievers
2006-12-12 17:51 ` T. Horsnell
2006-12-12 18:34 ` Kay Sievers
2006-12-13 15:36 ` T. Horsnell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox