Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 29 Aug 2014, 12:11
All times are UTC - 4
 Forum index » House Training » Beginners Help ( Start Here)
How to mount hard drives automatically after booting?
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 3 [33 Posts]   Goto page: 1, 2, 3 Next
Author Message
selvam

Joined: 03 Dec 2013
Posts: 138

PostPosted: Tue 07 Jan 2014, 09:40    Post subject:  How to mount hard drives automatically after booting?  

how to mount hard drives automatically after booting with out giving mount command
Back to top
View user's profile Send private message 
Moose On The Loose


Joined: 24 Feb 2011
Posts: 515

PostPosted: Tue 07 Jan 2014, 10:41    Post subject: Re: How to mount hard drives automatically after booting?  

selvam wrote:
how to mount hard drives automatically after booting with out giving mount command


You can put the mount command in a script in the Startup directory. The script will get run when the GUI is up and going. I am going to code without testing here

Code:

#!/bin/bash
# I assume you can compose $PART and $OPTIONS
#
if ! grep $PART /etc/mtab ; then
  mount $OPTIONS /dev/$PART /mnt/$PART
  fi
Back to top
View user's profile Send private message 
musher0


Joined: 04 Jan 2009
Posts: 4231
Location: Gatineau (Qc), Canada

PostPosted: Tue 07 Jan 2014, 12:22    Post subject:  

Hello, selvam.

Here is a little script that will do that, and a couple of satellites to it. One satellite checks
if you have the necessary folders in /mnt to receive the mounts; the second one checks
if /etc/fstab is duly populated. Very first time this script is run, it might take a couple of
seconds; after that, you don't perceive it.

How-to:
Create a folder named Systeme in /root/my-applications, unpack them in /root/my-
applications/Systeme. Make them executable and make a link from MonterPartitions3.sh
to the /root/Startup folder.

Then, re-start X -- through the menu or from the initial black console, with
Code:
xwin < name of your window manager >

(i.e. xwin jwm, or xwin openbox)
All your partitions should be mounted now.

After that, a link being in /root/Startup, it lauches itself automatically at each session.

Code:
#!/bin/sh
# (avec awk)
# ~/my-appl*/Systeme/MonterPartitions3.sh
# Objet : Monter partitions non iso9660, non USB
# Purpose : Mount non iso9660 & non USB partitions
# musher0, 13-12-13
####
function monte {
CMNDS="/tmp/cmnds.sh"
LST="/tmp/lstPrt"
probepart|awk -F"/" '{ print $3 }' > $LST
awk -F"|" '$2 ~ /ext|vfat/ { print "mount -t "$2" /dev/"$1" /mnt/"$1 }' $LST > $CMNDS
awk -F"|" '$2 ~ /ntfs/ { print "ntfs-3g /dev/"$1" /mnt/"$1 }' $LST >> $CMNDS
chmod ug+rwx $CMNDS
$CMNDS
# cleanup
rm $CMNDS
rm $LST
# echo "All partitions have been mounted."
}

# Checks
[ "`ls -d /mnt/sd*`" = "" ] && ~/my-applications/Systeme/rep-dans-mnt.sh
# This script will create missing partition folders (/mnt/sd*) in /mnt, if any are missing.

[ "`wc -l /etc/fstab | cut -d' ' -f1`" -lt 7 ] && ­~/my-applications/Systeme/Create-fstab.sh &
# This script completes the /etc/fstab, if not already populated. (It never is on a new Puppy.)

# If everything is already mounted, we simply pass.
[ "`cat /proc/mounts | grep 't/[s,h]' | wc -l`" -lt "`probepart | egrep 'ext|vfat|ntfs' | wc -l`" ] && monte


I hope this fits the bill. Please let me know.

If not, MuppyQuickMount also puts a "mount all partitions" script in /root/Startup once
installed. It needs a BASIC language installed, though, plus, depending on your Puppy
version, the blkid utility may need to be enhanced.

BFN.

musher0

~~~~~~~~~~~
PS. The remarks in the scripts are in French. If puzzled, please see translations above.
MountAtStartup.zip
Description 
zip

 Download 
Filename  MountAtStartup.zip 
Filesize  2.07 KB 
Downloaded  78 Time(s) 

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)

Last edited by musher0 on Tue 07 Jan 2014, 12:35; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
musher0


Joined: 04 Jan 2009
Posts: 4231
Location: Gatineau (Qc), Canada

PostPosted: Tue 07 Jan 2014, 12:28    Post subject:  

Almost forgot...

If you have an ntfs partition on your system, you'll need the ntfs-3g utility.
You can test if you have this utility in your Puppy by typing in console:
Code:
which ntfs-3g


You should get: /bin/ntfs-3g as an answer.

If no answer (that is: just the usual prompt), you'll need to install it.
But again, only if you have an ntfs drive on your system.

BFN.

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 544
Location: nyc

PostPosted: Tue 07 Jan 2014, 14:18    Post subject:  

can't find the thread at the moment, but there's also startmount 0.5.5, which gives you a gui...

it'll automount what you tell it to look for, but i'm not sure it will automount drives it hasn't already been made aware of.


edit: thread
Back to top
View user's profile Send private message 
selvam

Joined: 03 Dec 2013
Posts: 138

PostPosted: Tue 07 Jan 2014, 23:47    Post subject:  

thanks for all the help
Back to top
View user's profile Send private message 
musher0


Joined: 04 Jan 2009
Posts: 4231
Location: Gatineau (Qc), Canada

PostPosted: Sat 08 Mar 2014, 23:13    Post subject:  

Hello, all.

Here's an update to the post above at:
http://murga-linux.com/puppy/viewtopic.php?p=749286&sort=lastpost&search_id=138422413#749286

This script will mount all available partitions on your hard drives and inform you of it
automatically in French or in English depending on the LANG variable.

It will also check if the partition folders in /mnt reflect the number of HD partitions and if
fstab is properly populated; if not, it will call secondary scripts to do those jobs.

If the partitions are already mounted, it does nothing, and simply passes to the next
script in /root/Startup.

It work very well here, I've been using it without problems for the past few months.
Let me know of any quirks on your Puppy? Thanks.

Enjoy!

musher0

~~~~~~~~~~~~~
N.B. The "Create-fstab" sub-script requires < replaceit > as a dependency.
< replaceit > can be found at http://www.pldaniels.com/replaceit
MountPartitions-4.pet
Description 
pet

 Download 
Filename  MountPartitions-4.pet 
Filesize  2.41 KB 
Downloaded  75 Time(s) 

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
greengeek

Joined: 20 Jul 2010
Posts: 2500
Location: New Zealand

PostPosted: Sun 09 Mar 2014, 03:27    Post subject:  

In order to automount partitions I have been using the muppyquickmount .pet here:
http://murga-linux.com/puppy/viewtopic.php?p=745315#745315

Musher0 - would you recommend your pet above instead of muppy quick mounter?
Back to top
View user's profile Send private message 
darkcity


Joined: 23 May 2010
Posts: 2439
Location: near here

PostPosted: Sun 09 Mar 2014, 05:08    Post subject:  

Puppus Dogfellow wrote:
can't find the thread at the moment, but there's also startmount 0.5.5, which gives you a gui...

it'll automount what you tell it to look for, but i'm not sure it will automount drives it hasn't already been made aware of.


edit: thread


Its also listed on the wiki
http://puppylinux.org/wikka/Startmount

_________________
helping Wiki for help | IF SendSpace link = "dead" THEN PM me ("up file to http://meownplanet.net/")
Back to top
View user's profile Send private message Visit poster's website 
musher0


Joined: 04 Jan 2009
Posts: 4231
Location: Gatineau (Qc), Canada

PostPosted: Sun 09 Mar 2014, 17:14    Post subject:  

greengeek wrote:
In order to automount partitions I have been using the muppyquickmount .pet here:
http://murga-linux.com/puppy/viewtopic.php?p=745315#745315

Musher0 - would you recommend your pet above instead of muppy quick mounter?


Hi, greengeek.

hehe. That's like asking a father if his son is more intelligent than the neighbour's!
Of course he is! Cool

But if I try to be impartial, I'd say:
* use my script if you want to:
-- mount ALL hard drive partitions in one fell swoop at startup AND
-- you want to properly populate your Puppy fstab file (like it should in any Linux) AND
-- you want to make sure that your partition folders in /mnt match the usable partitions
on your disk(s).

AFAIK, my script is the only one that mounts all partitions AND checks that the other
elements of the mounting environment are ok.

OR

* use the StartMount utility if you want to:
-- selectively mount one or two partitions only at startup. (My script doesn't allow a
selection.)

AND

* use the UPDATED MuppyQuickMount as well -- but remove its startup script in
/root/Startup
-- to replace Puppy's default mounter (this is the killer argument, IMO).
-- Whatever your choice above, the updated MQM is much faster than the default
Puppy mounter and its layout is much clearer (again, IMO).

BFN.

musher0

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
musher0


Joined: 04 Jan 2009
Posts: 4231
Location: Gatineau (Qc), Canada

PostPosted: Mon 10 Mar 2014, 20:19    Post subject:
Subject description: Mini-upgrade
 

Hello, all.

Just a slight change: the 2nd yaf-splash message moved from true centre to SE of
screen to avoid overlap with 1st message.

BFN.

musher0
MountPartitions-4a.pet
Description 
pet

 Download 
Filename  MountPartitions-4a.pet 
Filesize  2.41 KB 
Downloaded  76 Time(s) 

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
tmm2112

Joined: 25 Aug 2012
Posts: 12

PostPosted: Fri 04 Apr 2014, 18:10    Post subject:  

I would like to use this startmount, but I cant find it in the pet directory.
Back to top
View user's profile Send private message 
Puppus Dogfellow


Joined: 07 Jan 2013
Posts: 544
Location: nyc

PostPosted: Fri 04 Apr 2014, 19:46    Post subject:  

tmm2112 wrote:
I would like to use this startmount, but I cant find it in the pet directory.



Startmount-0.0.5
Back to top
View user's profile Send private message 
rufwoof

Joined: 24 Feb 2014
Posts: 308

PostPosted: Fri 04 Apr 2014, 20:03    Post subject:  

Check whether Menu, Filesystem, PMount has an option to set auto mount at start up (when you right click on the drive/partition)
i1.jpg
 Description   
 Filesize   56.45 KB
 Viewed   232 Time(s)

i1.jpg

i2.png
 Description   
 Filesize   45.04 KB
 Viewed   232 Time(s)

i2.png

Back to top
View user's profile Send private message 
tmm2112

Joined: 25 Aug 2012
Posts: 12

PostPosted: Sat 05 Apr 2014, 10:46    Post subject:  

That's interesting. My version of Pmount is quite different. I'm using Puppy Precise and the Pmount application is much more simple. It does not give options for auto mounting.

I have looked in the repositories but no other version of Pmount is there, nor is the Startmount there. This seems like a very solvable problem but I'm not getting anywhere with it.

For anyone who could help, I'm trying to set up an automount of a partition on my hard drive. I've tried scripts but they only produce a momentary mount that goes away seconds after bootup.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 3 [33 Posts]   Goto page: 1, 2, 3 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Beginners Help ( Start Here)
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0895s ][ Queries: 12 (0.0037s) ][ GZIP on ]