# udev: Why has OPTIONS="last_rule" been removed?

## fsavigny

Dear forum,

I am trying to write udev rules for my various external USB flash (pen) drives and hard disks. While I have now grasped how I always assign the same device node (or symlink) to any specific device, I have not yet figured out how to write "default" rules, in the following sense:

1st rule: if the device is my one and only USB Toshiba xxx hard drive with serial number 24F66G242, always create the symlink /dev/sd_my_toshiba%n

2nd rule: if it is any other USB block device, always create the symlink /dev/sd_anyother%n

I want the 2nd rule to be applied when the first rule does not apply, i.e. make it the default rule. But what happens is that the Toshiba will get assigned /dev/sd_my_toshiba%n AND /dev/sd_anyother%n, because obviously, it is also "any" USB block device (there seems no way of expressing "any other").

I have just found out that in the past, I could simply have added OPTIONS="last_rule" to the first rule, and then the second rule would not have been examined if the first rule matched. The whole WWW sphere seems to be happily using this option, even on recent pages. However, in the udev manpage on my system, "last_rule" does not figure, and the ChangeLog tells me that it has been removed as early as when the version changed from v146 to v147 (or something like that). I'm currently on v171-r9.

Is there any way to get "last_rule" back? Or is there any other way to achieve what I want?

Thanks so much in advance,

Florian

----------

## PaulBredbury

Can use GOTO. Some examples:

```
grep GOTO /lib/udev/rules.d/*
```

----------

## fsavigny

Thank you so much!

I realize that OPTIONS="last_rule" can be emulated with GOTO="end", provided there is a LABEL="end" in the end.

It's strange they don't mention this in the manpage, since so much advice on the web mentions OPTIONS="last_rule".

Again, thanks a much! You solved a very annoying problem for me.

Florian

----------

