(OLD) (ARCHIVED) Puppy Linux Discussion Forum Forum Index (OLD) (ARCHIVED) Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info

This forum can also be accessed as http://oldforum.puppylinux.com
It is now read-only and serves only as archives.

Please register over the NEW forum
https://forum.puppylinux.com
and continue your work there. Thank you.

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups    
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 29 Oct 2020, 10:16
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
Alternative way to mount a series of partitions
Moderators: Flash, Ian, JohnMurga
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. View previous topic :: View next topic
Page 1 of 1 [1 Post]  
Author Message
musher0

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

PostPosted: Sun 03 May 2020, 04:04    Post subject:  Alternative way to mount a series of partitions
Subject description: Based on BarryK's probepart utility.
 

Hello all.

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 --
Code:
#!/bin/sh
# /root/my-applications/bin/a1g8.1.sh
# 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.
      cd /mnt
      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.
   fi
done

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.

IHTH.
BFN.
a1g8.1.pet
Description  Alternative way to mount a series of partitions using BarryK's probepart.
pet

 Download 
Filename  a1g8.1.pet 
Filesize  1020 Bytes 
Downloaded  151 Time(s) 

_________________
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [1 Post]  
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
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: 4.4684s ][ Queries: 13 (4.2132s) ][ GZIP on ]