Pages

jeudi 29 août 2013

mount a new partition using fstab

I cleaned old partitions in my Ubuntu12.04 by using the gparted.
1) for unuseful partition: I chose 'delete' in the gparted interface.
   then choose the 'appy' to realise this step. This steps gives unallocated spaces.
3) then I allocate spaces for new partitions.
    In my case, I give a swap of 4G (extended, linux-swap format) and give 200 G to a new partition (primary and ext4 format). This produces "new partition #1" and "new partition #2".
    Then click on the "apply" (or an symbol of ok), the new partitions are made, and the gparted gives the names of  sda2, sda3

For the /dev/sda3 it is a file system that I hope to mount it automatically each time. So I need modify the /etc/fstab.
1) cp /etc/fstab  /etc/fstab.backup
2) To list your devices by UUID use blkid:  sudo bldid
    save the UUID of the /dev/sda3
3) sudo emacs /etc/fstab:
UUID=myUUID   /media/data    ext4    users,defaults  0    2
(https://help.ubuntu.com/community/Fstab for more information)
/media/data is the mounting point of the /dev/sda3.
users,defaults: are the options
4) restart the computer and type: df
the file sytem on the /dev/sda3 can be mounted. The root have the rwe permission and other users have limited rights in this example.
5) if want to give a user the read/write permission:
need modify the fstab by adding uid=1000,gid=1000 (if this is the uid and gid of the user).
6) if want to give all the current users the write permission:
it seems need to create a group, and then add the current users in the group, and then give the read/write permission of this filesystem to this new group.


Aucun commentaire:

Enregistrer un commentaire