Description: If you mount a previous old hard drive you do not need 2nd, 3 steps!
1. View Linux hard disk information:
Fdisk
2. Format the new hard disk (very dangerous, note the location of the hard disk partition when operating):
3. Create the/data directory (the/data directory is where the hard drive will mount):
mkdir /data
4. Mount the partition:
sudo mount/dev/sdb1/data
5. View the UUID of the disk partition
sudo blkid
/dev/sda1:uuid= "8048997a-16c9-447b-a209-82e4d380326eTYPE="ext4"/dev/sda5:uuid=" 0c5f073a-ad3f-414f-85c2-4af83f6a437fTYPE= "swap"/dev/sdb1:uuid= " 11263962-9715-473F-9421-0B604E895AAAType= "ext4LABELtype "
6. Configure the boot automatically mount:
Because the Mount command will fail after restarting the server, write the partition information to the/etc/fstab file so that it is permanently mounted:
sudo vim/etc/fstab
Join:
Uuid=11263962-9715-473f-9421-0b604e895aaa/data EXT4 Defaults 0 1
Note:
<fs spec> <fs file> <fs vfstype> <fs mntops> <fs freq> <fs passno> Specific instructions to mount the/d ev/SDB1 For example:<fs spec>: partition positioning, can give UUID or label, for example: UUID=6E9ADAC29ADA85CD or label=software <fs File>: Location of specific mount point, for example:/data<fs vfstype>: Mount disk type, Linux partition generally ext4,windows partition generally NTFS< FS mntops>: Mount parameters, typically defaults<fs freq>: Disk check, default is 0<fs passno>: Disk check, default is 0, no check required
7. Restart the system
When you finish modifying the/etc/fstab file, run
sudo mount-a
command to verify that the configuration is correct. Improper configuration may cause the system to not start properly.
Reference:
http://blog.csdn.net/iam333/article/details/17224115 (the above content is transferred from this article)
Ubuntu 16.04 boot automatically mount hard disk partition (GO)