Pags - thank you. Yes, FS4 was due to my brain getting scrambled by so many foiled attempts at solving this on my own. Yes - ext4. But you're ahead of me here - can you be a bit more specific? Do you mean that your 'public' folder becomes the destination for anything that you put in that drive - apart from anything you may want to restrict to 'root'? And that therefore that 'public' folder can, in theory, expand eventually to the capacity of the drive itself?
That is exactly correct!
Since it's just a folder (directory) on the drive, without any file-system constraints regarding size, it generally becomes the biggest folder on it...
Hold on a sec...
There. I just plugged in my newest drive. I re-partitioned it when I got it:
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x8d399bc0
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 1305 10482381 c W95 FAT32 (LBA)
/dev/sdb2 1306 60801 477901620 5 Extended
/dev/sdb5 1306 7832 52428096 83 Linux
/dev/sdb6 7833 60801 425473461 83 Linux
It's a WD 500GB drive. I shrunk the VFAT partiton down to 10Gb (so it could still be plugged into a Windows machine with getting the ext file-systems trashed).
I then added a 50GB partition (I have plans to install PCLOS on there, so it can be moved from PC to PC ... I'm doing that now with a 20GB HDD, but it's space limited
); and the balance (~400GB is another ext4 partition labeled Data:
Filesystem Size Used Avail Use% Mounted on
/dev/sda7 21G 15G 4.8G 76% /
tmpfs 1001M 0 1001M 0% /dev/shm
/dev/sda6 251G 226G 25G 91% /media/disk
/dev/sdb6 400G 302G 78G 80% /media/Data
Contents of Data:
ls /media/Data/ -lh
drwx------ 2 root root 16K 2010-07-18 15:05 lost+found/
drwxrwxrwx 3 root root 4.0K 2010-07-18 15:09 public/
And space usage (as a normal user):
du /media/Data/ -hx --max-depth=1
du: cannot read directory `/media/Data/public/backup/var/www/web6/user/web6_admin/Maildir': Permission denied
du: cannot read directory `/media/Data/public/backup/var/www/web7/user/web7_admin/Maildir': Permission denied
du: cannot read directory `/media/Data/public/backup/var/www/web8/user/web8_admin/Maildir': Permission denied
du: cannot read directory `/media/Data/lost+found': Permission denied
You'll notice I don't (as a regular user) have access to everything (because i copied some stuff as root from elsewhere
), but everything on that drive is in the "public" directory, at the moment...
...oh, you've posted again:
pags - having said the above, what's puzzling me most is that I have three other USB external drives (3.5inch), two of which are IDE and one SATA, and all of those have an ext3/4 file system. All I had to do on any of them to allow my user account to write to them was as root, to change the permissions. But as I say, on this drive,I'm told that the permissions of this "disk" could not be determined. That sounds odd to my untutored ear. Or not?
Edit - since the above I've tried your fix as per my own interpretation and voila! - it works. Thank you. However I'm not marking this as solved yet until I can get some solution to the question above - how come other three drives haven't needed any sort of fix?
Ramchu - I guess your response was superseded by pags' before I could get around to replying to you. Thank you anyway for the input.
It is possible to set the permissions at the drive level (via /etc/fstab, or mount options or other methods), but I find that more confusing, and it ends up being hit-and-miss for me.
I prefer to leave the root restricted, and create the folder as I've described. That way, regardless of how, where or by whom the drive is mounted, there is a known location where things can be saved...
Also, if you leave it as VFAT, this probably will not be an issue in almost all cases...
Hope that helps, some.