0

I'm trying to unlock (and later mount) a veracrypt container like this:

sudo cryptsetup --type tcrypt --veracrypt open /home/me/my_container.vc my_container
sudo mount /dev/mapper/my_container /media/my_container

But when I look at the files in the container, some of them have incorrect encoding due to non-English characters being used. In VeraCrypt, I used to set iocharset=utf8 in Preferences > Mount options to solve this problem. How do I do this in cryptsetup?

Mind you: we're talking about the encoding inside the container, not about the encoding for the keyboard input.

AdminBee
  • 21,637
  • 21
  • 47
  • 71
ParaDice
  • 103
  • 2

1 Answers1

1

iocharset is a mount option, not something VeraCrypt specific, just add it to your mount command:

sudo mount -o iocharset=utf8 /dev/mapper/my_container /media/my_container
Vojtech Trefny
  • 16,922
  • 6
  • 24
  • 48
  • Of course! Thanks for your reply, that solve _that_ part of the problem. One issue remains: if I mount the device like that, I only have read access, but no write. The problem seems to lie with the ownership: all files are mounted with root as the owner. chmod -c -R my_username won't work / is rejected. What am I doing wrong? – ParaDice Jul 07 '21 at 14:34
  • 1
    I assume the filesystem is NTFS or VFAT, you can use `uid`/`gid` or `fmask` options, see [this answer](https://unix.stackexchange.com/questions/396904/fstab-mount-options-for-umask-fmask-dmask-for-ntfs-with-noexec) for details. You also do the mount with `udisksctl mount -b /dev/mapper/my_container -o iocharset=utf8`, `udisksctl` should take care of using the correct `uid` and `gid` values when called as non-root user. – Vojtech Trefny Jul 07 '21 at 19:45
  • Great, thanks for the hint mate! (I notice I've still got a _lot_ to learn here.) You're correct, the filesystem is a FAT type. Using `udisksctl` does give me write permissions. However it doesn't seem to allow me to mount my container to a specific location: it just mounts it to /media//. I'd like to mount it to /media/. Is there a way to pass that as a parameter as well? I must admit I'm a bit overwhelmed by the man pages of both `mount` and `udisksctl`. – ParaDice Jul 08 '21 at 20:15