You are not logged in.
i have lvm in my pc . Please see the fdisk -l output
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 6787608B-BDBA-D741-AC59-4D786B6FB547
Device Start End Sectors Size Type
/dev/sda1 2048 616447 614400 300M EFI System
/dev/sda2 616448 84502527 83886080 40G Linux LVM
/dev/sda3 84502528 1953525134 1869022607 891.2G Linux LVM
Disk /dev/mapper/cryptlvm: 40 GiB, 42947575808 bytes, 83881984 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/mapper/vgos-root: 40 GiB, 42945478656 bytes, 83877888 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/mapper/mydata: 891.2 GiB, 956937477632 bytes, 1869018511 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
In this /dev/mapper/mydata is a lvm. This we are mounting using crypttab. Please find the crypttab details
[root@vipin-pc vipin]# cat /etc/crypttab
mydata /dev/disk/by-uuid/99355fbc-560a-49d9-bce2-2aee1d41c52e /mydatafile.bin luks
[root@vipin-pc vipin]#
Fstab detail
[root@vipin-pc vipin]# cat /etc/fstab
# Static information about the filesystems.
# See fstab(5) for details.
# <file system> <dir> <type> <options> <dump> <pass>
# /dev/mapper/vgos-root
UUID=10458ba4-1765-4fae-8174-0cb331bdec31 / ext4 rw,relatime 0 1
#swapfile
/swapfile swap swap defaults,noatime 0 2
#encrypted volume
/dev/mapper/mydata /mnt/mydata ext4 rw,suid,dev,noexec,auto,user,async 0 0
[root@vipin-pc vipin]#
My issue is when i mount /dev/mapper/mydata . And login as user vipin unable to create a file or folder inside the mounted volume.
Please find the mount output
[root@vipin-pc vipin]# mount
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sys on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
dev on /dev type devtmpfs (rw,nosuid,relatime,size=12302728k,nr_inodes=3075682,mode=755)
run on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
/dev/mapper/vgos-root on / type ext4 (rw,relatime,data=ordered)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=28,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
/dev/mapper/mydata on /mnt/mydata type ext4 (rw,nosuid,nodev,noexec,relatime,data=ordered,user)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=2462668k,mode=700,uid=1000,gid=1000)
[root@vipin-pc vipin]#
Last edited by vipinbalakrishnan (2018-07-21 15:36:37)
Offline
Change the ownership of the directory, or change the permissions to allow "others" to write to it. The fact that lvm and luks are involved doesn't have any bearing on this issue.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
WorMzy thank for the reply. Is there any way I can achieve it through fstab itself. Instead of changing the permission?
Last edited by vipinbalakrishnan (2018-07-20 12:55:29)
Offline
No?
It's an ext4 filesystem, there's no way nor sense in stuff like umask parameters.
You can mirror the mount using bindfs, but that's just silly. Fix the permissions.
Offline
In case it's not clear, you only need to set the permissions once. They are set in the filesystem, so the next time it is mounted the settings will persist.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Thanks Trilby,seth and WorMzy I did the same now
Offline