📌  相关文章
📜  whm 格式化新驱动器并挂载以进行备份 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:51:15.661000             🧑  作者: Mango

代码示例1
fdisk -l
#Find the new drive in list (/dev/sdb) has no partition and that probably means that it’s un-partitioned yet.

#create the partition on /dev/sdb by executing
fdisk /dev/sdb

#and then use following in the prompt
#– “n” for new partion
#– “p” for primary partition
#– “1” for the first partition
#– “Enter” / “Enter” for the first AND last cylinders (automatically use the entire disk)
#– “w” to save what I have done

#Format partition /dev/sdb1
mkfs -t ext3 /dev/sdb1

#create a directory to load the new drive
mkdir /backup

#load /dev/sdb1 as /backup
mount /dev/sdb1 /backup

vi /etc/fstab 
#add at the bottom
/dev/sdb1   /backup   ext3   defaults   0   0

mount -a

#If you got no errors – your mount worked, try df -h once more to see if everything is fine