Load, Reload or Refresh your fstab mounts

In order to load your new mount entries, reload, or refresh your fstab mount points you can do this simply with the mount command as follows :-

Show Plain Text
Text code
  1. mount -a

For those of you doing a reload or refresh due to a mount drop you will need to stop any processes trying to access the mount share and then do a umount as follows :-

Show Plain Text
Text code
  1. umount -f <path_mount_share>

After your umount then simply do the "mount -a" and you should be up and running.

For those trying to automate the connection something similar to the following should work running as a 1 minute cron script :-

Show Plain Text
Text code
  1. #!/bin/sh
  2. if ! mount | grep -q <share_name>
  3. then
  4.   skill <transfer_processes>
  5.   umount -f <share_mount>
  6.   mount -a
  7. fi
Filed under: Linux  Tags: Debian, Ubuntu

1 Responses to “Load, Reload or Refresh your fstab mounts”

Thanks for the example of iso image fstab entrie.. It worked.. I was wondering were to mention 'loop'

Sorry, comments have been closed for this post.
(default) 11 queries took 2 ms
NrQueryErrorAffectedNum. rowsTook (ms)
1DESCRIBE `posts`17171
2DESCRIBE `comments`11111
3DESCRIBE `tags`220
4DESCRIBE `categories`220
5DESCRIBE `posts_tags`220
6DESCRIBE `categories_posts`220
7SELECT `Post`.`id`, `Post`.`url`, `Post`.`title`, `Post`.`icon`, `Post`.`metadesc`, `Post`.`metakeys`, `Post`.`categories`, `Post`.`tease`, `Post`.`body`, `Post`.`private_body`, `Post`.`created`, `Post`.`modified`, `Post`.`status`, `Post`.`allow_comments`, `Post`.`tags`, `Post`.`hitcount`, `Post`.`hitcount_rss` FROM `posts` AS `Post` WHERE `Post`.`url` = 'load-reload-or-refresh-your-fstab-mounts' LIMIT 1110
8SELECT `Comment`.`id`, `Comment`.`post_id`, `Comment`.`body`, `Comment`.`author`, `Comment`.`url`, `Comment`.`email`, `Comment`.`ip`, `Comment`.`status`, `Comment`.`junk_score`, `Comment`.`created`, `Comment`.`modified` FROM `comments` AS `Comment` WHERE `Comment`.`status` = 2 AND `Comment`.`post_id` = (77) 110
9SELECT `Tag`.`id`, `Tag`.`tag`, `PostsTag`.`post_id`, `PostsTag`.`tag_id` FROM `tags` AS `Tag` JOIN `posts_tags` AS `PostsTag` ON (`PostsTag`.`post_id` = 77 AND `PostsTag`.`tag_id` = `Tag`.`id`) 220
10SELECT `Category`.`id`, `Category`.`category`, `CategoriesPost`.`post_id`, `CategoriesPost`.`category_id` FROM `categories` AS `Category` JOIN `categories_posts` AS `CategoriesPost` ON (`CategoriesPost`.`post_id` = 77 AND `CategoriesPost`.`category_id` = `Category`.`id`) 110
11UPDATE `posts` AS `Post` SET `Post`.`hitcount` = Post.hitcount + 1 WHERE `Post`.`id` = 7710