Unable to remove stale volumeLVM2 can not wake up suspended logical volumeafter adding one more physical volume and enlarging logical volume, grub failsWhy my encrypted LVM volume (LUKS device) won't mount at boot time?device mapper on RHEL6 unable to create devs for LVM logical volumeLVM - failed to install bootloaderMount encrypted volume in DebianLogical Volumes fails to mount with dmsetup and no table presentLVM Volume Group MetaData Corruption - Please Helpchange designated name of encrypted lvm root? from sdo to sdn in crypttab?LVM: PV missing after reboot
What does the "remote control" for a QF-4 look like?
Client team has low performances and low technical skills: we always fix their work and now they stop collaborate with us. How to solve?
What is the word for reserving something for yourself before others do?
Why is consensus so controversial in Britain?
DC-DC converter from low voltage at high current, to high voltage at low current
Can an x86 CPU running in real mode be considered to be basically an 8086 CPU?
Is it unprofessional to ask if a job posting on GlassDoor is real?
What would happen to a modern skyscraper if it rains micro blackholes?
LWC SFDX source push error TypeError: LWC1009: decl.moveTo is not a function
Why can't I see bouncing of switch on oscilloscope screen?
Why doesn't Newton's third law mean a person bounces back to where they started when they hit the ground?
Why do I get two different answers for this counting problem?
NMaximize is not converging to a solution
Codimension of non-flat locus
Paid for article while in US on F-1 visa?
Important Resources for Dark Age Civilizations?
What is a clear way to write a bar that has an extra beat?
meaning of に in 本当に?
Is it legal for company to use my work email to pretend I still work there?
How is it possible to have an ability score that is less than 3?
How does one intimidate enemies without having the capacity for violence?
Can a monk's single staff be considered dual wielded, as per the Dual Wielder feat?
What's that red-plus icon near a text?
Does detail obscure or enhance action?
Unable to remove stale volume
LVM2 can not wake up suspended logical volumeafter adding one more physical volume and enlarging logical volume, grub failsWhy my encrypted LVM volume (LUKS device) won't mount at boot time?device mapper on RHEL6 unable to create devs for LVM logical volumeLVM - failed to install bootloaderMount encrypted volume in DebianLogical Volumes fails to mount with dmsetup and no table presentLVM Volume Group MetaData Corruption - Please Helpchange designated name of encrypted lvm root? from sdo to sdn in crypttab?LVM: PV missing after reboot
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have an external hard drive connected to my Ubuntu laptop via USB. The whole hard drive is LUKS encrypted. Next to the encryption layer sits an LVM volume which I mount to /mnt/es
. Once opened, lsblk
sees it all as:
sdc 8:32 0 2.7T 0 disk
└─es (dm-6) 252:6 0 2.7T 0 crypt
└─externalstorage-externalstorage (dm-7) 252:7 0 2.7T 0 lvm /mnt/es
Sometimes somehow the hard drive gets "detached" from the volumes, in which case the data becomes inaccessible:
sdc 8:32 0 2.7T 0 disk
es (dm-6) 252:6 0 2.7T 0 crypt
└─externalstorage-externalstorage (dm-7) 252:7 0 2.7T 0 lvm
I noted that it typically happens when the laptop goes to sleep.
Now, the problem is that once sdc
has [been?] detached, I cannot get rid of the two stale volumes es
and externalstorage-externalstorage
in order to reuse their names again. The first thing I do is umount /mnt/es
which goes fine. But then, even though the volume is not mounted, I cannot remove it:
dmsetup remove --force /dev/mapper/externalstorage-externalstorage
device-mapper: resume ioctl on externalstorage-externalstorage failed: Invalid argument
device-mapper: remove ioctl on externalstorage-externalstorage failed: Device or resource busy
Command failed
The info
command shows that the volume is opened:
dmsetup info -c /dev/mapper/externalstorage-externalstorage
Name Maj Min Stat Open Targ Event UUID
externalstorage-externalstorage 252 7 L--w 1 1 0 LVM-R4bAWzxJ8Cy3MBIjmPps60Rd3cFVyBStxTeKaR6gBHdefTYfJNWhHfA8tzqOBHns
Here is what seems to be holding the volume but it does not tell me much:
fuser -m /dev/mapper/externalstorage-externalstorage
Cannot stat file /proc/5687/fd/4: Stale file handle
Cannot stat file /proc/5687/fd/5: Stale file handle
Cannot stat file /proc/5687/fd/6: Stale file handle
Cannot stat file /proc/5687/fd/7: Stale file handle
Cannot stat file /proc/5687/fd/11: Stale file handle
From LVM point of view it is not accessible either:
pvdisplay
/dev/externalstorage/externalstorage: read failed after 0 of 4096 at 2981780979712: Input/output error
/dev/externalstorage/externalstorage: read failed after 0 of 4096 at 2981781037056: Input/output error
/dev/externalstorage/externalstorage: read failed after 0 of 4096 at 0: Input/output error
/dev/externalstorage/externalstorage: read failed after 0 of 4096 at 4096: Input/output error
Interestingly, at this point, cryptsetup luksClose es
can be repeated any number of times without any visible impact or error message.
So how can I get rid of those stale volumes (apart from rebooting)? And is there any way to prevent the problem happening in the first place, i.e. why does sdc
detach now and again?
[Ubuntu 14.04.3 LTS, kernel 3.19.0-42-generic]
Update
vgchange -an
yields similar errors as above:
/dev/mapper/es: read failed after 0 of 4096 at 3000590794752: Input/output error
/dev/mapper/es: read failed after 0 of 4096 at 3000590876672: Input/output error
/dev/mapper/es: read failed after 0 of 4096 at 0: Input/output error
/dev/mapper/es: read failed after 0 of 4096 at 4096: Input/output error
/dev/externalstorage/externalstorage: read failed after 0 of 4096 at 2981780979712: Input/output error
/dev/externalstorage/externalstorage: read failed after 0 of 4096 at 2981781037056: Input/output error
/dev/externalstorage/externalstorage: read failed after 0 of 4096 at 0: Input/output error
/dev/externalstorage/externalstorage: read failed after 0 of 4096 at 4096: Input/output error
lvm usb-drive luks cryptsetup volume
add a comment |
I have an external hard drive connected to my Ubuntu laptop via USB. The whole hard drive is LUKS encrypted. Next to the encryption layer sits an LVM volume which I mount to /mnt/es
. Once opened, lsblk
sees it all as:
sdc 8:32 0 2.7T 0 disk
└─es (dm-6) 252:6 0 2.7T 0 crypt
└─externalstorage-externalstorage (dm-7) 252:7 0 2.7T 0 lvm /mnt/es
Sometimes somehow the hard drive gets "detached" from the volumes, in which case the data becomes inaccessible:
sdc 8:32 0 2.7T 0 disk
es (dm-6) 252:6 0 2.7T 0 crypt
└─externalstorage-externalstorage (dm-7) 252:7 0 2.7T 0 lvm
I noted that it typically happens when the laptop goes to sleep.
Now, the problem is that once sdc
has [been?] detached, I cannot get rid of the two stale volumes es
and externalstorage-externalstorage
in order to reuse their names again. The first thing I do is umount /mnt/es
which goes fine. But then, even though the volume is not mounted, I cannot remove it:
dmsetup remove --force /dev/mapper/externalstorage-externalstorage
device-mapper: resume ioctl on externalstorage-externalstorage failed: Invalid argument
device-mapper: remove ioctl on externalstorage-externalstorage failed: Device or resource busy
Command failed
The info
command shows that the volume is opened:
dmsetup info -c /dev/mapper/externalstorage-externalstorage
Name Maj Min Stat Open Targ Event UUID
externalstorage-externalstorage 252 7 L--w 1 1 0 LVM-R4bAWzxJ8Cy3MBIjmPps60Rd3cFVyBStxTeKaR6gBHdefTYfJNWhHfA8tzqOBHns
Here is what seems to be holding the volume but it does not tell me much:
fuser -m /dev/mapper/externalstorage-externalstorage
Cannot stat file /proc/5687/fd/4: Stale file handle
Cannot stat file /proc/5687/fd/5: Stale file handle
Cannot stat file /proc/5687/fd/6: Stale file handle
Cannot stat file /proc/5687/fd/7: Stale file handle
Cannot stat file /proc/5687/fd/11: Stale file handle
From LVM point of view it is not accessible either:
pvdisplay
/dev/externalstorage/externalstorage: read failed after 0 of 4096 at 2981780979712: Input/output error
/dev/externalstorage/externalstorage: read failed after 0 of 4096 at 2981781037056: Input/output error
/dev/externalstorage/externalstorage: read failed after 0 of 4096 at 0: Input/output error
/dev/externalstorage/externalstorage: read failed after 0 of 4096 at 4096: Input/output error
Interestingly, at this point, cryptsetup luksClose es
can be repeated any number of times without any visible impact or error message.
So how can I get rid of those stale volumes (apart from rebooting)? And is there any way to prevent the problem happening in the first place, i.e. why does sdc
detach now and again?
[Ubuntu 14.04.3 LTS, kernel 3.19.0-42-generic]
Update
vgchange -an
yields similar errors as above:
/dev/mapper/es: read failed after 0 of 4096 at 3000590794752: Input/output error
/dev/mapper/es: read failed after 0 of 4096 at 3000590876672: Input/output error
/dev/mapper/es: read failed after 0 of 4096 at 0: Input/output error
/dev/mapper/es: read failed after 0 of 4096 at 4096: Input/output error
/dev/externalstorage/externalstorage: read failed after 0 of 4096 at 2981780979712: Input/output error
/dev/externalstorage/externalstorage: read failed after 0 of 4096 at 2981781037056: Input/output error
/dev/externalstorage/externalstorage: read failed after 0 of 4096 at 0: Input/output error
/dev/externalstorage/externalstorage: read failed after 0 of 4096 at 4096: Input/output error
lvm usb-drive luks cryptsetup volume
add a comment |
I have an external hard drive connected to my Ubuntu laptop via USB. The whole hard drive is LUKS encrypted. Next to the encryption layer sits an LVM volume which I mount to /mnt/es
. Once opened, lsblk
sees it all as:
sdc 8:32 0 2.7T 0 disk
└─es (dm-6) 252:6 0 2.7T 0 crypt
└─externalstorage-externalstorage (dm-7) 252:7 0 2.7T 0 lvm /mnt/es
Sometimes somehow the hard drive gets "detached" from the volumes, in which case the data becomes inaccessible:
sdc 8:32 0 2.7T 0 disk
es (dm-6) 252:6 0 2.7T 0 crypt
└─externalstorage-externalstorage (dm-7) 252:7 0 2.7T 0 lvm
I noted that it typically happens when the laptop goes to sleep.
Now, the problem is that once sdc
has [been?] detached, I cannot get rid of the two stale volumes es
and externalstorage-externalstorage
in order to reuse their names again. The first thing I do is umount /mnt/es
which goes fine. But then, even though the volume is not mounted, I cannot remove it:
dmsetup remove --force /dev/mapper/externalstorage-externalstorage
device-mapper: resume ioctl on externalstorage-externalstorage failed: Invalid argument
device-mapper: remove ioctl on externalstorage-externalstorage failed: Device or resource busy
Command failed
The info
command shows that the volume is opened:
dmsetup info -c /dev/mapper/externalstorage-externalstorage
Name Maj Min Stat Open Targ Event UUID
externalstorage-externalstorage 252 7 L--w 1 1 0 LVM-R4bAWzxJ8Cy3MBIjmPps60Rd3cFVyBStxTeKaR6gBHdefTYfJNWhHfA8tzqOBHns
Here is what seems to be holding the volume but it does not tell me much:
fuser -m /dev/mapper/externalstorage-externalstorage
Cannot stat file /proc/5687/fd/4: Stale file handle
Cannot stat file /proc/5687/fd/5: Stale file handle
Cannot stat file /proc/5687/fd/6: Stale file handle
Cannot stat file /proc/5687/fd/7: Stale file handle
Cannot stat file /proc/5687/fd/11: Stale file handle
From LVM point of view it is not accessible either:
pvdisplay
/dev/externalstorage/externalstorage: read failed after 0 of 4096 at 2981780979712: Input/output error
/dev/externalstorage/externalstorage: read failed after 0 of 4096 at 2981781037056: Input/output error
/dev/externalstorage/externalstorage: read failed after 0 of 4096 at 0: Input/output error
/dev/externalstorage/externalstorage: read failed after 0 of 4096 at 4096: Input/output error
Interestingly, at this point, cryptsetup luksClose es
can be repeated any number of times without any visible impact or error message.
So how can I get rid of those stale volumes (apart from rebooting)? And is there any way to prevent the problem happening in the first place, i.e. why does sdc
detach now and again?
[Ubuntu 14.04.3 LTS, kernel 3.19.0-42-generic]
Update
vgchange -an
yields similar errors as above:
/dev/mapper/es: read failed after 0 of 4096 at 3000590794752: Input/output error
/dev/mapper/es: read failed after 0 of 4096 at 3000590876672: Input/output error
/dev/mapper/es: read failed after 0 of 4096 at 0: Input/output error
/dev/mapper/es: read failed after 0 of 4096 at 4096: Input/output error
/dev/externalstorage/externalstorage: read failed after 0 of 4096 at 2981780979712: Input/output error
/dev/externalstorage/externalstorage: read failed after 0 of 4096 at 2981781037056: Input/output error
/dev/externalstorage/externalstorage: read failed after 0 of 4096 at 0: Input/output error
/dev/externalstorage/externalstorage: read failed after 0 of 4096 at 4096: Input/output error
lvm usb-drive luks cryptsetup volume
I have an external hard drive connected to my Ubuntu laptop via USB. The whole hard drive is LUKS encrypted. Next to the encryption layer sits an LVM volume which I mount to /mnt/es
. Once opened, lsblk
sees it all as:
sdc 8:32 0 2.7T 0 disk
└─es (dm-6) 252:6 0 2.7T 0 crypt
└─externalstorage-externalstorage (dm-7) 252:7 0 2.7T 0 lvm /mnt/es
Sometimes somehow the hard drive gets "detached" from the volumes, in which case the data becomes inaccessible:
sdc 8:32 0 2.7T 0 disk
es (dm-6) 252:6 0 2.7T 0 crypt
└─externalstorage-externalstorage (dm-7) 252:7 0 2.7T 0 lvm
I noted that it typically happens when the laptop goes to sleep.
Now, the problem is that once sdc
has [been?] detached, I cannot get rid of the two stale volumes es
and externalstorage-externalstorage
in order to reuse their names again. The first thing I do is umount /mnt/es
which goes fine. But then, even though the volume is not mounted, I cannot remove it:
dmsetup remove --force /dev/mapper/externalstorage-externalstorage
device-mapper: resume ioctl on externalstorage-externalstorage failed: Invalid argument
device-mapper: remove ioctl on externalstorage-externalstorage failed: Device or resource busy
Command failed
The info
command shows that the volume is opened:
dmsetup info -c /dev/mapper/externalstorage-externalstorage
Name Maj Min Stat Open Targ Event UUID
externalstorage-externalstorage 252 7 L--w 1 1 0 LVM-R4bAWzxJ8Cy3MBIjmPps60Rd3cFVyBStxTeKaR6gBHdefTYfJNWhHfA8tzqOBHns
Here is what seems to be holding the volume but it does not tell me much:
fuser -m /dev/mapper/externalstorage-externalstorage
Cannot stat file /proc/5687/fd/4: Stale file handle
Cannot stat file /proc/5687/fd/5: Stale file handle
Cannot stat file /proc/5687/fd/6: Stale file handle
Cannot stat file /proc/5687/fd/7: Stale file handle
Cannot stat file /proc/5687/fd/11: Stale file handle
From LVM point of view it is not accessible either:
pvdisplay
/dev/externalstorage/externalstorage: read failed after 0 of 4096 at 2981780979712: Input/output error
/dev/externalstorage/externalstorage: read failed after 0 of 4096 at 2981781037056: Input/output error
/dev/externalstorage/externalstorage: read failed after 0 of 4096 at 0: Input/output error
/dev/externalstorage/externalstorage: read failed after 0 of 4096 at 4096: Input/output error
Interestingly, at this point, cryptsetup luksClose es
can be repeated any number of times without any visible impact or error message.
So how can I get rid of those stale volumes (apart from rebooting)? And is there any way to prevent the problem happening in the first place, i.e. why does sdc
detach now and again?
[Ubuntu 14.04.3 LTS, kernel 3.19.0-42-generic]
Update
vgchange -an
yields similar errors as above:
/dev/mapper/es: read failed after 0 of 4096 at 3000590794752: Input/output error
/dev/mapper/es: read failed after 0 of 4096 at 3000590876672: Input/output error
/dev/mapper/es: read failed after 0 of 4096 at 0: Input/output error
/dev/mapper/es: read failed after 0 of 4096 at 4096: Input/output error
/dev/externalstorage/externalstorage: read failed after 0 of 4096 at 2981780979712: Input/output error
/dev/externalstorage/externalstorage: read failed after 0 of 4096 at 2981781037056: Input/output error
/dev/externalstorage/externalstorage: read failed after 0 of 4096 at 0: Input/output error
/dev/externalstorage/externalstorage: read failed after 0 of 4096 at 4096: Input/output error
lvm usb-drive luks cryptsetup volume
lvm usb-drive luks cryptsetup volume
edited Jan 6 '16 at 9:42
Greendrake
asked Jan 4 '16 at 5:21
GreendrakeGreendrake
1286
1286
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
It's more like a guesswork, but it looks like you will need to deactive the lvm before you can remove the crypt mapping, basically working your way back out from the inside:
First, you'll need to umount any stale fs on the lvm:
umount -f /mnt/es
Then deactivate the lvm that you appear to have on top of cryptsetup. Even if you have other vgs, the following should deactivate anything it can, without harming the system if it using any other vg:
vgchange -an
After this, you can use dmsetup to remove the mapping created by cryptsetup(!)
dmsetup remove externalstorage
(I may have mistook some of the names, feel free to correct it)
It seems the basic problem that during sleep, your USB drive is dropping off the bus, and when it comes back, the block system finds that sdb disappeared, though there is an sdc now.
Thanks for your input butvgchange -an
yields the same sort of "Input/output error" errors aspvdisplay
(shown in the question).
– Greendrake
Jan 6 '16 at 9:39
add a comment |
- Close all users of the device and backup device data as needed.
- Use umount to unmount any file systems that mounted the device.
- Remove the device from any md and LVM volume using it. If the device is a member of an LVM Volume group, then it may be necessary to move data off the device using the pvmove command, then use the vgreduce command to remove the physical volume, and (optionally) pvremove to remove the LVM metadata from the disk.
- If the device uses multipathing, run multipath -l and note all the paths to the device. Afterwards, remove the multipathed device using multipath -f device.
- Run blockdev –flushbufs device to flush any outstanding I/O to all paths to the device. This is particularly important for raw devices, where there is no umount or vgreduce operation to cause an I/O flush.
- Remove any reference to the device's path-based name, like /dev/sd, /dev/disk/by-path or the major:minor number, in applications, scripts, or utilities on the system. This is important in ensuring that different devices added in the future will not be mistaken for the current device.
- Finally, remove each path to the device from the SCSI subsystem. To do so, use the command echo 1 > /sys/block/device-name/device/delete where device-name may be sde, for example.
Another variation of this operation is echo 1 > /sys/class/scsi_device/h:c:t:l/device/delete, where h is the HBA number, c is the channel on the HBA, t is the SCSI target ID, and l is the LUN.
For more details refer Red Hat documentation!
Also you can use sg_utils script to remove stale volume using rescan-scsi-bus.sh!
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%2f253104%2funable-to-remove-stale-volume%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
It's more like a guesswork, but it looks like you will need to deactive the lvm before you can remove the crypt mapping, basically working your way back out from the inside:
First, you'll need to umount any stale fs on the lvm:
umount -f /mnt/es
Then deactivate the lvm that you appear to have on top of cryptsetup. Even if you have other vgs, the following should deactivate anything it can, without harming the system if it using any other vg:
vgchange -an
After this, you can use dmsetup to remove the mapping created by cryptsetup(!)
dmsetup remove externalstorage
(I may have mistook some of the names, feel free to correct it)
It seems the basic problem that during sleep, your USB drive is dropping off the bus, and when it comes back, the block system finds that sdb disappeared, though there is an sdc now.
Thanks for your input butvgchange -an
yields the same sort of "Input/output error" errors aspvdisplay
(shown in the question).
– Greendrake
Jan 6 '16 at 9:39
add a comment |
It's more like a guesswork, but it looks like you will need to deactive the lvm before you can remove the crypt mapping, basically working your way back out from the inside:
First, you'll need to umount any stale fs on the lvm:
umount -f /mnt/es
Then deactivate the lvm that you appear to have on top of cryptsetup. Even if you have other vgs, the following should deactivate anything it can, without harming the system if it using any other vg:
vgchange -an
After this, you can use dmsetup to remove the mapping created by cryptsetup(!)
dmsetup remove externalstorage
(I may have mistook some of the names, feel free to correct it)
It seems the basic problem that during sleep, your USB drive is dropping off the bus, and when it comes back, the block system finds that sdb disappeared, though there is an sdc now.
Thanks for your input butvgchange -an
yields the same sort of "Input/output error" errors aspvdisplay
(shown in the question).
– Greendrake
Jan 6 '16 at 9:39
add a comment |
It's more like a guesswork, but it looks like you will need to deactive the lvm before you can remove the crypt mapping, basically working your way back out from the inside:
First, you'll need to umount any stale fs on the lvm:
umount -f /mnt/es
Then deactivate the lvm that you appear to have on top of cryptsetup. Even if you have other vgs, the following should deactivate anything it can, without harming the system if it using any other vg:
vgchange -an
After this, you can use dmsetup to remove the mapping created by cryptsetup(!)
dmsetup remove externalstorage
(I may have mistook some of the names, feel free to correct it)
It seems the basic problem that during sleep, your USB drive is dropping off the bus, and when it comes back, the block system finds that sdb disappeared, though there is an sdc now.
It's more like a guesswork, but it looks like you will need to deactive the lvm before you can remove the crypt mapping, basically working your way back out from the inside:
First, you'll need to umount any stale fs on the lvm:
umount -f /mnt/es
Then deactivate the lvm that you appear to have on top of cryptsetup. Even if you have other vgs, the following should deactivate anything it can, without harming the system if it using any other vg:
vgchange -an
After this, you can use dmsetup to remove the mapping created by cryptsetup(!)
dmsetup remove externalstorage
(I may have mistook some of the names, feel free to correct it)
It seems the basic problem that during sleep, your USB drive is dropping off the bus, and when it comes back, the block system finds that sdb disappeared, though there is an sdc now.
answered Jan 4 '16 at 6:48
chexumchexum
73479
73479
Thanks for your input butvgchange -an
yields the same sort of "Input/output error" errors aspvdisplay
(shown in the question).
– Greendrake
Jan 6 '16 at 9:39
add a comment |
Thanks for your input butvgchange -an
yields the same sort of "Input/output error" errors aspvdisplay
(shown in the question).
– Greendrake
Jan 6 '16 at 9:39
Thanks for your input but
vgchange -an
yields the same sort of "Input/output error" errors as pvdisplay
(shown in the question).– Greendrake
Jan 6 '16 at 9:39
Thanks for your input but
vgchange -an
yields the same sort of "Input/output error" errors as pvdisplay
(shown in the question).– Greendrake
Jan 6 '16 at 9:39
add a comment |
- Close all users of the device and backup device data as needed.
- Use umount to unmount any file systems that mounted the device.
- Remove the device from any md and LVM volume using it. If the device is a member of an LVM Volume group, then it may be necessary to move data off the device using the pvmove command, then use the vgreduce command to remove the physical volume, and (optionally) pvremove to remove the LVM metadata from the disk.
- If the device uses multipathing, run multipath -l and note all the paths to the device. Afterwards, remove the multipathed device using multipath -f device.
- Run blockdev –flushbufs device to flush any outstanding I/O to all paths to the device. This is particularly important for raw devices, where there is no umount or vgreduce operation to cause an I/O flush.
- Remove any reference to the device's path-based name, like /dev/sd, /dev/disk/by-path or the major:minor number, in applications, scripts, or utilities on the system. This is important in ensuring that different devices added in the future will not be mistaken for the current device.
- Finally, remove each path to the device from the SCSI subsystem. To do so, use the command echo 1 > /sys/block/device-name/device/delete where device-name may be sde, for example.
Another variation of this operation is echo 1 > /sys/class/scsi_device/h:c:t:l/device/delete, where h is the HBA number, c is the channel on the HBA, t is the SCSI target ID, and l is the LUN.
For more details refer Red Hat documentation!
Also you can use sg_utils script to remove stale volume using rescan-scsi-bus.sh!
New contributor
add a comment |
- Close all users of the device and backup device data as needed.
- Use umount to unmount any file systems that mounted the device.
- Remove the device from any md and LVM volume using it. If the device is a member of an LVM Volume group, then it may be necessary to move data off the device using the pvmove command, then use the vgreduce command to remove the physical volume, and (optionally) pvremove to remove the LVM metadata from the disk.
- If the device uses multipathing, run multipath -l and note all the paths to the device. Afterwards, remove the multipathed device using multipath -f device.
- Run blockdev –flushbufs device to flush any outstanding I/O to all paths to the device. This is particularly important for raw devices, where there is no umount or vgreduce operation to cause an I/O flush.
- Remove any reference to the device's path-based name, like /dev/sd, /dev/disk/by-path or the major:minor number, in applications, scripts, or utilities on the system. This is important in ensuring that different devices added in the future will not be mistaken for the current device.
- Finally, remove each path to the device from the SCSI subsystem. To do so, use the command echo 1 > /sys/block/device-name/device/delete where device-name may be sde, for example.
Another variation of this operation is echo 1 > /sys/class/scsi_device/h:c:t:l/device/delete, where h is the HBA number, c is the channel on the HBA, t is the SCSI target ID, and l is the LUN.
For more details refer Red Hat documentation!
Also you can use sg_utils script to remove stale volume using rescan-scsi-bus.sh!
New contributor
add a comment |
- Close all users of the device and backup device data as needed.
- Use umount to unmount any file systems that mounted the device.
- Remove the device from any md and LVM volume using it. If the device is a member of an LVM Volume group, then it may be necessary to move data off the device using the pvmove command, then use the vgreduce command to remove the physical volume, and (optionally) pvremove to remove the LVM metadata from the disk.
- If the device uses multipathing, run multipath -l and note all the paths to the device. Afterwards, remove the multipathed device using multipath -f device.
- Run blockdev –flushbufs device to flush any outstanding I/O to all paths to the device. This is particularly important for raw devices, where there is no umount or vgreduce operation to cause an I/O flush.
- Remove any reference to the device's path-based name, like /dev/sd, /dev/disk/by-path or the major:minor number, in applications, scripts, or utilities on the system. This is important in ensuring that different devices added in the future will not be mistaken for the current device.
- Finally, remove each path to the device from the SCSI subsystem. To do so, use the command echo 1 > /sys/block/device-name/device/delete where device-name may be sde, for example.
Another variation of this operation is echo 1 > /sys/class/scsi_device/h:c:t:l/device/delete, where h is the HBA number, c is the channel on the HBA, t is the SCSI target ID, and l is the LUN.
For more details refer Red Hat documentation!
Also you can use sg_utils script to remove stale volume using rescan-scsi-bus.sh!
New contributor
- Close all users of the device and backup device data as needed.
- Use umount to unmount any file systems that mounted the device.
- Remove the device from any md and LVM volume using it. If the device is a member of an LVM Volume group, then it may be necessary to move data off the device using the pvmove command, then use the vgreduce command to remove the physical volume, and (optionally) pvremove to remove the LVM metadata from the disk.
- If the device uses multipathing, run multipath -l and note all the paths to the device. Afterwards, remove the multipathed device using multipath -f device.
- Run blockdev –flushbufs device to flush any outstanding I/O to all paths to the device. This is particularly important for raw devices, where there is no umount or vgreduce operation to cause an I/O flush.
- Remove any reference to the device's path-based name, like /dev/sd, /dev/disk/by-path or the major:minor number, in applications, scripts, or utilities on the system. This is important in ensuring that different devices added in the future will not be mistaken for the current device.
- Finally, remove each path to the device from the SCSI subsystem. To do so, use the command echo 1 > /sys/block/device-name/device/delete where device-name may be sde, for example.
Another variation of this operation is echo 1 > /sys/class/scsi_device/h:c:t:l/device/delete, where h is the HBA number, c is the channel on the HBA, t is the SCSI target ID, and l is the LUN.
For more details refer Red Hat documentation!
Also you can use sg_utils script to remove stale volume using rescan-scsi-bus.sh!
New contributor
New contributor
answered 2 days ago
Chhatragun ShindeChhatragun Shinde
111
111
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%2f253104%2funable-to-remove-stale-volume%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