LXC container on NTFS partition - permission mismatch

Hi,
I created folder /mnt/nas/srv/lxc on 3Tb HDD with NTFS partition mounted at /mnt/nas and create link to /srv in root.
Idea was to store LXC containers on HDD.
Unfortunately when I create container and log in via lxc-attach -n cont_name I can see that all files and folders has rwxrwxrwx permissions and I can not change it.
SSH /sudo and probably other apps do not work under such conditions.

Quick response was to delete link to HDD and use internal storage nevertheless I’d like to store LXC’s HDD in future.

Is there any “trick” how to keep LXC on NTFS and has possibility to change permissions or I’ll need to reformat HDD to linux friendly partition?

This is expected. Linux does not support unix modes on NTFS. Why did your format the disk with NTFS?

There is no trick to get unix permissions with NTFS working. Windows has one for SFU but not Linux.

If reformatting with ext4, xfs or btrfs is no option then a image file may be a option. This is not a great idea as it will still be damn slow because the NTFS driver is not fast.

Disk was formatted to NTFS by manufacturer (it is WD My Book).
I’ll reformat it to better filesystem.
Can you advice me what FS will be best taking into account that

  • disk will be connected only to TO
  • there will be multimedia folder served by miniDLNA on TO
  • backups of other computers will be stored here
  • XLC containers stored here
  • Should be accessible to nextcloud running in XLC (or on raspi connected by network)

Ext4 (mature, stable) or btrfs (less mature, stable enough).

Thannk you @adminX and @iddqd for clear answer.
I’ll reformat it during weekend

Though btrfs is younger and therefore less tested by decades, it has some nice features. It can span multiple devices and add or remove them on the go (if you add another device later, you can just add it at runtime without any downtime), snapshots (which might be nice for backups and are great in connection with LXC, as it allows fast cloning of virtuals).

So you’ll have to balance the better testing by time vs. the features. Though if it should contain any kind of very valuable data, it is always good to have backups of them either way.

1 Like

You could make two partitions on the disk if you want to keep NTFS for some other usage. Partition 1: NTFS and partition 2: ext4.

Other solution would be to create a loop device. In other words a Linux filesystem inside NTFS filesystem. Something like this:

opkg install kmod-loop
dd if=/dev/zero of=/mnt/nas/srv/lxc.image bs=4k count=1000000
mkfs.ext4 /mnt/nas/srv/lxc.image
mkdir /mnt/lxc
mount -o loop /mnt/nas/srv/lxc.image /mnt/lxc

But if you don’t need NTFS then the best solution is to change the filesystem as others have already said.

Thank you @white, In fact I was expecting that container itself is like file with linux fs inside - my misunderstanding.
I already moved all files and delete NTFS and create btrfs partition.
Containers are now running OK from this disk.