Commit a8246b31 authored by Richard RANDRIATOAMANANA's avatar Richard RANDRIATOAMANANA 💬
Browse files

Update userdata-mountpoint.sh

parent 752430c4
#!/bin/bash #!/bin/bash
# run prefixed with sudo
# #
export DEV=/dev/sdb export DEV=/dev/sdb
export MOUNTPOINT=/opt/data export MOUNTPOINT=/opt/data
[ ! -d $MOUNTPOINT ] && sudo mkdir -p $MOUNTPOINT 2>/dev/null [ ! -d $MOUNTPOINT ] && mkdir -p $MOUNTPOINT 2>/dev/null
# add in fstab disk mount point # add in fstab disk mount point
if [[ `dmesg | grep -Ei '[sv]db' | grep 'Attached'` ]]; then if [[ `dmesg | grep -Ei '[sv]db' | grep 'Attached'` ]]; then
if [[ -z "`grep $DEV /etc/fstab 2>/dev/null`" ]]; then if [[ -z "`grep $DEV /etc/fstab 2>/dev/null`" ]]; then
sudo sh -c "echo '${DEV}1 $MOUNTPOINT ext4 defaults 0 0' >> /etc/fstab" sh -c "echo '${DEV}1 $MOUNTPOINT ext4 defaults 0 0' >> /etc/fstab"
sudo mount -a mount -a
fi fi
fi fi
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment