Saturday, December 25, 2010

WD My Passport for Mac on Slackware and formatted in NTFS

Ok, yes, this problem was a little weird, but some reasons I have bought an external USB HD for Mac and I want to use it with my Slackware 13.1 machine.
So step by step the problems I had to use it was:
  1. When I plug the disk on my PC appears two devices in /dev :
    1. /dev/sdb1 : hfsplus filesystem; this is the disk I want use.
    2. /dev/sr1 : udf filesystem; this is other small disk, about 600MB, that I don't care by now.
  2. The HD that was formatted for Mac (/dev/sdb1), it use HFS+ filesystem. I want use the disk on Linux and Windows so I need a NTFS filesystem disk. I have used fdisk to change the filesystem of sdb1 to NTFS and then I have formatted it with mkfs.ntfs -f -L Disk_label /dev/sdb1
  3. When I have mounted sdb1 I had no access to the data stored in the disk, but if I did it on windows it works fine, so the problem was the way that is was mounted. I had installed NTFS-3g and the problem was solved with:
    mount -t ntfs-3g /dev/sdb1 /media/hd
    By this way, now I have complete access to the disk, but I have to mount it manually and as root.
  4. On /etc/fstab I had the row:
    /dev/sdb1 /media/memory0 auto noauto,user,exec,rw 0 0
    When the disk was mounted it is did it using the native NTFS filesystem instead of NTFS-3g. I have changed it by:
    /dev/sdb1 /media/memory0 ntfs-3g defaults 0 0
    With it I can mount the drive with mount /dev/sdb1 but just as root. I suppose that with this change I could have problems with volumes with other filesystems (FAT32 for example) linked to the same device (/dev/sdb1). But this is another problem that don't care by now.
Nothing that I have searched and tried have helped.
  1. I have created the file /etc/filesystems like a copy of /proc/filesystem but changing the line ntfs by ntfs-3g, but doesn't work.
  2. From the FAQ of NTFS-3g I have found something that should have help me but it didn't. http://www.tuxera.com/community/ntfs-3g-faq/#unprivileged
  3. Another page referring to the FAQ but with more information. http://pxnh.wordpress.com/ (at the end of the page).
  4. I have changed the group of ntfs-3g to plugdev but doesn't work.
So much time I have gave it to that little problem, so I'm thinking in changing the HDD filesystem to EXT3 or 4.
Finally I have formatted the HDD with EXT4 supposing that it would resolve the problem. But when I have mounted the HDD, I didn't have access to write in it. I have deleted from /etc/fstab the line that define /dev/sdb1 and after mounting the drive for first time, as root, I have changed the owner and permissions to my user and 760. Now the drive is mounted automatically in KDE using HAL. A dirty solution but is ok by now.

The error that appears when I pugged a USB HDD was solved adding my user to the groups users and plugdev and restarting the computer:
# usermod -aG users my_user
# usermod -aG plugdev my_user

No comments: