CHMOD on a USB drive

I’ve run into a problem with one of my USB drives that I use as a backup drive - for some reason all my directories and files have some permission issue as noted below:

-rw-r–r-- 1 rdok users 180831232 Feb 7 2011 MailArchiveCurrent.pst
-rw-r–r-- 1 rdok users 851968 Jan 25 2007 mailbox.pab

I’ve tried changing various files and directories on the drive as the user and as su, but to no avail.

sudo chmod uog=rwx mailbox.pab

or

chmod -R uog=rwx mailbackup/

I’ve tried to get some answer from the CHMOD manual and some websites, but to no avail.
Nothing seems to work - my guess is that there must be some issue that I’m missing as a noob.

Thanks
RD

OpenSuse 12.1 XFCE

If you map this drive in your fstab file, why not show us what it says for this drive?

sudo cat /etc/fstab

Highlight the drive in question.

Thank You,

What is file system type on the device. Often those devices have non Linux file systems on them (like NTFS). And these do not have those Linux features like owner, group and access bits. They are only faked on a Linux system. Thus you can not change them.

This is the output from FSTAB:

/dev/disk/by-id/ata-WDC_WD5000AAKS-22A7B0_WD-WCASY0490825-part1 swap swap defaults 0 0
/dev/disk/by-id/ata-WDC_WD5000AAKS-22A7B0_WD-WCASY0490825-part2 / ext4 acl,user_xattr 1 1
/dev/disk/by-id/ata-WDC_WD5000AAKS-22A7B0_WD-WCASY0490825-part3 /home ext4 acl,user_xattr 1 2
proc /proc proc defaults 0 0
sysfs /sys sysfs noauto 0 0
debugfs /sys/kernel/debug debugfs noauto 0 0
usbfs /proc/bus/usb usbfs noauto 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0

I assume that it must be NTFS as I can use this drive under Windows as well.

RD

Dear RokDok,

Please post your computer ouput like the fstab above between CODE tags: http://forums.opensuse.org/english/information-new-users/advanced-how-faq-read-only/451526-posting-code-tags-guide.html

Also,when @jmcdaniel3 asks you to highlight the entry in the fstab that is applicable, then do so please. E.g. by saying: it is the nth from the top.

And for a start, @jmcdaniel3 said: “If you map this drive in your fstab file, …”. Mind the “If”. This seems not to be the case. because there is no entry in fstab for others then swap,* /* and* /home* (the last two are both ext4), end the several system specials.

To see as what and where it is mounted, post the output of

mount

And when it is NTFS, reread what I have said about the impossibility of doing something to an NTFS file system that is not implemented in of it.

Don’t forget lsub as well.

sudo lsusb

Thanks for your patience.
OK outputs as required:

  1. mount
devtmpfs on /dev type devtmpfs (rw,relatime,size=432104k,nr_inodes=108026,mode=755)
tmpfs on /dev/shm type tmpfs (rw,relatime)
tmpfs on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=000)
/dev/sda2 on / type ext4 (rw,relatime,user_xattr,acl,barrier=1,data=ordered)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
tmpfs on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,relatime,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct,cpu)
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/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
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=22,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
tmpfs on /var/run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
securityfs on /sys/kernel/security type securityfs (rw,relatime)
tmpfs on /var/lock type tmpfs (rw,nosuid,nodev,relatime,mode=755)
mqueue on /dev/mqueue type mqueue (rw,relatime)
tmpfs on /media type tmpfs (rw,nosuid,nodev,noexec,relatime,mode=755)
/dev/sda3 on /home type ext4 (rw,relatime,user_xattr,acl,barrier=1,data=ordered)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
gvfs-fuse-daemon on /home/emrich/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,relatime,user_id=1000,group_id=100)
/dev/sdc1 on /media/My Passport type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)
/dev/sdb1 on /media/Elements type vfat (rw,nosuid,nodev,relatime,uid=1000,gid=100,fmask=0022,dmask=0077,codepage=cp437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks)

Excellent - I now know it is “vfat”.

  1. lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 050d:0237 Belkin Components F5U237 USB 2.0 7-Port Hub
Bus 002 Device 002: ID 413c:3010 Dell Computer Corp. Optical Wheel Mouse
Bus 001 Device 004: ID 1058:1001 Western Digital Technologies, Inc. External Hard Disk [Elements]
Bus 001 Device 005: ID 1058:0730 Western Digital Technologies, Inc.

Just some background.
I got both drives plugged in on a USB hub. I carry the WD-Passport with me when I travel, then use rsync to do backups to two different WD Elements (one black and one silver) to ensure I got a backup at home and at work.
I did an rsync just before I left for a trip two weeks ago. When I returned I deleted some directories that were double ups after I redid the directory structure. I noticed that the drive was still full and found all the deleted files in the .Trash-1000 directory. Every time I deleted them through the Thunar File Manager they just reappeared, so I switched to using the rm command on the files and sub-directories till I go to this one directory structure that did not like it. I noticed it had some “locks” on the folder icons and realised that it must be permission, so started the process to change with chmod.

Thanks again for the assistance to date.

RD

So the (NTFS) hard drive(s) partitions in question are not listed in your fstab file. That means they are being mounted on the fly and you deal with them through the Device Notifier in the System Tray. I am not sure what permissions that you are getting, but using NTFS as a backup device in openSUSE while not mounting them and controlling the permissions through your fstab file is asking for trouble, perhaps as you have already found. I do use NTFS hard drives, but I use them for only multimedia files such as MP3’s, videos and common documents. To backup important files from openSUSE I use EXT4 partitions. In all cases, the fstab entries means I do not normally unplug the hard drives on the fly but turn off the PC before I unplug them and plug them back in before I turn the PC on. For NTFS drives, I modified the fstab entry so that you need not be root to write to the drive and backing up EXT4 partition works best when written to a EXT4 partition backup drive using (in my opinion) a by file backup plan. If you are interested in knowing more, about mounting drives from your fstab file just ask, but on the fly connections would be the last thing you want to do for backup.

Thank You,

On Mon, 27 Feb 2012 20:16:02 -0500, RokDok
<RokDok@no-mx.forums.opensuse.org> wrote:

> I did an -rsync- just before I left for a trip two weeks ago. When I
> returned I deleted some directories that were double ups after I redid
> the directory structure. I noticed that the drive was still full and
> found all the deleted files in the -.Trash-1000- directory. Every
> time I deleted them through the Thunar File Manager they just
> reappeared, so I switched to using the -rm- command on the files and
> sub-directories till I go to this one directory structure that did not
> like it. I noticed it had some “locks” on the folder icons and realised
> that it must be permission, so started the process to change with
> -chmod-.

when deleting files, I use gnome commander which seems to bypass using
…trash and just deletes files.

Max Wachtel

You see in your mount output that it is VFAT (and not NTFS), but that is still a non-Linux file system type and thus misses the same features as NTFS does.

I won’t repeat @jmcdaniels3’s story, but non-Linux file systems should only be used for exchanging files with non-Linux systems. Not for native usage (we even saw people here thinking that using NTFS for their /home would be a good idea, which it is not, you then better go fow Windows on the whole of your system :frowning: ) use only Linux file systems. That is also true for backup. How do you think you can restore a file (or a whole file system contents) where all the user/group, access bits and more meta information is lost?

Thus create an ext4 fs on that device and give it a line in your fstab (can all be done using YaST > System > Partioner if you do noit know how to do it on the CLI). When you want to not hvve it connected all the time, give it the noauto parameter and (u)mount when needed.

Thanks gents - I’m definitely a wiser penguin although still ever so slightly confused.
I’ll try to get the EXT4 going and at least install Gnome Commander.

Again thanks.

RD