Mouting additional harddisk to any nodes ======================================== When a node has been correctly established, you may also want to add to it an additional hard disk to increase the storage capacity of the local node. The procedure to do so is as follows: 1. Physically plug the additional hard disk to the node. To do so you need to physically mount and fix the hard disk in the casing of the server. Then plug in the power supply pin (which connects the power supply to the hard disk) and the sata cable (which connects the power supply to the hard disk). 2. Upon booting of the node, in a root terminal, launch the GUI application gnome-disks to obtain the information of the hard disks present in the current node. Specifically, identify the label and format type of the dditional hard disk you want to add. Commonly the disk is identified as e.g. sda or sdb. 2.5 Alternatively the hard disk partition can also be checked via the command line fdisk -l 2.7 Take a look at the items in /dev, i.e., ls /dev will also provide a glimps of the labels of the hard disks in the current node. 3. Once the name of the hard disk to be added as additional hard disk has been indentified, mount it to a location of your choice. To illustrate the procedure, let's assume the additional hard disk is identified as 'sdb' in /dev. Depending on the choice set when the hard disk was formatted, the type of the format may be 'ext4', 'xfs' or 'msdos'. To illustrate the procedure, let's assume the type of the format of the additional hard disk is 'ext4'. 5. To standardize the directory for mounting the additional hard disk, do the following: mkdir /state/partition1/ext_storage mount /dev/sdb /state/partition1/ext_storage chmod -R 777 /state/partition1/ext_storage 5. edit the content of /etc/fstab in the current node: cp /etc/fstab /etc/fstab.bk Add the following line to /etc/fstab: /dev/sd$Y /state/partition1/ext_storage ext4 defaults 0 0 In case the type of the format for the additional hard disk is 'xfs', replace the item 'ext4' by 'xfs' (without the quote). Remember to replace 'sd$Y' by e.g., 'sdb'. 6. Reload the entries in the modified /etc/fstab, by using the mount command: mount -av This shall avoid the need to reboot the node. At this stage, you shall be able to see the additional hard disk mouted as /state/partition1/ext_storage. ls -la /state/partition1/ drwxrwxrwx. 4 root root 4096 Sep 25 08:08 ext_storage df -T Filesystem Type 1K-blocks Used Available Use% Mounted on /dev/mapper/centos_compute--0--27-root xfs 786048000 7659684 778388316 1% / devtmpfs devtmpfs 8079180 0 8079180 0% /dev tmpfs tmpfs 8096876 10276 8086600 1% /run tmpfs tmpfs 8096876 0 8096876 0% /sys/fs/cgroup /dev/sda1 ext4 999320 144972 785536 16% /boot /dev/mapper/centos_compute--0--27-home xfs 669127456 33328 669094128 1% /home 192.168.1.10:/export/share nfs4 104806400 103308288 1498112 99% /share tmpfs tmpfs 1619376 36 1619340 1% /run/user/0 192.168.1.10:/home/user nfs4 862233600 424755200 437478400 50% /home/user /dev/sdb ext4 961299176 77852 912366812 1% /state/partition1/ext_storage 7. Test /state/partition1/ext_storage by su - $user ($user any user in the current node, must be non-root). Write a hello-world as $user in /state/partition1/ext_storage to assure that the disk is writable. 8. Failure in the syntax of or the type specified in /etc/fstab may result in the failure to reboot the node. Hence it is suggested to append the line at the last line in /etc/fstab, so that upon rebooting the node could still boot into the OS (despite the GUI may fail to be brought up). Fix the content of /etc/fstab or restore /etc/fstab using /etc/fstab.bk from the terminal and reboot. 8. At times, you may want to un-mount the additional hard disk. to do so (must lauch the command outside /state/partition1/ext_storage) umount /state/partition1/ext_storage 9. In case (8) fails, you may solve it by first stop the nfs server which may occupy the mounted disk. service nfs stop exportfs -u Unmout it only after the nfs server has been stopped. 10. Remember to restart the nfs service after un-mounting the additional hard disk service nfs start exportfs -r 11. To assure the procedures above have worked correctly, reboot the node and check to see if the node reboots to a state as expected. ###### additional note ########## The TYPE of the format of the hard disk present can be read off from the output of the following command line: df -T