Ubuntu – How to change files permissions from a different hard drive

11.10dual-bootpermissionswindows 7

I installed yesterday ubuntu 11.10 on my 80GB hard drive and i can't change files permissions on my second hard drive.

How to fix this?

ps: i have dual-boot with win7

mount:

/dev/sda5 on / type ext4 (rw,errors=remount-ro,commit=0)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /root/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev)
dev/sdb1 on /media/600CA8AD0CA88020 type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions)

Best Answer

Based on the mount output, it looks like your second hard drive is formatted with the NTFS file system. This isn't a bad choice if you want to be able to access the files from both Ubuntu and Windows, but has slightly different semantics to native file systems.

The NTFS driver does have support for mapping Windows user IDs to equivalent UNIX user IDs though, which might help. There is a tool called ntfs-3g.usermap that can help you build up the user mapping:

  1. First unmount the NTFS partition by running sudo umount /dev/sdb1 from a terminal.

  2. Build up the user map by running sudo ntfs-3g.usermap /dev/sdb1 in the terminal. Provide the Ubuntu user account names for each Windows account you want to map. The program will create a file called UserMap in the current directory.

  3. Remount the file system and copy the UserMap file to the special .NTFS-3G directory:

    sudo mount -t ntfs-3g /dev/sdb1 /mnt

    sudo mkdir /mnt/.NTFS-3G

    sudo mv UserMap /mnt/.NTFS-3g/

  4. You may need to unmount and remount the file system again to make this user mapping take effect.

Once this user mapping file is in place, your Ubuntu user account should have access to any files or folders owned by your Windows account, and any files you create in Ubuntu should look like they were created by your Windows account when you boot Windows.