In udev, what kind of device events match ACTION==“change”?
The udev
rules I've created so far only deal with devices being added or removed, i.e.:
ACTION=="add"...
or ACTION=="remove"...
I've come across an example of a rule that seems to deal with device state changes as well:
ACTION=="add|change", KERNEL=="sd[b-z]", ATTR{queue/rotational}=="1", RUN+="/usr/bin/hdparm -B 127 -S 12 /dev/%k"
I take it that the above rule applies whenever a matching device is added OR its state changes.
Question: What kind of state changes are possible (generally and specific to a USB hard drive)?
I've checked all udev documentation I can find and there's barely any mention of, or usage guidance, in respect of device state changes or specifically ACTION="change"
.
udev devices
add a comment |
The udev
rules I've created so far only deal with devices being added or removed, i.e.:
ACTION=="add"...
or ACTION=="remove"...
I've come across an example of a rule that seems to deal with device state changes as well:
ACTION=="add|change", KERNEL=="sd[b-z]", ATTR{queue/rotational}=="1", RUN+="/usr/bin/hdparm -B 127 -S 12 /dev/%k"
I take it that the above rule applies whenever a matching device is added OR its state changes.
Question: What kind of state changes are possible (generally and specific to a USB hard drive)?
I've checked all udev documentation I can find and there's barely any mention of, or usage guidance, in respect of device state changes or specifically ACTION="change"
.
udev devices
add a comment |
The udev
rules I've created so far only deal with devices being added or removed, i.e.:
ACTION=="add"...
or ACTION=="remove"...
I've come across an example of a rule that seems to deal with device state changes as well:
ACTION=="add|change", KERNEL=="sd[b-z]", ATTR{queue/rotational}=="1", RUN+="/usr/bin/hdparm -B 127 -S 12 /dev/%k"
I take it that the above rule applies whenever a matching device is added OR its state changes.
Question: What kind of state changes are possible (generally and specific to a USB hard drive)?
I've checked all udev documentation I can find and there's barely any mention of, or usage guidance, in respect of device state changes or specifically ACTION="change"
.
udev devices
The udev
rules I've created so far only deal with devices being added or removed, i.e.:
ACTION=="add"...
or ACTION=="remove"...
I've come across an example of a rule that seems to deal with device state changes as well:
ACTION=="add|change", KERNEL=="sd[b-z]", ATTR{queue/rotational}=="1", RUN+="/usr/bin/hdparm -B 127 -S 12 /dev/%k"
I take it that the above rule applies whenever a matching device is added OR its state changes.
Question: What kind of state changes are possible (generally and specific to a USB hard drive)?
I've checked all udev documentation I can find and there's barely any mention of, or usage guidance, in respect of device state changes or specifically ACTION="change"
.
udev devices
udev devices
edited Nov 2 '15 at 23:42
misha256
asked Nov 2 '15 at 20:45
misha256misha256
192211
192211
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
"change" corresponds, for example, to removing or inserting an sdcard in a sdcard reader, or changing the hard disc inside a usb-to-sata enclosure. The device itself is not added nor removed, but the media is no longer the same.
add a comment |
udev change event gets triggered when media changer (regards to tape - Netbackup like environment) or sd card reader is used in continuation with different media or sd card. When a same device is re-added (a san disk is re-added again or you do switchdisable/enable on the switch side or target port disable/enable from target side )
Below are the few change udev events that we see on the host side, when I did target port disable (from Vexata VX100 array) for an existing san lun
KERNEL[34942.047543] change /devices/virtual/block/dm-0 (block)
KERNEL[34942.047596] change /devices/virtual/block/dm-1 (block)
KERNEL[34942.047613] change /devices/virtual/block/dm-2 (block)
KERNEL[34942.047631] change /devices/virtual/block/dm-3 (block)
KERNEL[34942.047678] change /devices/virtual/block/dm-4 (block)
UDEV [34942.053448] change /devices/virtual/block/dm-3 (block)
UDEV [34942.053486] change /devices/virtual/block/dm-4 (block)
UDEV [34942.053507] change /devices/virtual/block/dm-0 (block)
UDEV [34942.053536] change /devices/virtual/block/dm-2 (block)
New contributor
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f240353%2fin-udev-what-kind-of-device-events-match-action-change%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
"change" corresponds, for example, to removing or inserting an sdcard in a sdcard reader, or changing the hard disc inside a usb-to-sata enclosure. The device itself is not added nor removed, but the media is no longer the same.
add a comment |
"change" corresponds, for example, to removing or inserting an sdcard in a sdcard reader, or changing the hard disc inside a usb-to-sata enclosure. The device itself is not added nor removed, but the media is no longer the same.
add a comment |
"change" corresponds, for example, to removing or inserting an sdcard in a sdcard reader, or changing the hard disc inside a usb-to-sata enclosure. The device itself is not added nor removed, but the media is no longer the same.
"change" corresponds, for example, to removing or inserting an sdcard in a sdcard reader, or changing the hard disc inside a usb-to-sata enclosure. The device itself is not added nor removed, but the media is no longer the same.
answered Nov 3 '15 at 9:19
meuhmeuh
31.8k11854
31.8k11854
add a comment |
add a comment |
udev change event gets triggered when media changer (regards to tape - Netbackup like environment) or sd card reader is used in continuation with different media or sd card. When a same device is re-added (a san disk is re-added again or you do switchdisable/enable on the switch side or target port disable/enable from target side )
Below are the few change udev events that we see on the host side, when I did target port disable (from Vexata VX100 array) for an existing san lun
KERNEL[34942.047543] change /devices/virtual/block/dm-0 (block)
KERNEL[34942.047596] change /devices/virtual/block/dm-1 (block)
KERNEL[34942.047613] change /devices/virtual/block/dm-2 (block)
KERNEL[34942.047631] change /devices/virtual/block/dm-3 (block)
KERNEL[34942.047678] change /devices/virtual/block/dm-4 (block)
UDEV [34942.053448] change /devices/virtual/block/dm-3 (block)
UDEV [34942.053486] change /devices/virtual/block/dm-4 (block)
UDEV [34942.053507] change /devices/virtual/block/dm-0 (block)
UDEV [34942.053536] change /devices/virtual/block/dm-2 (block)
New contributor
add a comment |
udev change event gets triggered when media changer (regards to tape - Netbackup like environment) or sd card reader is used in continuation with different media or sd card. When a same device is re-added (a san disk is re-added again or you do switchdisable/enable on the switch side or target port disable/enable from target side )
Below are the few change udev events that we see on the host side, when I did target port disable (from Vexata VX100 array) for an existing san lun
KERNEL[34942.047543] change /devices/virtual/block/dm-0 (block)
KERNEL[34942.047596] change /devices/virtual/block/dm-1 (block)
KERNEL[34942.047613] change /devices/virtual/block/dm-2 (block)
KERNEL[34942.047631] change /devices/virtual/block/dm-3 (block)
KERNEL[34942.047678] change /devices/virtual/block/dm-4 (block)
UDEV [34942.053448] change /devices/virtual/block/dm-3 (block)
UDEV [34942.053486] change /devices/virtual/block/dm-4 (block)
UDEV [34942.053507] change /devices/virtual/block/dm-0 (block)
UDEV [34942.053536] change /devices/virtual/block/dm-2 (block)
New contributor
add a comment |
udev change event gets triggered when media changer (regards to tape - Netbackup like environment) or sd card reader is used in continuation with different media or sd card. When a same device is re-added (a san disk is re-added again or you do switchdisable/enable on the switch side or target port disable/enable from target side )
Below are the few change udev events that we see on the host side, when I did target port disable (from Vexata VX100 array) for an existing san lun
KERNEL[34942.047543] change /devices/virtual/block/dm-0 (block)
KERNEL[34942.047596] change /devices/virtual/block/dm-1 (block)
KERNEL[34942.047613] change /devices/virtual/block/dm-2 (block)
KERNEL[34942.047631] change /devices/virtual/block/dm-3 (block)
KERNEL[34942.047678] change /devices/virtual/block/dm-4 (block)
UDEV [34942.053448] change /devices/virtual/block/dm-3 (block)
UDEV [34942.053486] change /devices/virtual/block/dm-4 (block)
UDEV [34942.053507] change /devices/virtual/block/dm-0 (block)
UDEV [34942.053536] change /devices/virtual/block/dm-2 (block)
New contributor
udev change event gets triggered when media changer (regards to tape - Netbackup like environment) or sd card reader is used in continuation with different media or sd card. When a same device is re-added (a san disk is re-added again or you do switchdisable/enable on the switch side or target port disable/enable from target side )
Below are the few change udev events that we see on the host side, when I did target port disable (from Vexata VX100 array) for an existing san lun
KERNEL[34942.047543] change /devices/virtual/block/dm-0 (block)
KERNEL[34942.047596] change /devices/virtual/block/dm-1 (block)
KERNEL[34942.047613] change /devices/virtual/block/dm-2 (block)
KERNEL[34942.047631] change /devices/virtual/block/dm-3 (block)
KERNEL[34942.047678] change /devices/virtual/block/dm-4 (block)
UDEV [34942.053448] change /devices/virtual/block/dm-3 (block)
UDEV [34942.053486] change /devices/virtual/block/dm-4 (block)
UDEV [34942.053507] change /devices/virtual/block/dm-0 (block)
UDEV [34942.053536] change /devices/virtual/block/dm-2 (block)
New contributor
New contributor
answered 13 hours ago
Venfah NazirVenfah Nazir
112
112
New contributor
New contributor
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f240353%2fin-udev-what-kind-of-device-events-match-action-change%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown