Skip to content

reza3320/automount

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

To mount the Storage units automatically for Linux(Debian) servers

First step: Choose a permanent directory for placing the Automount.py For example: /etc/automount/

Go to /lib/sysstemd/system Directory.

Step 2: We are going to make a system service.

Make a file named : automount.service Write the code bellow down in automount.service:

[Unit]
Description= automount service.
After=network-online.target
Wants=network-online.target systemd-networkd-wait-online.service

StartLimitIntervalSec=500
StartLimitBurst=5

[Service]
Type=simple
ExecStart=python3 /etc/automount/automount.py
Restart=on-failure
RestartSec=5s



[Install]
WantedBy=multi-user.target

cp automount.service /etc/systemd/system/automount.service chmod 644 /etc/systemd/system/automount.service chhmod +x /etc/automount/automount.py

Step3: Now you can start and make the mounter restartable with codes bellow:

sudo systemctl deamon-reaload sudo systemctl start automount sudo systemctl enable automount sudo systemctl restart automount

About

for mount usb drive automatically

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%