[Solved] How to auto mount all partitions?

Post here if you are a new Porteus member and you're looking for some help.
johnywhy
Samurai
Samurai
Posts: 108
Joined: 29 Mar 2017, 17:26
Distribution: Kiosk
Location: Cali

[Solved] How to auto mount all partitions?

Post#1 by johnywhy » 01 Sep 2018, 08:50

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
Last edited by johnywhy on 01 Sep 2018, 17:49, edited 1 time in total.

johnywhy
Samurai
Samurai
Posts: 108
Joined: 29 Mar 2017, 17:26
Distribution: Kiosk
Location: Cali

How to auto mount all partitions?

Post#2 by johnywhy » 01 Sep 2018, 16:12

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
Linux porteus 4.16.3-porteus #1 SMP PREEMPT - x86_64 Intel(R) Pentium(R) Dual CPU T2310 @ 1.46GHz GenuineIntel GNU/Linux

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

How to auto mount all partitions?

Post#3 by Ed_P » 01 Sep 2018, 16:37

When I start Porteus all partitions are visible. Are you referring to your Porteus ISO or your Kiosk?
Ed

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

How to auto mount all partitions?

Post#4 by brokenman » 01 Sep 2018, 17:33

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 do i become super user?
Wear your underpants on the outside and put on a cape.

johnywhy
Samurai
Samurai
Posts: 108
Joined: 29 Mar 2017, 17:26
Distribution: Kiosk
Location: Cali

How to auto mount all partitions?

Post#5 by johnywhy » 01 Sep 2018, 17:49

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!
Linux porteus 4.16.3-porteus #1 SMP PREEMPT - x86_64 Intel(R) Pentium(R) Dual CPU T2310 @ 1.46GHz GenuineIntel GNU/Linux

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

[Solved] How to auto mount all partitions?

Post#6 by Ed_P » 01 Sep 2018, 18:26

:good:
Ed

bour59
Samurai
Samurai
Posts: 181
Joined: 29 Dec 2010, 08:10
Distribution: porteus v5.0-xfce K5.19.7
Location: France

[Solved] How to auto mount all partitions?

Post#7 by bour59 » 27 Sep 2018, 15:11

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

Post Reply