Adding a new disk to CentOS

For the purpose of this article, assume that /dev/sdb is the new disk that is to be installed.

Create linux partition on a disk

Create files system on the new partiton

Mount the filesystem

Now add entry to /etc/fstab so that the new filesystem is automatically mounted at boot time e.g.

To get UUID for a partition, you can use the command:

For CentOS:

For a MacOS:

A note on using noatime and nodiratime:

Since Linux 2.6.30 (released in 2009) the default behaviour for filesystem timestamps is as follows (taken from man page for mount):

Update inode access times relative to modify or change time. Access time is only updated if the previous access time was earlier than the current modify or change time. (Similar to noatime, but it doesn't break mutt or other applications that need to know if a file has been read since the last time it was modified).

Since Linux 2.6.30, the kernel defaults to the behavior provided by this option (unless noatime was specified), and the strictatime option is required to obtain traditional semantics. In addition, since Linux 2.6.30, the file's last access time is always updated if it is more than 1 day old.

This new behaviour for atime is called relatime. So there may be little or no apparent performance gain by using noatime explicitly and it’s true for ext and xfs filesystems.

 
 
Menu