In my current setup, I have a RAID0 array of 2x3TB HDDs with btrfs, two partitions:
/
/home
Under the /home
directory, there are two users, both admin, one of which is myself.
So far, this setup is working out pretty nicely, although btrfs is fairly slow.
I recently acquired a pretty nice 500 GB SATA HDD. I'm going to format it w/ ext4
or XFS
for increased performance for ephemeral things like my testing VMs and such. I would like to mount it under my home directory at boot, ie:
/home/haneefmubarak/extradrive
The first thing that came to my mind was to use /etc/fstab
, but AFAICT then the permissions won't be set correctly for me to normally use it.
Essentially, I want to mount the drive so that it is mounted at ~/extradrive
with permissions set like any other directory, so that I "own" the entire drive. How can I go about doing this?
Try a line like this in /etc/fstab
:
UUID=XX /home/user/extradrive ext3 rw,noauto,user,sync 0 2
Examples are also shown using UID/GID too:
UUID=XX /home/user/extradrive ext3 rw,exec,uid=userX,gid=grpX 0 2
NOTE
You can also override when doing the actual manual mounting like this using mount
+ options:
$ sudo mount <device> <mount-point> -o uid=foo -o gid=foo
Lastly, you can avoid the whole business by making the top level of the mounted extra drive owned by userX/groupX like so, after manually mounting the HDD:
$ sudo chown -R userX.groupX <directory>
Then in /etc/fstab
do
<device> <directory> ext3 user,defaults 0 2
The userX should now be able to access the drive upon reboots.
NOTE: There's an assumption that the /home/userX
has already been mounted with several of the options above. So take care that its been mounted prior.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다