5 August 2009

Mount A Hard Disk (EXT3 / EXT4) Automatically at bootime - Ubuntu

First you will need to make a directory for the hard drive to be mounted to.

Open a terminal.
sudo mkdir /etc/media/disk-1

Then you will need to edit fstab to mount the partition on booting. I am going to assume you know how to back up the fstab file, once backed up.
sudo gedit /etc/fstab

Add an additional line
/dev/sdb1 /media/disk-1 ext3 defaults,errors=remount-ro,users,user_xattr,user 0 0

then save.

(If you are mounting an ext4 filesystem simply change ext3 to ext4)


Now we need to take ownership of the partition otherwise you will need to keep opening it as root to write to it.
sudo chown -R YourUserName:YoursUserGroup /media/disk-1

Now reboot. When Ubuntu loads the partition should feature on your desktop and accessible for read and write.

No comments:

Post a Comment