This tool was developed mainly as a study of GNU Bash, since the OS already has mechanisms to do this.
In order to install the script, you just need to run the installer.sh file as superuser:
sudo ./installer.sh
- Create a ".service" file inside
/etc/systemd/system/
sudo touch /etc/systemd/system/automatically_mount_partition.service
- Add the service description to the file
sudo nano /etc/systemd/system/automatically_mount_partition.service
-
[Unit] Description=Automatically mounting HD partition from boot [Service] ExecStart=/path/to/your/script.sh Restart=always User=root [Install] WantedBy=default.target
- Enable and add the script to the boot list
-
sudo systemctl enable wifi_reset.service sudo systemctl start wifi_reset.service
-
- Check the service status
sudo systemctl status automatically_mount_partition.service
- Reboot the machine and confirm that the partition is being mounted
reboot
orshutdown now -r
The following are the steps to use the GNU/Linux built-in tool to automatically mount partitions:
- Get the UUID (Universal Unique Identifier) of the device you want to be mounted on boot
blkid
- Add an entry in /etc/fstab
sudo nano /etc/fstab
UUID=<partition_UUID> <mount_point> <filesystem_type> <options> <dump> <pass>
- UUID: The Universally Unique Identifier of the partition. You can find this using the blkid command.
- mount_point: The directory where the partition should be mounted.
- filesystem_type: The type of filesystem on the partition (e.g., ext4, ntfs, etc.).
- options: Mount options like defaults, noauto, etc.
- dump and pass: Used by the dump and fsck utilities.
- Save and exit
- Test the configuration
sudo mount -a
- Reboot
reboot
orshutdown now -r