Page 1 of 1

[Solved] How to auto mount all partitions?

Posted: 01 Sep 2018, 08:50
by johnywhy
My boot params don't include noauto, but my harddrive partitiions are not getting auto mounted on boot.
How can i make unknown external partitions mount on boot?
I don't want to hardcode the partitions into fstab or wherever, cuz want this OS to work with any drives.

Linux porteus 4.16.3-porteus #1 SMP PREEMPT Sat Apr 21 12:42:52 Local time zone must be set-- x86_64 Intel(R) Pentium(R) Dual CPU T2310 @ 1.46GHz GenuineIntel GNU/Linux

THX

How to auto mount all partitions?

Posted: 01 Sep 2018, 16:12
by johnywhy
i found this script. Is it safe and functional on porteus?
is there a better way?

Code: Select all

BASEDIR="/mnt"

for PARTITION in `fdisk -l | grep -v swap | egrep -o /dev/sd.[0-9]+` ; do
mount | grep -q "^$PARTITION"
if [ $? -eq 1 ] ; then
blkid $PARTITION > /dev/null
if [ $? -eq 0 ] ; then
MOUNTPOINT=$BASEDIR/`echo $PARTITION | egrep -o sd.[0-9]+`
mkdir -p $MOUNTPOINT
mount $PARTITION $MOUNTPOINT
fi
fi
done
exit 0
https://ubuntuforums.org/showthread.php ... ost8706174

How to auto mount all partitions?

Posted: 01 Sep 2018, 16:37
by Ed_P
When I start Porteus all partitions are visible. Are you referring to your Porteus ISO or your Kiosk?

How to auto mount all partitions?

Posted: 01 Sep 2018, 17:33
by brokenman
Yes that script should mount all partitions in Porteus. Strange that they are not already mounted though. Can you provide logs?
You may also want to try running simply: mount -a

How to auto mount all partitions?

Posted: 01 Sep 2018, 17:49
by johnywhy
you're right, all partitions are mounted on boot.

the problem was, a directory panel applet wasn't loading the folders.

The cause was, cuz i picked 'Other' in the applet properties.
The fix is to pick the partition from the picklist.

Image

Reason i picked 'Other' was cuz on some OS's (Puppy, i think) that's the only one that works.

cheers!

[Solved] How to auto mount all partitions?

Posted: 01 Sep 2018, 18:26
by Ed_P
:good:

[Solved] How to auto mount all partitions?

Posted: 27 Sep 2018, 15:11
by bour59
hello
a little correction
only partitions from sda1 to sda15 are mounted at boot
for the others (sda16 . . .) the shell is usefull
to avoid error message with the extended partition, I propose this little modif

Code: Select all

for PARTITION in `fdisk -l | egrep -v 'swap|tend' | egrep -o /dev/sd.[0-9]+` ; do