How to mount hard drives automatically after booting?
How to mount hard drives automatically after booting?
how to mount hard drives automatically after booting with out giving mount command
- Moose On The Loose
- Posts: 965
- Joined: Thu 24 Feb 2011, 14:54
Re: How to mount hard drives automatically after booting?
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 hereselvam wrote:how to mount hard drives automatically after booting with out giving mount command
Code: Select all
#!/bin/bash
# I assume you can compose $PART and $OPTIONS
#
if ! grep $PART /etc/mtab ; then
mount $OPTIONS /dev/$PART /mnt/$PART
fi
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
(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.
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.
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: Select all
xwin < name of your window manager >
All your partitions should be mounted now.
After that, a link being in /root/Startup, it lauches itself automatically at each session.
Code: Select all
#!/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
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.
- Attachments
-
- MountAtStartup.zip
- (2.07 KiB) Downloaded 325 times
Last edited by musher0 on Tue 07 Jan 2014, 16:35, edited 1 time in total.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
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:
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.
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: Select all
which ntfs-3g
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.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
- Puppus Dogfellow
- Posts: 1667
- Joined: Tue 08 Jan 2013, 01:39
- Location: nyc
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
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
Hello, all.
Here's an update to the post above at:
http://murga-linux.com/puppy/viewtopic. ... 413#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
Here's an update to the post above at:
http://murga-linux.com/puppy/viewtopic. ... 413#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
- Attachments
-
- MountPartitions-4.pet
- (2.41 KiB) Downloaded 428 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
In order to automount partitions I have been using the muppyquickmount .pet here:
http://murga-linux.com/puppy/viewtopic. ... 315#745315
Musher0 - would you recommend your pet above instead of muppy quick mounter?
http://murga-linux.com/puppy/viewtopic. ... 315#745315
Musher0 - would you recommend your pet above instead of muppy quick mounter?
Its also listed on the wikiPuppus 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
http://puppylinux.org/wikka/Startmount
Hi, greengeek.greengeek wrote:In order to automount partitions I have been using the muppyquickmount .pet here:
http://murga-linux.com/puppy/viewtopic. ... 315#745315
Musher0 - would you recommend your pet above instead of muppy quick mounter?
hehe. That's like asking a father if his son is more intelligent than the neighbour's!
Of course he is!
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
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
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
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
- Attachments
-
- MountPartitions-4a.pet
- (2.41 KiB) Downloaded 396 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
- Puppus Dogfellow
- Posts: 1667
- Joined: Tue 08 Jan 2013, 01:39
- Location: nyc
tmm2112 wrote:I would like to use this startmount, but I cant find it in the pet directory.
Startmount-0.0.5
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.
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.
Hello, tmm2112.tmm2112 wrote:(...)
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.
Strange... All suggestions presented in the posts above "stick" until you deliberately
unmount the partition(s). Maybe review your steps?
Just a thought. BFN.
musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
-
- Posts: 902
- Joined: Mon 22 Jun 2009, 01:36
- Location: Philadelphia, PA
Some snipping was done.
===============
Sorry, didn't succeed.
I booted what I think is Precise 5.7.1 from my sda2 partition, with pfix=ram on the kernel GRUB menu line.
Made a directory /mnt/sda3
Edited /etc/rc.d/rc.local to include
mount -t vfat /dev/sda3 /mnt/sda3
Rebooted (made a savefile on the sda2 boot drive)
The mounting of sda3 did not occur after the reboot.
Don't know why; I vaguely recall that someone helped in the past with a better version of mount or probepart or blkid or ???
Hang in there; someone more knowledgeable will come and help.
I'll try a Precise to see what I can do, and get back to edit this.tmm2112 wrote:I'm using Puppy Precise..
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.
===============
Sorry, didn't succeed.
I booted what I think is Precise 5.7.1 from my sda2 partition, with pfix=ram on the kernel GRUB menu line.
Made a directory /mnt/sda3
Edited /etc/rc.d/rc.local to include
mount -t vfat /dev/sda3 /mnt/sda3
Rebooted (made a savefile on the sda2 boot drive)
The mounting of sda3 did not occur after the reboot.
Don't know why; I vaguely recall that someone helped in the past with a better version of mount or probepart or blkid or ???
Hang in there; someone more knowledgeable will come and help.
Dell E6410: BusterPup, BionicPup64, Xenial, etc
Intel DQ35JOE, Dell Vostro 430
Dell Inspiron, Acer Aspire One, EeePC 1018P
Intel DQ35JOE, Dell Vostro 430
Dell Inspiron, Acer Aspire One, EeePC 1018P
I somehow missed this post before, but I downloaded the pet, installed andPuppus Dogfellow wrote:tmm2112 wrote:I would like to use this startmount, but I cant find it in the pet directory.
Startmount-0.0.5
it worked! Much thanks, pupps dogfellow.
Hi Musher0,musher0 wrote:Hello, selvam.
Here is a little script that will do that....
Not working for me
Clean prefix=ram boot, only mounts those partitions that have previously been mounted during the session. When I manually run
# ./rep-dans-mnt.sh
No /mnt/s[d,r]* directory seem to be missing.
Listing the contents of /mnt I see
# ls /mnt
cdrom data dvd flash floppy msdos ram1 sda1 sda4 swap zip
#
My sda2 and sdb1 partitions are left unmounted.
I believe the relevant part of the version of your code that I'm running for the above is
Code: Select all
if [ "`ls -d /mnt/s[d,r]*`" = "" ];then
probepart | awk -F"|" '$2 ~ /ext|ntfs|vfat|iso/ { print $1 }' | awk -F"/" '{ print "mkdir -p /mnt/"$3 }' > /tmp/DIRS
chmod ug+rwx /tmp/DIRS
/tmp/DIRS
echo
echo "$NOTANYMORE"
echo
else
echo
echo "$NOTMISSING"
echo
fi
# probepart
/dev/sda1|vfat|67584
/dev/sda2|ntfs|345608192
/dev/sda3|swap|4083712
/dev/sda4|ext4|40960000
/dev/sdb1|ntfs|78140096
/dev/sr0|iso9660|261056
/dev/sr1|none|2097150
(Running Slacko 5.3.3t)
What I personally have in mind for wanting all auto-mounted is so that I might include a HD file (script) as part of the startup.
Boot from read only CD/DVD (pfix=ram), that mounts all drives and if a file xyz.sh exists in any of the root directory of the HD partitions then run that script (extension of Startup directory contents). So a RAM boot - available 'disk' space is all of the available memory (1.5GB in my case), but with some additional automated tuning possible (optional load of load nvidia.sfs, flash.sfs etc - or not, according to whether that's set in the xyz HD script).
Boot from read only CD/DVD (pfix=ram), that mounts all drives and if a file xyz.sh exists in any of the root directory of the HD partitions then run that script (extension of Startup directory contents). So a RAM boot - available 'disk' space is all of the available memory (1.5GB in my case), but with some additional automated tuning possible (optional load of load nvidia.sfs, flash.sfs etc - or not, according to whether that's set in the xyz HD script).