The time now is Wed 02 Dec 2020, 11:28
All times are UTC - 4
Joined: 04 Jan 2009
Location: Gatineau (Qc), Canada
|Posted: Sun 03 May 2020, 04:04 Post subject:
Alternative way to mount a series of partitions
Subject description: Based on BarryK's probepart utility.
Here is an alternative way I discovered to mount a series of partitions with no manual
intervention, in one fell swoop.
This can come in handy if
-- you are booting from DVD;
and / or
-- you have quite a few partitions to mount;
and / or
-- your drives are not always recognized in the same order at boot;
---- this one can be a time waster, since you think your partitions are mounted and
they're not, or they want to be mounted on other mount points; and you have to
(re)do the mounting manually;
and / or
-- you do not wish to use PMount times the number of partitions you have.
---- To be clear, PMount is an excellent utility; if you're happy with how PMount works,
by all means continue using it.
---- This script is not a criticism of PMount. It only does things differently.
What this script does:
-- it scans the partitions you have using probepart;
-- it creates mount points if need be;
-- it handles vfat, ext* and fdfs (NOT ntfs at this time, sorry).
A pet is attached. It contains the following script plus a link to it in /root/Startup.
So your desired partitions will be mounted automatically at boot.
The script is as follows --
# with symlink at /root/Startup/a1g8.1.sh
# Purpose: Mount all vfat, ext*, and fdfs partitions by deduction
# -------- using BK's probepart and a /root/Startup script.
# Caution: probably only works on PuppyLinux, since probepart
# -------- is not present in all Linuxes.
# musher0, May 3rd, 2020. GPL2.
for type in vfat ext2 ext3 ext4 fdfs;do
# You may remove the types you do not wish to mount.
# E.g. if you wish to mount only the ext* filesystems,
# remove "vfat" and "fdfs" from the above line.
probepart | grep $type | cut -d"|" -f 1 | cut -d"/" -f3 > /root/my-applications/list
if [ "`wc -l < /root/my-applications/list`" -gt "0" ];then
# This part kicks in only if file /root/my-applications/list
# has at least one line in it.
while read line;do
[ -d /mnt/$line ] || mkdir /mnt/$line
# This line creates mounting points as needed.
sleep 0.2s # Doesn't work if process too fast.
# So we slow it down a bit.
mount -t $type /dev/$line /mnt/$line
# Actual mounting of desired partitions.
done < /root/my-applications/list
cd - # Back to the directory we came from.
It works fine on jrb's 32-bit upupbb-light. It should work fine on all 32-bit and 64-bit
Puppies as well since this is a bash script.
Any constructive feedback or bug report welcome. But please read the comments
in the above script first, your answer may be in them.
||Alternative way to mount a series of partitions using BarryK's probepart.
"You want it darker? We kill the flame." (L. Cohen)
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.1381s ][ Queries: 12 (0.0812s) ][ GZIP on ]