简体   繁体   中英

How to attach extra volume on Centos7 server

I have created additional volume on my server. Filesystem Size Used Avail Use% Mounted on /dev/sda1 19G 3.4G 15G 19% / devtmpfs 874M 0 874M 0% /dev tmpfs 896M 0 896M 0% /dev/shm tmpfs 896M 17M 879M 2% /run tmpfs 896M 0 896M 0% /sys/fs/cgroup tmpfs 180M 0 180M 0% /run/user/0 /dev/sdb 25G 44M 24G 1% /mnt/HC_Volume_1788024 How can I attach /dev/sdb either to the whole server (I mean merge it with "/dev/sda1") or assign it to specific directory on server "/var/lib" without overwriting current /var/lib...

Your will not be able to "merge" as you are using standard sdX devices and not using something like LVM for file systems. As root, you can manually run: mount /dev/sdb /var/lib/

The original content of /var/lib will still be there (taking up space on your / filesystem) To make permanent, (carefully) edit your /etc/fstab and add a line like:

/dev/sdb           /var/lib                   FILESYSTEM_OF_YOUR_SDB_DISK     defaults        0 0

You will need to replace "FILESYSTEM_OF_YOUR_SDB_DISK" with the correct filesystem type ("df -T", "blkid" or "lsblk -f" will show the type)

You should test the "correctness" of your /etc/fstab by first: umount /var/lib (if you previously mounted) Then run: mount -a then df -T and you should see the mount point corrected and the "mount -a" should have not produced any error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM