venerdì 17 febbraio 2012

UBUNTU - Add an entry to fstab (fat32 rw partition)

Quite simple task, anyway:
First of all give a look to your mounted filesystems, ok I want automatically at boot to mount the fat32 partition /dev/sda7 in the /media/DATA mount point.

fem@rodizio:~$ df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda5 206626768 33899652 162231052 18% /
none 1854844 304 1854540 1% /dev
none 1862524 284 1862240 1% /dev/shm
none 1862524 356 1862168 1% /var/run
none 1862524 0 1862524 0% /var/lock
none 1862524 0 1862524 0% /lib/init/rw
/dev/sda7 102348272 15804064 86544208 16% /media/DATA

create a mount point (in this case /media/DATA/ )

fem@rodizio:~$ sudo mkdir /media/DATA

generate the uuid number for the partition /dev/sda7

fem@rodizio:~$ sudo ls -l /dev/disk/by-uuid
total 0
lrwxrwxrwx 1 root root 10 2012-02-17 09:46 429CA4729CA461E1 -> ../../sda3
lrwxrwxrwx 1 root root 10 2012-02-17 09:46 7830198a-6c13-4b13-99ac-c6fe1eb15e80 -> ../../sda5
lrwxrwxrwx 1 root root 10 2012-02-17 09:46 9cf45b4e-2b01-4e70-806b-be488e4ebe59 -> ../../sda6
lrwxrwxrwx 1 root root 10 2012-02-17 09:46 C2C0A2A6C0A29FE1 -> ../../sda2
lrwxrwxrwx 1 root root 10 2012-02-17 09:46 C8D6A22CD6A21AA8 -> ../../sda1
lrwxrwxrwx 1 root root 10 2012-02-17 09:46 E9ED-DDA3 -> ../../sda7

So the uuid for the partition /dev/sda7 is E9ED-DDA3
Then edit /etc/fstab with vi or another editor.

fem@rodizio:~$ sudo vi /etc/fstab

and add this line:

UUID=E9ED-DDA3 /media/DATA/ vfat auto,umask=000 0 0

Note that "auto,umask=000 0 0" let you gain read/write permission on fat32 filesystem for the normal user.
Then reboot or give this command

fem@rodizio:~$ sudo mount -a

that's all

Nessun commento:

Posta un commento