From ce92d72444633f406aea22f110dd0a1c8618dbe3 Mon Sep 17 00:00:00 2001 From: smeb y <48400087+a3165458@users.noreply.github.com> Date: Wed, 20 Mar 2024 23:54:30 +0800 Subject: [PATCH] Update duokaixianzhiban.sh --- duokaixianzhiban.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/duokaixianzhiban.sh b/duokaixianzhiban.sh index d121ea2..0f0a3f1 100644 --- a/duokaixianzhiban.sh +++ b/duokaixianzhiban.sh @@ -45,7 +45,6 @@ mkdir -p $volume_dir # 创建用户指定数量的容器 for i in $(seq 1 $container_count) do - disk_size_mb=$((disk_size_gb * 1024)) # 为每个容器创建一个具有特定大小的文件系统映像 @@ -58,6 +57,9 @@ do mkdir -p $mount_point sudo mount -o loop $volume_path $mount_point + # 将挂载信息添加到 /etc/fstab + echo "$volume_path $mount_point ext4 loop,defaults 0 0" | sudo tee -a /etc/fstab + # 运行容器,并设置重启策略为always container_id=$(docker run -d --restart always -v $mount_point:/root/.titanedge/storage --name "titan$i" nezha123/titan-edge:1.1)