0

I plugged in another hard disk that I want it to use as a backup hard disk

when I do:

 fdisk -l

I get:

Disk /dev/sdb: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt


Device     Start       End   Sectors   Size Type
/dev/sdb1   2048 976773134 976771087 465.8G Linux filesystem

So I wanted to format the hard disk that it will suit to windows also so I installed the package dosfstools and run:

mkdosfs -F 32 -I /dev/sdb1

Now I mounted the hard disk to: /home/backup via the command:

mount -t vfat /dev/sdb1 /home/backup

now when I'm doing ls -l in home directory I see:

drwxr-xr-x  2 root root 32768 Jan  1  1970 backup

I try to give it permissions:

chmod -R -v 777 backup

and I get:

mode of 'backup' changed from 0755 (rwxr-xr-x) to 0777 (rwxrwxrwx)

But when I do ls -l it still have the same permissions (rwxr-xr-x)

What is the problem? why it dosen't changed ? Also I wanted to know if it's right what I did with the format to make it work on windows also...?

Thanks.

Stephen Rauch
  • 4,209
  • 14
  • 22
  • 32
Nati V
  • 165
  • 1
  • 1
  • 3
  • @Patrick I already try it, when I run `sudo chattr -i file` I get `chattr: Inappropriate ioctl for device while reading flags on backup` – Nati V May 26 '17 at 16:36
  • The directory isn't immutable, it just doesn't support the file permissions concept. See my answer below. – Patrick May 26 '17 at 16:37

1 Answers1

1

FAT32 does not support per-file and per-directory permissions in the UNIX sense. The permissions are set based on the mounting of the drive.

See: here, here and here.

Patrick
  • 589
  • 3
  • 20
  • Hey thanks , I did `sudo mount /dev/sdb1 /home/backup -o dmask=000,fmask=111` and it works, I will accept your answer in a few minutes, but I can't up vote it because I don't have the reputation , sorry – Nati V May 26 '17 at 16:44
  • No problem, glad it helped. – Patrick May 26 '17 at 16:56