0

I have a system with Proxmox VE 5.1 and a LXC container with Fedora 27.

The container has 2 disk (raw format), the rootfs and an additional mount point, both of them are in ext4, I want to format to xfs the second mount point.

I've tried to use the typical mkfs.xfs but I don't know where the linux block device is stored, It isn't in /dev directory.

The mount command shows:

/var/lib/vz/images/111/vm-111-disk-1.raw on / type ext4 (rw,relatime,data=ordered)
/var/lib/vz/images/111/vm-111-disk-2.raw on /var/db_data type ext4 (rw,relatime,data=ordered)

The df -h shows:

/dev/loop6       20G  1.1G   18G   6% /
/dev/loop7      9.8G   37M  9.3G   1% /var/db_data

However the "loopX" devices doesn't exist in container disk.

I've searched in proxmox forums without luck, so I don't know if this is a proxmox limitation...

2

In your example, the block device is /dev/loop7; It's a loop device backed by the file /var/lib/vz/images/111/vm-111-disk-2.raw. Per Wikipedia:

In Unix-like operating systems, a loop device, vnd (vnode disk), or lofi (loop file interface) is a pseudo-device that makes a file accessible as a block device.

There's no indication that your disk images contain partitions, so you can either create the filesystem from:

  1. Within the container (recommended): mkfs.xfs /dev/loop7
  2. From the host while the container is NOT running: mkfs.xfs /var/lib/vz/images/111/vm-111-disk-2.raw
  • The first option doesn't work, but the second one is Ok, thx. – Roberto Apr 16 '18 at 6:43
  • The loop device is only accessible from the host, not within the container. – Roberto Apr 16 '18 at 6:55
-1

To access the new drive on the client use "apt install xfs" (if you are using a Debian.)

  • The OP has already shown that he can already run mkfs.xfs on the host so it's not a case of missing necessary software. – Anthony Geoghegan Apr 18 '18 at 14:35
  • Incorrect. In general LXC clients can not use host Apps. Only kernel. – SamTzu Apr 19 '18 at 10:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.