How to mount a directory on multiple hard disks in Linux

Sometimes we need to mount multiple hard disks to the same directory, but the normal operation of the Linux system is that multiple hard disks cannot be mounted to the same directory. Next, let’s take a look at how to implement multiple hard disks to mount the same directory.

1. View the hard disk
fdisk -l View the hard disk to be mounted
#Record disk information
/dev /sda
/dev/sdb
2. Create a physical volume
sudo pvcreate /dev/sda
sudo pvcreate /dev/sdb
3. Create a volume group: for example, the volume name is volume
sudo vgcreate volume /dev/sda< a i=10> 4. Add a physical volume to the volume group sudo vgextend volume/dev/sdb View the volume group: sudo vgs 5. Create a logical volume: For example, the logical volume is called lgvolume sudo lvcreate -l 100%VG -n lgvolume volume   6. Partition formatting a> sudo mkfs.ext4 /dev/volume/lgvolume 7. Create the mounting directory sudo mkdir /data< a i=19> 8. Mount the hard disk sudo mount /dev/volume/lgvolume /data 9. Set the boot mount sudo vim /etc/fstab   /dev/volume/lgvolume /data ext3 defaults 0 2













Guess you like

Origin blog.csdn.net/BenChiZhuBaDaoWang/article/details/132541435