Answer the question
In order to leave comments, you need to log in
How to write disk mount in bash?
Guys, tell me, how can I implement such a thing: a computer on centos, it has partitions with the ext4 type and 1 ntfs partition, it is necessary that, for example, when executing sh, it finds the ntfs partition and mounts it in the fstab directory Thank you
Answer the question
In order to leave comments, you need to log in
echo 'Mount NTFS pharma partition'
mkdir /home/$user/Desktop/data
UUID=`blkid -s UUID -o value -t TYPE=ntfs`
echo 'UUID='$UUID' /home/'$user'/Desktop /data ntfs defaults 0 0'
it is necessary that, for example, when executing sh, it finds the ntfs partition and mounts it to the fstab directory
mount /mount/point
(the same mount point that is specified in fstab) and it is mounted exactly as you described in advance.
You just do everything by hand, and then you enter each command into a shell script.
It is accepted to mount in / mnt.
It is customary to create a separate directory for a new point.
You need superuser rights to mount. Therefore, you write a regular script, but then run it through sudo.
(And you don't have to touch /etc/fstab to do this.)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question