4

I see iocharset=utf8 recommended nearly everywhere when mounting Windows SMB shares into Linux.

I have mounted vhdx files to a Ubuntu VM that I want to be assured that whatever files I write to the disk from the Ubuntu VM will be readable from Windows in the future. Therefore I have two questions:

  1. Is this what iocharset=utf8 does?
  2. Should I apply this option to the fstab for the vhdx in the Ubuntu VM too, and not just SMB shares?
4

iocharset=utf8 sets what encoding to use when mounting drives or network shares.

According to Wikipedia:

UTF-8 is a character encoding capable of encoding all possible characters, or code points, defined by Unicode.

It's pretty much a safety feature just to make sure Ubuntu can present all text in a readable format (shows it correctly), and save everything in a format readable by other OSes.

You certainly can add this option to anything you mount, but unless you encounter problems with text or file paths, there's no need to add it.

0
6

The default character encoding for the mounts in Linux is iso8859-1. This encoding is legacy and only supports 256 characters. All modern systems should be using utf-8 but I think default is left at ISO8859-1 for compatibility reasons. So it's always good idea to add iocharset=utf8 when mounting Windows share. Also, lot of websites enforces filemode/dirmod 777 when mounting which I think are unnecessary. The mount command that I use is,

sudo mount -t cifs //SERVER/FOLDER /mnt/FOLDER -o username=USER,domain=DOMAIN,iocharset=utf8

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.