Sunday, March 6, 2011

Executable bit not set for external USB hard disks problem workaround

Problem : Previously the Linux system could automount external HDDs with executable permissions. Any file could be run directly from the hard disk. But the flip side was that almost many files including text files used to get the executable bit set. Hence Nautilus attempted to autorun the HDD. This apparently confused many first time users. So from 10.10 onwards Ubuntu stopped setting the executable bit on external HDDs. At what level it is done UDEV, HAL or PMOUNT is unclear tome. But since pmount is the final piece the workaround could be applied there.

Workaround :

First plug in the external disk. Display the mount points.

df

See where is the mount. For eg.

/dev/sdb1
/media/My-Passport

Then unmount the disk as root
su
umount /media/My-Passport

Then as a normal user mount it using the pmount wrapper for mount with the executable bit set for ALL files.

pmount --fmask 077 -d -e /dev/sdb1 My-Passport

fmask of 0 makes everything executable. pmount man claims that VFAT supports per file umask. But it stopped working for me in Ubuntu 10.10.

I kept the -d to show debug output just in case something goes wrong. It could be removed.

WARNING : The disk should be cleanly unmounted before attempting to insert it and use this proc. Same goes for attempting to re-insert and repeating this procedure. For every failed attempt (executable bit not set) unmount it again as root and redo. Clean unmount of drive is very necessary. If nothing works restart or use mount -l option.

No comments:

OK GOOGLE on Samsung Galaxy S7 doesn’t work

To make Ok Google detection work on Galaxy S7 (Galaxy series phones) we need to perform a couple of steps. 1. As long as Samsung S vo...