How to remove a block device from lsblk list on CentOS 7?
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
Here is my lsblk -a
list:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 10G 0 disk
âÂÂâÂÂsda1 8:1 0 1G 0 part /boot
âÂÂâÂÂsda2 8:2 0 9G 0 part
âÂÂâÂÂcl-root 253:0 0 8G 0 lvm /
âÂÂâÂÂcl-swap 253:1 0 1G 0 lvm [SWAP]
sdb 8:32 0 16G 0 disk
sr0 11:0 1 1024M 0 rom
drbd0 147:0 0 2G 0 disk
I want to remove drbd0
. How to do?
centos hard-disk disk block-device delete
add a comment |Â
up vote
2
down vote
favorite
Here is my lsblk -a
list:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 10G 0 disk
âÂÂâÂÂsda1 8:1 0 1G 0 part /boot
âÂÂâÂÂsda2 8:2 0 9G 0 part
âÂÂâÂÂcl-root 253:0 0 8G 0 lvm /
âÂÂâÂÂcl-swap 253:1 0 1G 0 lvm [SWAP]
sdb 8:32 0 16G 0 disk
sr0 11:0 1 1024M 0 rom
drbd0 147:0 0 2G 0 disk
I want to remove drbd0
. How to do?
centos hard-disk disk block-device delete
Have you try to stop drdb daemon?
â Romeo Ninov
Jul 21 '17 at 8:45
@RomeoNinov Yes. After I ransystemctl stop drbd
and checklsblk -a
again,drbd0
also exists.
â cloud_cloud
Jul 21 '17 at 8:48
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
Here is my lsblk -a
list:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 10G 0 disk
âÂÂâÂÂsda1 8:1 0 1G 0 part /boot
âÂÂâÂÂsda2 8:2 0 9G 0 part
âÂÂâÂÂcl-root 253:0 0 8G 0 lvm /
âÂÂâÂÂcl-swap 253:1 0 1G 0 lvm [SWAP]
sdb 8:32 0 16G 0 disk
sr0 11:0 1 1024M 0 rom
drbd0 147:0 0 2G 0 disk
I want to remove drbd0
. How to do?
centos hard-disk disk block-device delete
Here is my lsblk -a
list:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 10G 0 disk
âÂÂâÂÂsda1 8:1 0 1G 0 part /boot
âÂÂâÂÂsda2 8:2 0 9G 0 part
âÂÂâÂÂcl-root 253:0 0 8G 0 lvm /
âÂÂâÂÂcl-swap 253:1 0 1G 0 lvm [SWAP]
sdb 8:32 0 16G 0 disk
sr0 11:0 1 1024M 0 rom
drbd0 147:0 0 2G 0 disk
I want to remove drbd0
. How to do?
centos hard-disk disk block-device delete
centos hard-disk disk block-device delete
edited Jul 21 '17 at 12:39
sourcejedi
20.9k43092
20.9k43092
asked Jul 21 '17 at 8:37
cloud_cloud
13927
13927
Have you try to stop drdb daemon?
â Romeo Ninov
Jul 21 '17 at 8:45
@RomeoNinov Yes. After I ransystemctl stop drbd
and checklsblk -a
again,drbd0
also exists.
â cloud_cloud
Jul 21 '17 at 8:48
add a comment |Â
Have you try to stop drdb daemon?
â Romeo Ninov
Jul 21 '17 at 8:45
@RomeoNinov Yes. After I ransystemctl stop drbd
and checklsblk -a
again,drbd0
also exists.
â cloud_cloud
Jul 21 '17 at 8:48
Have you try to stop drdb daemon?
â Romeo Ninov
Jul 21 '17 at 8:45
Have you try to stop drdb daemon?
â Romeo Ninov
Jul 21 '17 at 8:45
@RomeoNinov Yes. After I ran
systemctl stop drbd
and check lsblk -a
again, drbd0
also exists.â cloud_cloud
Jul 21 '17 at 8:48
@RomeoNinov Yes. After I ran
systemctl stop drbd
and check lsblk -a
again, drbd0
also exists.â cloud_cloud
Jul 21 '17 at 8:48
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
2
down vote
accepted
rm
'ing nodes in /dev/
will not do what I suggested and remove the DRBD device. E.g. you should see that the kernel view of block devices in /sys/class/block
is not affected by such changes.
Removing the device node will hide it from lsblk, but it would not cause any claimed resources to be released! This seems like a bad idea.
Rebooting should remove any weird DRBD devices that you're not using any more. (E.g. removed from drbd config, but still exist for some unknown reason).
"module load/unload" would be a way to avoid a reboot, if that's what you wanted. modprobe -r drbd
to unload. It would require that you have no other DRBD devices in use.
If you believed the drbd daemon was messing around with creating or renaming devices in /dev
at the same time as udev
/ devtmpfs
is running, and genuinely had a bug which left behind a stale device node (and some stale cache in lsblk
), then you'd better do a full reboot to clear up the mess. Because that would be some really broken software, nothing should be doing that anymore.
deleting anything in dev falls into the "don't unless you know better" category. In many years of linux use, I've never known better.
â Dan Farrell
1 hour ago
@DanFarrell I guess you've never typo'ed the destination of add
command then :-P.
â sourcejedi
3 mins ago
add a comment |Â
up vote
2
down vote
As you have stopped drdb
you may want to check the thread and follow the recommendation and just remove the device file in /dev
. Here is extract from the mentioned page:
and we also have the drbd device in /dev/ directory, we want to delete
de drbd1 from /dev.
brw-rw---- 1 root disk 147, 0 2009-03-18 15:34 /dev/drbd0
brw-rw---- 1 root disk 147, 1 2009-03-18 15:34 /dev/drbd1
brw-rw---- 1 root disk 147, 2 2009-03-18 15:34 /dev/drbd2
brw-rw---- 1 root disk 147, 3 2009-03-18 15:41 /dev/drbd3
brw-rw---- 1 root disk 147, 4 2009-03-18 15:41 /dev/drbd4
you can of course delete the device nodes, if it makes you happy. only
it won't magically re-appear in case you want to use it again, (unless
you do a reboot or module unload/load). so you would need to mknod it
again, if you need it again.
add a comment |Â
up vote
1
down vote
lsblk
has a -e
option to exclude devices by major device numbers.
The drbd devices in your lsblk
output above have a major number of 147, so this will exclude them from the list:
lsblk -a -e 147
This will not remove any drbd device nodes from your system or interact in any way with the DRBD service, it will just exclude the drbd devices from lsblk
's output.
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
rm
'ing nodes in /dev/
will not do what I suggested and remove the DRBD device. E.g. you should see that the kernel view of block devices in /sys/class/block
is not affected by such changes.
Removing the device node will hide it from lsblk, but it would not cause any claimed resources to be released! This seems like a bad idea.
Rebooting should remove any weird DRBD devices that you're not using any more. (E.g. removed from drbd config, but still exist for some unknown reason).
"module load/unload" would be a way to avoid a reboot, if that's what you wanted. modprobe -r drbd
to unload. It would require that you have no other DRBD devices in use.
If you believed the drbd daemon was messing around with creating or renaming devices in /dev
at the same time as udev
/ devtmpfs
is running, and genuinely had a bug which left behind a stale device node (and some stale cache in lsblk
), then you'd better do a full reboot to clear up the mess. Because that would be some really broken software, nothing should be doing that anymore.
deleting anything in dev falls into the "don't unless you know better" category. In many years of linux use, I've never known better.
â Dan Farrell
1 hour ago
@DanFarrell I guess you've never typo'ed the destination of add
command then :-P.
â sourcejedi
3 mins ago
add a comment |Â
up vote
2
down vote
accepted
rm
'ing nodes in /dev/
will not do what I suggested and remove the DRBD device. E.g. you should see that the kernel view of block devices in /sys/class/block
is not affected by such changes.
Removing the device node will hide it from lsblk, but it would not cause any claimed resources to be released! This seems like a bad idea.
Rebooting should remove any weird DRBD devices that you're not using any more. (E.g. removed from drbd config, but still exist for some unknown reason).
"module load/unload" would be a way to avoid a reboot, if that's what you wanted. modprobe -r drbd
to unload. It would require that you have no other DRBD devices in use.
If you believed the drbd daemon was messing around with creating or renaming devices in /dev
at the same time as udev
/ devtmpfs
is running, and genuinely had a bug which left behind a stale device node (and some stale cache in lsblk
), then you'd better do a full reboot to clear up the mess. Because that would be some really broken software, nothing should be doing that anymore.
deleting anything in dev falls into the "don't unless you know better" category. In many years of linux use, I've never known better.
â Dan Farrell
1 hour ago
@DanFarrell I guess you've never typo'ed the destination of add
command then :-P.
â sourcejedi
3 mins ago
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
rm
'ing nodes in /dev/
will not do what I suggested and remove the DRBD device. E.g. you should see that the kernel view of block devices in /sys/class/block
is not affected by such changes.
Removing the device node will hide it from lsblk, but it would not cause any claimed resources to be released! This seems like a bad idea.
Rebooting should remove any weird DRBD devices that you're not using any more. (E.g. removed from drbd config, but still exist for some unknown reason).
"module load/unload" would be a way to avoid a reboot, if that's what you wanted. modprobe -r drbd
to unload. It would require that you have no other DRBD devices in use.
If you believed the drbd daemon was messing around with creating or renaming devices in /dev
at the same time as udev
/ devtmpfs
is running, and genuinely had a bug which left behind a stale device node (and some stale cache in lsblk
), then you'd better do a full reboot to clear up the mess. Because that would be some really broken software, nothing should be doing that anymore.
rm
'ing nodes in /dev/
will not do what I suggested and remove the DRBD device. E.g. you should see that the kernel view of block devices in /sys/class/block
is not affected by such changes.
Removing the device node will hide it from lsblk, but it would not cause any claimed resources to be released! This seems like a bad idea.
Rebooting should remove any weird DRBD devices that you're not using any more. (E.g. removed from drbd config, but still exist for some unknown reason).
"module load/unload" would be a way to avoid a reboot, if that's what you wanted. modprobe -r drbd
to unload. It would require that you have no other DRBD devices in use.
If you believed the drbd daemon was messing around with creating or renaming devices in /dev
at the same time as udev
/ devtmpfs
is running, and genuinely had a bug which left behind a stale device node (and some stale cache in lsblk
), then you'd better do a full reboot to clear up the mess. Because that would be some really broken software, nothing should be doing that anymore.
edited 2 mins ago
answered Jul 21 '17 at 12:11
sourcejedi
20.9k43092
20.9k43092
deleting anything in dev falls into the "don't unless you know better" category. In many years of linux use, I've never known better.
â Dan Farrell
1 hour ago
@DanFarrell I guess you've never typo'ed the destination of add
command then :-P.
â sourcejedi
3 mins ago
add a comment |Â
deleting anything in dev falls into the "don't unless you know better" category. In many years of linux use, I've never known better.
â Dan Farrell
1 hour ago
@DanFarrell I guess you've never typo'ed the destination of add
command then :-P.
â sourcejedi
3 mins ago
deleting anything in dev falls into the "don't unless you know better" category. In many years of linux use, I've never known better.
â Dan Farrell
1 hour ago
deleting anything in dev falls into the "don't unless you know better" category. In many years of linux use, I've never known better.
â Dan Farrell
1 hour ago
@DanFarrell I guess you've never typo'ed the destination of a
dd
command then :-P.â sourcejedi
3 mins ago
@DanFarrell I guess you've never typo'ed the destination of a
dd
command then :-P.â sourcejedi
3 mins ago
add a comment |Â
up vote
2
down vote
As you have stopped drdb
you may want to check the thread and follow the recommendation and just remove the device file in /dev
. Here is extract from the mentioned page:
and we also have the drbd device in /dev/ directory, we want to delete
de drbd1 from /dev.
brw-rw---- 1 root disk 147, 0 2009-03-18 15:34 /dev/drbd0
brw-rw---- 1 root disk 147, 1 2009-03-18 15:34 /dev/drbd1
brw-rw---- 1 root disk 147, 2 2009-03-18 15:34 /dev/drbd2
brw-rw---- 1 root disk 147, 3 2009-03-18 15:41 /dev/drbd3
brw-rw---- 1 root disk 147, 4 2009-03-18 15:41 /dev/drbd4
you can of course delete the device nodes, if it makes you happy. only
it won't magically re-appear in case you want to use it again, (unless
you do a reboot or module unload/load). so you would need to mknod it
again, if you need it again.
add a comment |Â
up vote
2
down vote
As you have stopped drdb
you may want to check the thread and follow the recommendation and just remove the device file in /dev
. Here is extract from the mentioned page:
and we also have the drbd device in /dev/ directory, we want to delete
de drbd1 from /dev.
brw-rw---- 1 root disk 147, 0 2009-03-18 15:34 /dev/drbd0
brw-rw---- 1 root disk 147, 1 2009-03-18 15:34 /dev/drbd1
brw-rw---- 1 root disk 147, 2 2009-03-18 15:34 /dev/drbd2
brw-rw---- 1 root disk 147, 3 2009-03-18 15:41 /dev/drbd3
brw-rw---- 1 root disk 147, 4 2009-03-18 15:41 /dev/drbd4
you can of course delete the device nodes, if it makes you happy. only
it won't magically re-appear in case you want to use it again, (unless
you do a reboot or module unload/load). so you would need to mknod it
again, if you need it again.
add a comment |Â
up vote
2
down vote
up vote
2
down vote
As you have stopped drdb
you may want to check the thread and follow the recommendation and just remove the device file in /dev
. Here is extract from the mentioned page:
and we also have the drbd device in /dev/ directory, we want to delete
de drbd1 from /dev.
brw-rw---- 1 root disk 147, 0 2009-03-18 15:34 /dev/drbd0
brw-rw---- 1 root disk 147, 1 2009-03-18 15:34 /dev/drbd1
brw-rw---- 1 root disk 147, 2 2009-03-18 15:34 /dev/drbd2
brw-rw---- 1 root disk 147, 3 2009-03-18 15:41 /dev/drbd3
brw-rw---- 1 root disk 147, 4 2009-03-18 15:41 /dev/drbd4
you can of course delete the device nodes, if it makes you happy. only
it won't magically re-appear in case you want to use it again, (unless
you do a reboot or module unload/load). so you would need to mknod it
again, if you need it again.
As you have stopped drdb
you may want to check the thread and follow the recommendation and just remove the device file in /dev
. Here is extract from the mentioned page:
and we also have the drbd device in /dev/ directory, we want to delete
de drbd1 from /dev.
brw-rw---- 1 root disk 147, 0 2009-03-18 15:34 /dev/drbd0
brw-rw---- 1 root disk 147, 1 2009-03-18 15:34 /dev/drbd1
brw-rw---- 1 root disk 147, 2 2009-03-18 15:34 /dev/drbd2
brw-rw---- 1 root disk 147, 3 2009-03-18 15:41 /dev/drbd3
brw-rw---- 1 root disk 147, 4 2009-03-18 15:41 /dev/drbd4
you can of course delete the device nodes, if it makes you happy. only
it won't magically re-appear in case you want to use it again, (unless
you do a reboot or module unload/load). so you would need to mknod it
again, if you need it again.
answered Jul 21 '17 at 10:03
Romeo Ninov
4,48321625
4,48321625
add a comment |Â
add a comment |Â
up vote
1
down vote
lsblk
has a -e
option to exclude devices by major device numbers.
The drbd devices in your lsblk
output above have a major number of 147, so this will exclude them from the list:
lsblk -a -e 147
This will not remove any drbd device nodes from your system or interact in any way with the DRBD service, it will just exclude the drbd devices from lsblk
's output.
add a comment |Â
up vote
1
down vote
lsblk
has a -e
option to exclude devices by major device numbers.
The drbd devices in your lsblk
output above have a major number of 147, so this will exclude them from the list:
lsblk -a -e 147
This will not remove any drbd device nodes from your system or interact in any way with the DRBD service, it will just exclude the drbd devices from lsblk
's output.
add a comment |Â
up vote
1
down vote
up vote
1
down vote
lsblk
has a -e
option to exclude devices by major device numbers.
The drbd devices in your lsblk
output above have a major number of 147, so this will exclude them from the list:
lsblk -a -e 147
This will not remove any drbd device nodes from your system or interact in any way with the DRBD service, it will just exclude the drbd devices from lsblk
's output.
lsblk
has a -e
option to exclude devices by major device numbers.
The drbd devices in your lsblk
output above have a major number of 147, so this will exclude them from the list:
lsblk -a -e 147
This will not remove any drbd device nodes from your system or interact in any way with the DRBD service, it will just exclude the drbd devices from lsblk
's output.
answered Jul 22 '17 at 4:03
cas
38k44696
38k44696
add a comment |Â
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f379900%2fhow-to-remove-a-block-device-from-lsblk-list-on-centos-7%23new-answer', 'question_page');
);
Post as a guest
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
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
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
Have you try to stop drdb daemon?
â Romeo Ninov
Jul 21 '17 at 8:45
@RomeoNinov Yes. After I ran
systemctl stop drbd
and checklsblk -a
again,drbd0
also exists.â cloud_cloud
Jul 21 '17 at 8:48