나는 2대의 moxa 컴퓨터(Debian 9)를 가지고 있는데, 둘 다 SD 카드가 설치되어 있습니다. 문제는 한 컴퓨터의 SD 카드 설치에 있었습니다. 그룹 소유권을 변경할 수 없습니다.
/dev/mmcblk0p1 /media/sd-mmcblk0p1 vfat rw,relatime,gid=100,fmask=0002,dmask=0002,allow_utime=0020,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
ls -al
폴더의;
root@AAGCloudwatcher:/media/sd-mmcblk0p1# ls -al
total 129
drwxrwxr-x 5 root users 32768 Sep 8 20:39 .
drwxr-xr-x 1 root root 1024 Sep 7 22:32 ..
drwxrwxr-x 3 root users 32768 Jul 15 21:15 config
drwxrwxr-x 7 root users 32768 Sep 7 19:13 data
drwxrwxr-x 2 root users 32768 Sep 7 19:44 tmp
다른 moxa 컴퓨터에서 파일을 읽고 쓰고 싶습니다. 삼바를 사용하여 폴더에 액세스하고 데이터를 볼 수 있었습니다. 하지만 쓰지 마세요. 이제 그룹의 소유권이 다르다는 것을 알았습니다. 이제 소유권은 root:users입니다.
SOLO@AAGCloudwatcher:/media/sd-mmcblk0p1$ sudo chown SOLO:SOLO data
chown: changing ownership of 'data': Operation not permitted
나는 많이 검색했습니다. 마운트된 드라이브는 FAT32이고 폴더는 777 읽기/쓰기 권한으로 업데이트되었습니다. SD 카드가 설치된 다른 컴퓨터가 있는데 동일한 문제가 발생하고 있습니다. 다른 컴퓨터와 SD 카드를 사용하여 쓸 수 없습니다. 그런 다음 나도 똑같은 일을했는데 그것은 매력처럼 작동했습니다. 소유권이 변경되면 해당 폴더에 소통하고 글을 쓸 수 있게 됩니다. 중요: 로컬 MOXA 컴퓨터에서 작업할 때 폴더에 쓸 수 있습니다.
chgrp
아니요.
lsattr은 다음을 제공합니다.
root@AAGCloudwatcher:/media/sd-mmcblk0p1# lsattr
lsattr: Inappropriate ioctl for device While reading flags on ./data
lsattr: Inappropriate ioctl for device While reading flags on ./config
lsattr: Inappropriate ioctl for device While reading flags on ./tmp
cat /proc/mounts
나에게 이것을 줘
/dev/root / ext4 rw,noatime,errors=remount-ro,data=ordered 0 0
devtmpfs /dev devtmpfs rw,relatime,size=247604k,nr_inodes=61901,mode=755 0 0
/dev/mmcblk1p3 /overlayfs ext4 rw,relatime,data=ordered 0 0
overlay /var overlay rw,relatime,lowerdir=/var,upperdir=/overlayfs/v1//var_rw/upper,workdir=/overlayfs/v1//var_rw/work 0 0
overlay /etc overlay rw,relatime,lowerdir=/etc,upperdir=/overlayfs/v1//etc_rw/upper,workdir=/overlayfs/v1//etc_rw/work 0 0
overlay /home overlay rw,relatime,lowerdir=/home,upperdir=/overlayfs/v1//home_rw/upper,workdir=/overlayfs/v1//home_rw/work 0 0
overlay /root overlay rw,relatime,lowerdir=/root,upperdir=/overlayfs/v1//root_rw/upper,workdir=/overlayfs/v1//root_rw/work 0 0
overlay /sbin overlay rw,relatime,lowerdir=/sbin,upperdir=/overlayfs/v1//sbin_rw/upper,workdir=/overlayfs/v1//sbin_rw/work 0 0
overlay /bin overlay rw,relatime,lowerdir=/bin,upperdir=/overlayfs/v1//bin_rw/upper,workdir=/overlayfs/v1//bin_rw/work 0 0
overlay /usr overlay rw,relatime,lowerdir=/usr,upperdir=/overlayfs/v1//usr_rw/upper,workdir=/overlayfs/v1//usr_rw/work 0 0
overlay /lib overlay rw,relatime,lowerdir=/lib,upperdir=/overlayfs/v1//lib_rw/upper,workdir=/overlayfs/v1//lib_rw/work 0 0
overlay /tmp overlay rw,relatime,lowerdir=/tmp,upperdir=/overlayfs/v1//tmp_rw/upper,workdir=/overlayfs/v1//tmp_rw/work 0 0
overlay /mnt overlay rw,relatime,lowerdir=/mnt,upperdir=/overlayfs/v1//mnt_rw/upper,workdir=/overlayfs/v1//mnt_rw/work 0 0
overlay /opt overlay rw,relatime,lowerdir=/opt,upperdir=/overlayfs/v1//opt_rw/upper,workdir=/overlayfs/v1//opt_rw/work 0 0
overlay /media overlay rw,relatime,lowerdir=/media,upperdir=/overlayfs/v1//media_rw/upper,workdir=/overlayfs/v1//media_rw/work 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /run tmpfs rw,nosuid,nodev,mode=755 0 0
tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0
tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,mode=755 0 0
cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd 0 0
cgroup /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0
cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0
cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0
cgroup /sys/fs/cgroup/net_cls,net_prio cgroup rw,nosuid,nodev,noexec,relatime,net_cls,net_prio 0 0
cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpu,cpuacct 0 0
cgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0
cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0
cgroup /sys/fs/cgroup/perf_event cgroup rw,nosuid,nodev,noexec,relatime,perf_event 0 0
systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=30,pgrp=1,timeout=0,minproto=5,maxproto=5,direct 0 0
mqueue /dev/mqueue mqueue rw,relatime 0 0
debugfs /sys/kernel/debug debugfs rw,relatime 0 0
configfs /sys/kernel/config configfs rw,relatime 0 0
/dev/mmcblk0p1 /media/sd-mmcblk0p1 vfat rw,relatime,gid=100,fmask=0002,dmask=0002,allow_utime=0020,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
tmpfs /run/user/1001 tmpfs rw,nosuid,nodev,relatime,size=51180k,mode=700,uid=1001,gid=1001 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,relatime 0 0
이와 같은 폴더 소유권을 얻으면 문제가 해결될 것으로 예상됩니다.
root@AAGCloudwatcher:/media/sd-mmcblk0p1# ls -al
total 129
drwxrwxr-x 5 root users 32768 Sep 8 20:39 .
drwxr-xr-x 1 root root 1024 Sep 7 22:32 ..
drwxrwxr-x 3 SOLO SOLO 32768 Jul 15 21:15 config
drwxrwxr-x 7 SOLO SOLO 32768 Sep 7 19:13 data
drwxrwxr-x 2 SOLO SOLO 32768 Sep 7 19:44 tmp
감사해요.
업데이트: 설치 결과:
root@AAGCloudwatcher:/home/SOLO# mount
/dev/mmcblk1p2 on / type ext4 (rw,noatime,errors=remount-ro,data=ordered)
devtmpfs on /dev type devtmpfs (rw,relatime,size=247604k,nr_inodes=61901,mode=755)
/dev/mmcblk1p3 on /overlayfs type ext4 (rw,relatime,data=ordered)
overlay on /var type overlay (rw,relatime,lowerdir=/var,upperdir=/overlayfs/v1//var_rw/upper,workdir=/overlayfs/v1//var_rw/work)
overlay on /etc type overlay (rw,relatime,lowerdir=/etc,upperdir=/overlayfs/v1//etc_rw/upper,workdir=/overlayfs/v1//etc_rw/work)
overlay on /home type overlay (rw,relatime,lowerdir=/home,upperdir=/overlayfs/v1//home_rw/upper,workdir=/overlayfs/v1//home_rw/work)
overlay on /root type overlay (rw,relatime,lowerdir=/root,upperdir=/overlayfs/v1//root_rw/upper,workdir=/overlayfs/v1//root_rw/work)
overlay on /sbin type overlay (rw,relatime,lowerdir=/sbin,upperdir=/overlayfs/v1//sbin_rw/upper,workdir=/overlayfs/v1//sbin_rw/work)
overlay on /bin type overlay (rw,relatime,lowerdir=/bin,upperdir=/overlayfs/v1//bin_rw/upper,workdir=/overlayfs/v1//bin_rw/work)
overlay on /usr type overlay (rw,relatime,lowerdir=/usr,upperdir=/overlayfs/v1//usr_rw/upper,workdir=/overlayfs/v1//usr_rw/work)
overlay on /lib type overlay (rw,relatime,lowerdir=/lib,upperdir=/overlayfs/v1//lib_rw/upper,workdir=/overlayfs/v1//lib_rw/work)
overlay on /tmp type overlay (rw,relatime,lowerdir=/tmp,upperdir=/overlayfs/v1//tmp_rw/upper,workdir=/overlayfs/v1//tmp_rw/work)
overlay on /mnt type overlay (rw,relatime,lowerdir=/mnt,upperdir=/overlayfs/v1//mnt_rw/upper,workdir=/overlayfs/v1//mnt_rw/work)
overlay on /opt type overlay (rw,relatime,lowerdir=/opt,upperdir=/overlayfs/v1//opt_rw/upper,workdir=/overlayfs/v1//opt_rw/work)
overlay on /media type overlay (rw,relatime,lowerdir=/media,upperdir=/overlayfs/v1//media_rw/upper,workdir=/overlayfs/v1//media_rw/work)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
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 /run type tmpfs (rw,nosuid,nodev,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
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/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
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/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=30,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
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)
/dev/mmcblk0p1 on /media/sd-mmcblk0p1 type vfat (rw,relatime,gid=100,fmask=0002,dmask=0002,allow_utime=0020,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
tmpfs on /run/user/1001 type tmpfs (rw,nosuid,nodev,relatime,size=51180k,mode=700,uid=1001,gid=1001)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
fcheck는 나에게 이것을 제공합니다 :
root@AAGCloudwatcher:/home/SOLO# fsck /media/sd-mmcblk0p1/
fsck from util-linux 2.29.2
e2fsck 1.43.4 (31-Jan-2017)
fsck.ext2: Is a directory while trying to open /media/sd-mmcblk0p1
The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
or
e2fsck -b 32768 <device>
답변1
의견의 @luciano-andress-martini는 정확합니다. 문제는 FAT32 파일 시스템이 unix 사용자 및 그룹 소유권이나 액세스 권한을 지원하지 않는다는 것입니다.
따라서 해당 파일 시스템의 모든 파일과 디렉터리는 동일한 소유자와 그룹을 가지며 chown
사용/변경할 수 없습니다. chgrp
그러나 모든 파일의 소유자와 그룹 및 umask
/권한을 마운트 옵션으로 지정할 수 있습니다.
mount -o uid=SOLO,gid=SOLO /dev/mmcblk0p1 /media/sd-mmcblk0p1
설치 중에 또는 모두 보기에서 수동으로 지정할 수 있습니다 /etc/fstab
.vfat 마운트 옵션.