user はドライブの fstab で指定されたマウントオプションです。ただし、シェルスクリプトではスーパーユーザー権限が必要です。

user はドライブの fstab で指定されたマウントオプションです。ただし、シェルスクリプトではスーパーユーザー権限が必要です。

修正しました。インストールオプションは外部ログを/etc/fstab含むlogdev=xfsオプションであり、インストールされませんでした。これを使用して、物理logdev=/dev/disk/by-uuid/<uuid of partition>デバイスノードが必要であることを指定します。/dev/sda2

修正されたスクリプトは次のとおりです。


#Mount Debian mirror

if 
(( $(mount | grep -c mirror) == 0 )) && [ "$1" == "-m" ];
then
/bin/mount /home/tomas/mirror && echo "mirror has been mounted."
exit 0
elif
[ "$1" == "-m" ];
then 
echo "Mirror is already mounted."
exit 0
fi

if 
(( $(mount | grep -c mirror) == 1 )) && [ "$1" == "-u" ];
then 
sudo /bin/umount /home/tomas/mirror && echo "Umounting mirror."
exit 0
elif
[ "$1" == "-u" ] 
then
echo "Mirror is not mounted."
else
echo "Specify -m for mount or -u for umount."
fi
exit 0

ベストアンサー1

おすすめ記事