fstab for USB hard-drive: Directory permissions [Solved]

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
BeakersHelper

fstab for USB hard-drive: Directory permissions [Solved]

Post by BeakersHelper »

Hello everyone.

I hope I am posting this topic in the correct forum.

So here is the issue I would like to resolve.

I have a Seagate USB hard-drive that I use to store iso images of my DVD collection so I can watch them using a small media device (Sumvision Cyclone Micro HDMI). The Seagate drive is formatted to NTFS and has a single partition. The disk was formatted using the Disk Utility in Linux Mint 8 (64 bit). If I transfer directories and files from my laptop running LM8, I can access those directories and VLC or a similiar media player. I can also connect the Seagate USB drive to a Windows PC and access the files. Unfortunately, when I connect the USB drive to the Sumvision Cyclone Micro media device, it can only see the directories or files transferred from a Windows PC, not those transferred from my Linux PC.

After a little experimentation, I discovered that I could not chmod the directories on the USB drive.

Below is the output of executing the ls -l command

Code: Select all

nick@HP2030 /media/Seagate $ ls -l
total 0
drwx------ 1 nick nick 0 2010-02-01 23:56 Movies
If I attempt to chmod the directory Movies (using root) to give full access to everyone, using

Code: Select all

chmod -R 0777 Movies
It doesn't change the mode of the directory.

Based upon my very limited knowledge of Linux, I suspect this is caused the fstab file and the way the USB drive is mounted.

My fstab file is shown below.

Could someone please advise how I should configure fstab so the USB device allows full access to everyone.

Any help or suggestions would be great. Thank you!

Code: Select all

# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
# / was on /dev/sda1 during installation
UUID=a7f691c7-a893-49ca-bb0d-9aebe5fbc2d4 /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=483a25bf-235d-415a-a82e-58ea16ad8a88 none            swap    sw              0       0
/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto,exec,utf8 0       0
/dev/sda1 none swap sw 0 0
Additional information

Code: Select all

HP2030 Seagate # blkid
/dev/sda1: UUID="a7f691c7-a893-49ca-bb0d-9aebe5fbc2d4" TYPE="ext4" 
/dev/sda5: UUID="483a25bf-235d-415a-a82e-58ea16ad8a88" TYPE="swap" 
/dev/sdb1: UUID="7882C0CD143D9D01" LABEL="Seagate" TYPE="ntfs" 
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Jeff91

Re: fstab for USB hard-drive: Directory permissions

Post by Jeff91 »

ntfs partition formats do not allow for Unix file permissions. Which why you can not chmod to own the directory on Mint.

That being said - if your Windows system can see the files written to the ntfs partition from Linux but your media device cannot - sounds like an issue with your media device.

EDIT: Also just so it is clear - just like on vfat partition all *nix users should be able to read/write to them once they are mounted.

Regards,
~Jeff
BeakersHelper

Re: fstab for USB hard-drive: Directory permissions

Post by BeakersHelper »

Hi Jeff,

thank you for your reply. I did not realise that NTFS did not support Linux file permissions. I knew that NTFS had additional security that FAT / FAT32 does not have, which was why I suspected that may be problem. I did not know that this did not extend to Linux. The reason I posted was because I suspected the media device was Linux based, and this was why it might have had problems with the files / directories transferred from another Linux PC.

So just to confirm, is there is no way to set a directory on the USB device to drwxrwxdrx (full read write access to everyone?).

Does anyone have any idea what could be different about the permissions of files / directories transferred to the USB drive from a Linux PC compared to those transferred from a Windows PC. The media device works fine with those files transferred from windows but not from Linux. Even if its the same file. I am confused!

As always, I appreciate the opportunity to learn more about Linux from those who have more experience than I.

Cheers.
altair4
Level 20
Level 20
Posts: 11458
Joined: Tue Feb 03, 2009 10:27 am

Re: fstab for USB hard-drive: Directory permissions

Post by altair4 »

Here's my guess. And trust me, it's a guess because I'm not familiar with all the internal workings of the Linux ntfs driver.
The only thing I can think of that fits all your symptoms is file name length.

NTFS on windows actually creates two file names for every file: a long file name and a short file name. From Linux to Windows you only see the long but the short is available if needed. A short file name conforms to the old DOS rule that filenames must be in an 8.3 format - 8 characters for the name itself and 3 characters for the file extension. This was done to be compatible with older windows operating systems - DOS, Win 3.1, etc...

When you access a file saved by windows both names will be present ( although the short one is stealthed in a normal Windows to Linux operation ). Perhaps Linux does not generate short file names because there aren't many DOS based systems running around any more except maybe your media device.

As an experiment, save a file from Linux to the Seagate in an 8.3 format and see if your device can now read it.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
BeakersHelper

Re: fstab for USB hard-drive: Directory permissions

Post by BeakersHelper »

Hi Altair

Thank you for the suggestion. In previous tests, I had created an empty directory called 'TEST' on the Linux PC and copied it to the USB hard-disk, but the media device could not see it. However, if I then move that directory to a Windows PC, and then move it back to the media device, it is now visible. The media device will certainly see long titles, for example 'Madagascar_Main_Feature_Disk1.iso', but only if I send it to the USB drive from a Windows PC. After reading you post, I tried re-naming a few files from the Windows PC to see if that would be sufficient to create the second file name you were referring to. Sadly that did not work either. The only solution is to physically move the file and put it back again.

Is there anyway I can make Linux copy files to the USB drive in exactly the same way Windows does, otherwise it means moving a lot of large file back and forth.

Thanks again for your post.

Best wishes
Jeff91

Re: fstab for USB hard-drive: Directory permissions

Post by Jeff91 »

BeakersHelper wrote:Is there anyway I can make Linux copy files to the USB drive in exactly the same way Windows does, otherwise it means moving a lot of large file back and forth.
No you cannot. The ntfs file system is closed source as well as Windows is (as I am sure you are aware) - meaning the ntfs-3g driver is a reverse-engineering genius in the fact that it works at all.

Regards,
~Jeff
altair4
Level 20
Level 20
Posts: 11458
Joined: Tue Feb 03, 2009 10:27 am

Re: fstab for USB hard-drive: Directory permissions

Post by altair4 »

I really don't know. The only reason I thought it was a short file name thing is because I have an old DOS based utility that has the same problem. It can see the short name if windows created the file but not if linux created the file. I did do a search last night on the device you're using and found this which supported by theory:

http://www.avforums.com/forums/11355726-post148.html
Missing files found
I bought a Cyclone Micro about 3 weeks ago (£24 from Amazon), along with an HDMI cable (about £1.50).
Unfortunately, when I plugged in my 500GB maxtor drive (NTFS) I could not find all of the files on the disk. I have over 100 files saved as Xvid (AVI) files in one folder, and a load of films saved as VOBs in other folders.
Thanks to the post by riku2 I discovered that most (if not all) of my missing files had long file names but no 8.3 name. Using dir /X I could see which files had missing short names.
First of all I tried using the fsutil command to assign short names to files. This did not work.
So, I simply renamed the files in Windows and - hey presto! - I could see them on the Cyclone micro.
It seems that my problem was that I copied a lot of the files to the usb drive from Ubuntu linux - and this did not assign a short name to the file in NTFS.
By the way, at one point during this process I copied a bad AVI file to the disk and 80 of the files I could previously see disappeared. When I deleted the bad (at least, it is bad as far as the cyclone is concerned) I could see the files again.
Hope this helps.
But as you can see from the highlighted area, he did what you posted you did and renamed them in windows to fix it.
Like I said it was a guess on my part and I'm not even sure if linux isn't writing the short name or whether it's because you formatted the seagate to ntfs from a linux utility rather that from a windows utility.

Sorry I could not be more helpful.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
BeakersHelper

Re: fstab for USB hard-drive: Directory permissions

Post by BeakersHelper »

Hi Altair,

thank you for taking the time to look up the information about the Sumvision Cyclone Micro. I am pleased to report that your initial hunch was correct. The issue was a result of missing short names. Following the information in the post you found, I was able to identify those files that had the missing short names using the DOS command DIR /X. Once I knew which files had the short name missing, I could assign one using the DOS command >fsutil file setshortname shortnam Long_Name_Of_File.iso

I would not have known about these two commands it it wasn't for your post so thank you again for taking the time to look into this. I did spend a lot of time searching the internet regarding this problem but I probably went down the wrong path with the file permissions idea.

Best wishes,

BeakersHelper
Locked

Return to “Software & Applications”