我們在購買服務(wù)器時有些商家會贈送數(shù)據(jù)盤,時間久了以后我們站點數(shù)據(jù)趨于龐大,需要購買更大的磁盤來存儲,此時我們需要掛載數(shù)據(jù)盤到指定的目錄。今天在寶塔官方論壇看到了一個關(guān)于掛載數(shù)據(jù)盤的腳本,可以一鍵自動掛載數(shù)據(jù)盤到/www目錄。當(dāng)然如果你需要掛載到其他目錄的話可以把腳本下載到本地,把“setup_path=/www”后的“/www”改成你要掛載的目錄即可。
寶塔一鍵磁盤掛載命令:根據(jù)系統(tǒng)選擇命令后進入ssh執(zhí)行命令即可
輸入fdisk -l 查看硬盤信息
[root@VM_0_11_centos ~]# fdisk -l Disk /dev/vda: 53.7 GB, 53687091200 bytes, 104857600 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos Disk identifier: 0x000c5e30 Device Boot Start End Blocks Id System /dev/vda1 * 2048 104857599 52427776 83 Linux Disk /dev/vdb: 21.5 GB, 21474836480 bytes, 41943040 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes
掛載命令:
Centos系統(tǒng)請使用以下命令:
yum install wget -y && wget -O auto_disk.sh https://download.bt.cn/tools/auto_disk.sh && bash auto_disk.sh #備用: yum install wget -y && wget -O auto_disk.sh https://raw.githubusercontent.com/wn789/www/master/auto_disk.sh && bash auto_disk.sh
Ubuntu系統(tǒng)請使用以下命令:
wget -O auto_disk.sh https://download.bt.cn/tools/auto_disk.sh && sudo bash auto_disk.sh #備用: wget -O auto_disk.sh https://raw.githubusercontent.com/wn789/www/master/auto_disk.sh && sudo bash auto_disk.sh
Debian系統(tǒng)請使用以下命令:
wget -O auto_disk.sh https://download.bt.cn/tools/auto_disk.sh && bash auto_disk.sh #備用: wget -O auto_disk.sh https://raw.githubusercontent.com/wn789/www/master/auto_disk.sh && bash auto_disk.sh
建站咨詢熱線
029-33273980