Welcome Guest. Please Login or Register  


You are here: Index > Virtualizor - Virtual Server Control Panel > General Support > Topic : ioctl: LOOP_SET_FD: Device or resource busy



Threaded Mode | Print  

 ioctl: LOOP_SET_FD: Device or resource busy (5 Replies, Read 22786 times)
aldemaroc
Group: Member
Post Group: Newbie
Posts: 12
Status:
Hello!

We set up a brand new server using Ubuntu 20.04 LTS to a client, and when he is reinstalling a new KVM VPS there is an error:

Code
[Command] cd /home/kvm; /sbin/kpartx -l v1001-dmbw3tvsq6qhqkjx-bic3zzwwwyjxa823.raw
[Retval] 1
[Output]: Hide [Error]: Hide
Array
(
    [0] => ioctl: LOOP_SET_FD: Device or resource busy
    [1] => can't set up loop
)
Array
(
)


We checked and all loop devices are free:

Code
root@ubuntu-new:/home/kvm# losetup -f
/dev/loop0


Code
root@ubuntu-new:/home/kvm# lsblk
NAME  MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0  1.8T  0 disk
├─sda1  8:1    0    1M  0 part
├─sda2  8:2    0    1G  0 part /boot
├─sda3  8:3    0  50G  0 part /
└─sda4  8:4    0  1.8T  0 part /home


Have anyone experieced anything close to that and solved?
IP: --   

ioctl: LOOP_SET_FD: Device or resource busy
aldemaroc
Group: Member
Post Group: Newbie
Posts: 12
Status:
I think we found the issue.

We reinstalled the server and could reproduce it one more time.

Looks like virtualizor is sometimes not remove all loop devices correctly.

We found that somehow /dev/mapper/loop0p1 was still present where it should not be:

Code

root@ubuntu-new:~# lsblk
NAME  MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0  1.8T  0 disk
├─sda1  8:1    0    1M  0 part
├─sda2  8:2    0    1G  0 part /boot
├─sda3  8:3    0  50G  0 part /
└─sda4  8:4    0  1.8T  0 part /home

root@ubuntu-new:~# ls /dev/mapper/
control  loop0p1


Removing /dev/mapper/loop0p1 using "dmsetup remove /dev/mapper/loop0p1" allowed us to reinstall the VPSs as we pleased, but we are afraid it can happen again in the future as looks like this is caused by some kind of bug.
IP: --   

ioctl: LOOP_SET_FD: Device or resource busy
jevingala
Group: Virtualizor Team
Post Group: Super Member
Posts: 632
Status:
Hi,


If it happens again , then you can open a ticket so that we can check that vps logs and try to replicate the issue :

https://softaculous.deskuss.com/open.php?topicId=2

-----------------------
Regards,
Virtualizor Team.
http://virtualizor.com/
IP: --   

ioctl: LOOP_SET_FD: Device or resource busy
aldemaroc
Group: Member
Post Group: Newbie
Posts: 12
Status:
I think I found the issue

When building the VPS if something goes wrong when mounting the loop device virtualizor will never free up the loop again:

Code
[Command] /bin/mount /dev/mapper/loop0p1 /home/v1002/0 2>&1
[Retval] 32
[Output]: Hide
Array
(
    [0] => mount: /home/v1002/0: can't read superblock on /dev/mapper/loop0p1.
)


After that Virtualizor will just exit, and leave the loop there, stuck.

Next time you try to reinstall the VPS:

Code
[Command] cd /vz/kvm; /sbin/kpartx -l v102-d1pwqtx0zxwezgpv-3o93zbcvlvcndt3v.raw
[Retval] 1
[Output]: Show [Error]: Hide
Array
(
    [0] => ioctl: LOOP_SET_FD: Device or resource busy
    [1] => can't set up loop
)


As there is no hook for when the server is installed/reinstalled we can't add our custom routine that will clean up stuck loops, and had to make a cron script that will look for stuck loops and delete them.
IP: --   

ioctl: LOOP_SET_FD: Device or resource busy
jevingala
Group: Virtualizor Team
Post Group: Super Member
Posts: 632
Status:
Hi,

Was v1002 a fresh vps created using our OS template previously ?

Or was it a vps created using ISO ?
Or there was some other vps created using ISO with LVM based storage in it ?

We are executing kpartx -d to remove the loop device.
But it fails then other vps may get affected.

-----------------------
Regards,
Virtualizor Team.
http://virtualizor.com/
IP: --   

ioctl: LOOP_SET_FD: Device or resource busy
aldemaroc
Group: Member
Post Group: Newbie
Posts: 12
Status:
Quote From : jevingala May 22, 2021, 12:24 pm
Hi,

Was v1002 a fresh vps created using our OS template previously ?

Or was it a vps created using ISO ?
Or there was some other vps created using ISO with LVM based storage in it ?

We are executing kpartx -d to remove the loop device.
But it fails then other vps may get affected.


Hello! It is your ubuntu 18 template. We are using Ubuntu 20 as the host OS.

We will reinstall this node and open a support ticket so you guys can check further.
IP: --   

« Previous    Next »

Threaded Mode | Print  



Jump To :


Users viewing this topic
2 guests, 0 users.


All times are GMT. The time now is August 4, 2021, 1:21 pm.

  Powered By AEF 1.0.8 © 2007-2008 Electron Inc.Queries: 10  |  Page Created In:1.458