By default, Cygwin mounts Windows drives and partitions with drive letter not
with drive label. To mount the drives with drive letter, we have to add each
entry in /etc/fstab
(file system table). To edit the file, open /etc/fstab
file in any text editor in Cygwin, for example nano, vi, vim etc. Comment out
existing lines. For example, assume C:
drive is labeled with Windows and
D:
drive with Data. So, the entries will be C:
drive to /mnt/Windows
and D:
to /mnt/Data
. Create those folder with mkdir
. Now,
before the /etc/fstab
file was:
# This is default anyway:
none /cygdrive cygdrive binary,posix=0,user 0 0
after editing that file:
# This is a comment
# This is default anyway:
# none /cygdrive cygdrive binary,posix=0,user 0 0
# device-spec mount-point fs-type options dump pass
C: /mnt/Windows ntfs binary,posix=0,user 0 0
D: /mnt/Data ntfs binary,posix=0,user 0 0
Try not to use any Windows program (e.g. Notepad) to modify that file because
it may change the file permissions. Make sure /etc/fstab
has 0644
permission.
Further readings
I don't have a cygwin installation. I only have rsync.exe, cygwin1.dll, cygiconv-2.dll. – somega – 2020-01-13T10:24:25.487
Then Windows program may be used. If those are in
bin
folder then createetc
folder andfstab
file manually. Rest of it may be same. – Biswapriyo – 2020-01-13T13:37:59.490But I want to mount every new drive by label which is inserted. Not only some known drives. – somega – 2020-01-14T13:03:21.830