全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 1566|回复: 15

收了一个ultravps.eu不知道咋玩大佬们进来指点一下

[复制链接]
发表于 2018-12-27 14:50:49 | 显示全部楼层 |阅读模式
小鸡装了lnmp显示10g硬盘  30g数据盘百度了好久还是挂不上去...好无语啊
发表于 2018-12-27 14:53:13 | 显示全部楼层
你发下你操作的指令和过程,帮你参考下
发表于 2018-12-27 14:56:02 来自手机 | 显示全部楼层
不是很懂啥叫挂不上
发表于 2018-12-27 14:59:48 | 显示全部楼层
一键 lnmp ,简单得1b,官方都有脚本
发表于 2018-12-27 15:02:48 | 显示全部楼层
data  软链接
发表于 2018-12-27 15:12:07 | 显示全部楼层
没挂载数据盘把,装之前挂载下就行了,不会挂载就用oneinstack这个一件脚本吧
wget http://mirrors.linuxeye.com/scripts/auto_fdisk.sh
chmod +x ./auto_fdisk.sh
./auto_fdisk.sh
发表于 2018-12-27 15:15:47 | 显示全部楼层


  1. #/bin/bash
  2. #########################################
  3. #Function:   auto fdisk
  4. #Usage:      bash auto_fdisk.sh
  5. #dbdir:     /home/wwwroot
  6. #########################################

  7. count=0
  8. tmp1=/tmp/.tmp1
  9. tmp2=/tmp/.tmp2
  10. >$tmp1
  11. >$tmp2
  12. fstab_file=/etc/fstab

  13. #check lock file ,one time only let the script run one time
  14. LOCKfile=/tmp/.$(basename $0)
  15. if [ -f "$LOCKfile" ]
  16. then
  17.   echo -e "\033[1;40;31mThe script is already exist,please next time to run this script.\033[0m"
  18.   exit
  19. else
  20.   echo -e "\033[40;32mStep 1.No lock file,begin to create lock file and continue.\033[40;37m"
  21.   touch $LOCKfile
  22. fi

  23. #check user
  24. if [ $(id -u) != "0" ]
  25. then
  26.   echo -e "\033[1;40;31mError: You must be root to run this script, please use root to install this script.\033[0m"
  27.   rm -rf $LOCKfile
  28.   exit 1
  29. fi

  30. #check disk partition
  31. check_disk()
  32. {
  33.   >$LOCKfile
  34.   device_list=$(fdisk -l|grep "Disk"|grep "/dev"|awk '{print $2}'|awk -F: '{print $1}'|grep "xv")
  35.   for i in `echo $device_list`
  36.   do
  37.     device_count=$(fdisk -l $i|grep "$i"|awk '{print $2}'|awk -F: '{print $1}'|wc -l)
  38.     echo
  39.     if [ $device_count -lt 2 ]
  40.     then
  41.       now_mount=$(df -h)
  42.       if echo $now_mount|grep -w "$i" >/dev/null 2>&1
  43.       then
  44.         echo -e "\033[40;32mThe $i disk is mounted.\033[40;37m"
  45.       else
  46.         echo $i >>$LOCKfile
  47.         echo "You have a free disk,Now will fdisk it and mount it."
  48.       fi
  49.     fi
  50.   done
  51.   disk_list=$(cat $LOCKfile)
  52.   if [ "X$disk_list" == "X" ]
  53.   then
  54.     echo -e "\033[1;40;31mNo free disk need to be fdisk.Exit script.\033[0m"
  55.     rm -rf $LOCKfile
  56.     exit 0
  57.   else
  58.     echo -e "\033[40;32mThis system have free disk :\033[40;37m"
  59.     for i in `echo $disk_list`
  60.     do
  61.       echo "$i"
  62.       count=$((count+1))
  63.     done
  64.   fi
  65. }

  66. #fdisk ,formating and create the file system
  67. fdisk_fun()
  68. {
  69. fdisk -S 56 $1 << EOF
  70. n
  71. p
  72. 1


  73. wq
  74. EOF

  75. sleep 5
  76. mkfs.ext3 ${1}1
  77. }

  78. #make directory
  79. make_dir()
  80. {
  81.   echo -e "\033[40;32mStep 4.Begin to make directory\033[40;37m"
  82.   for j in `seq $count`
  83.   do
  84.     if [ -d "/home/wwwroot$j" ]
  85.     then
  86.       echo -e "\033[1;40;31m/home/wwwroot$j is exists.This script will exit,you must to choose a directory for mount.\033[0m"
  87.       rm -rf $LOCKfile $tmp2
  88.       exit
  89.     else
  90.       echo "/home/wwwroot$j" >>$tmp1
  91.       mkdir /home/wwwroot$j
  92.     fi
  93.   done
  94. }

  95. #config /etc/fstab and mount device
  96. main()
  97. {
  98.   for i in `echo $disk_list`
  99.   do
  100.     echo -e "\033[40;32mStep 3.Begin to fdisk free disk.\033[40;37m"
  101.     fdisk_fun $i
  102.     echo "${i}1" >>$tmp2
  103.   done
  104.   make_dir
  105.   >$LOCKfile
  106.   paste $tmp2 $tmp1 >$LOCKfile
  107.   echo -e "\033[40;32mStep 5.Begin to write configuration to /etc/fstab and mount device.\033[40;37m"
  108.   while read a b
  109.   do
  110.     if grep -v ^# $fstab_file|grep ${a} >/dev/null
  111.     then
  112.       sed -i "s=${a}*=#&=" $fstab_file
  113.     fi
  114.     echo "${a}             $b                 ext3    defaults        0 0" >>$fstab_file
  115.   done <$LOCKfile
  116.   mount -a
  117. }

  118. #=========start script===========
  119. echo -e "\033[40;32mStep 2.Begin to check free disk.\033[40;37m"
  120. check_disk
  121. main
  122. df -h
  123. rm -rf $LOCKfile $tmp1 $tmp2
复制代码
 楼主| 发表于 2018-12-27 15:24:05 | 显示全部楼层
plyu007 发表于 2018-12-27 14:59
一键 lnmp ,简单得1b,官方都有脚本

是lnmp啊  就是不会挂载数据盘 就是那个30g的盘
发表于 2018-12-27 15:27:36 | 显示全部楼层
1874 发表于 2018-12-27 15:24
是lnmp啊  就是不会挂载数据盘 就是那个30g的盘

你是之前没挂把,看楼上的方法
 楼主| 发表于 2018-12-27 15:28:24 | 显示全部楼层

这个怎么用大佬
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-5-11 09:40 , Processed in 0.077933 second(s), 9 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表