Porteus USB always mounted as /mnt/porteus
-
- Warlord
- Posts: 622
- Joined: 04 Jan 2014, 04:27
- Distribution: Porteus 5.0 x64 OpenBox
- Location: NZ
- Contact:
Porteus USB always mounted as /mnt/porteus
I asked a similar question before: Permanent device/mount name for a USB disk
But now simple: how can I have the porteus USB to always mount on /mnt/porteus, and not on a random /mnt/sda1, /mnt/sdb1 etc.?
But now simple: how can I have the porteus USB to always mount on /mnt/porteus, and not on a random /mnt/sda1, /mnt/sdb1 etc.?
Last edited by rych on 06 Feb 2022, 06:00, edited 4 times in total.
- Ed_P
- Contributor
- Posts: 8341
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Porteus USB always mounted as /mnt/porteus
Good question. My Porteus USB normally mounts as /mnt/sdb1 on my Dell Inspiron 13 notebook, which has an SSD hardrive, and as /mnt/sda1 on my new Dell Inspiron 14 notebook, which has a M.2 SSD harddrive.
Ed
-
- Warlord
- Posts: 622
- Joined: 04 Jan 2014, 04:27
- Distribution: Porteus 5.0 x64 OpenBox
- Location: NZ
- Contact:
Porteus USB always mounted as /mnt/porteus
I'll explain why I need this. I carry an ext3/4 file system, labeled Porteus5, on my porteus USB and install some programs into a folder there, say /mnt/sda2/frugal (can I use the term frugal for this?), -- because some apps are too much work to make into xzm modules, either because they update too frequently or are too huge, like 10GB.
Now imagine the path changing between /mnt/sda2/frugal and /mnt/sdb2/frugal and so on. Even Firefox installed there considers itself a new installation each time on a physically different path after resolving any invariant symbolic link I may have created for it, making a new empty profile etc. -- such a nuisance. Another example: Conda installs its own python and then all scripts in that system hardcode the location of the python executable as e.g. /mnt/sda2/frugal/miniconda/bin/python but that sda2 will be wrong on a different machine.
The booting FAT32 partition on the same USB successfully finds the porteus base partition by reading the porteus.cfg
Now that it's found, let it be mounted into a universally persistent name, for example, /mnt/porteus, please?
Now imagine the path changing between /mnt/sda2/frugal and /mnt/sdb2/frugal and so on. Even Firefox installed there considers itself a new installation each time on a physically different path after resolving any invariant symbolic link I may have created for it, making a new empty profile etc. -- such a nuisance. Another example: Conda installs its own python and then all scripts in that system hardcode the location of the python executable as e.g. /mnt/sda2/frugal/miniconda/bin/python but that sda2 will be wrong on a different machine.
The booting FAT32 partition on the same USB successfully finds the porteus base partition by reading the porteus.cfg
Code: Select all
KERNEL /boot/syslinux/vmlinuz
INITRD /boot/syslinux/initrd.xz
APPEND changes=/porteus from=LABEL:Porteus5
- Ed_P
- Contributor
- Posts: 8341
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Porteus USB always mounted as /mnt/porteus
I'm pretty sure the system's boot menu does a search for a Porteus file name and sets root to it's find before booting the drive.
An option that might work, if not already available, is a system parm set at boot time to the drive being booted. Something like the $PWD parm. Then scripts and alike could use /mnt/$DRV/frugal to access folders.
I have a feeling as these M.2 SSD drives gain in popularity for Porteus the problem will grow.
Ed
-
- Warlord
- Posts: 622
- Joined: 04 Jan 2014, 04:27
- Distribution: Porteus 5.0 x64 OpenBox
- Location: NZ
- Contact:
Porteus USB always mounted as /mnt/porteus
I'm trying to work out a method I suggested in Permanent device/mount name for a USB disk, but it works only for hotplugging after boot, not during boot. I need to find out who mounts my partitions during boot.
Probably it's done
Probably it's done
Fixed mount paths for other partitions than root
- babam
- Warlord
- Posts: 526
- Joined: 16 Nov 2016, 10:30
- Distribution: Porteus 5.0rc3 Xfce K6.1.1
- Location: Rainy city
Porteus USB always mounted as /mnt/porteus
It's possible by modifying initrd ( linuxrc and finit )
Sorry, my English is bad.
-
- Warlord
- Posts: 622
- Joined: 04 Jan 2014, 04:27
- Distribution: Porteus 5.0 x64 OpenBox
- Location: NZ
- Contact:
Porteus USB always mounted as /mnt/porteus
Thanks, that's digging too deep for my level. I've decided on an extra bind mount which gives me an invariant path every boot.
I seem to have to do it manually after boot because adding the following line into /etc/rc.d/rc.local has no effect
Code: Select all
mount --bind $BASEDIR/portable /P
- Ed_P
- Contributor
- Posts: 8341
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Porteus USB always mounted as /mnt/porteus
This posting might interest you rych. Ravas coding goodies (Post by ncmprhnsbl #86943)
Ed
-
- Warlord
- Posts: 622
- Joined: 04 Jan 2014, 04:27
- Distribution: Porteus 5.0 x64 OpenBox
- Location: NZ
- Contact:
Porteus USB always mounted as /mnt/porteus
To make those vars known I needed an extra line in /etc/rc.d/rc.local
Now I can install my frugal-USB-portable programs into the invariant path /P/ which always points to the right folder on my porteus USB. Thank you.
Code: Select all
source /etc/profile.d/porteus.sh
mount --bind $BASEDIR/portable /P
- Rava
- Contributor
- Posts: 5401
- Joined: 11 Jan 2011, 02:46
- Distribution: XFCE 5.01 x86_64 + 4.0 i586
- Location: Forests of Germany
Porteus USB always mounted as /mnt/porteus
Good to know that approach works for you.rych wrote: ↑15 Feb 2022, 06:15To make those vars known I needed an extra line in /etc/rc.d/rc.localNow I can install my frugal-USB-portable programs into the invariant path /P/ which always points to the right folder on my porteus USB. Thank you.Code: Select all
source /etc/profile.d/porteus.sh mount --bind $BASEDIR/portable /P
The issue is, when you edit your initrd you can completely break your system when there happens a minor editing error, because initrd is the INITial Ram Disk .rych wrote: ↑19 Nov 2022, 03:42Relevant Re: Fixed mount paths for other partitions than root (Post by Gele #27281)
While it is good that Gele posted his findings in Re: Fixed mount paths for other partitions than root (Post by Gele #27281) - when you find an approach that works without having a custom edited initrd I would go with the other approach.
I myself have on all my Porteus setups some code via /etc/rc.d/rc.local that creates some symlinks based on where certain external harddrive partitions are mounted - regardless if the mount point in itself is /mnt/sda1 or /mnt/sdb1 or /mnt/sdc1 … making my own code resulting in invariant paths via symlinks created by /etc/rc.d/rc.local .
Cheers!
Yours Rava
Yours Rava
-
- Warlord
- Posts: 622
- Joined: 04 Jan 2014, 04:27
- Distribution: Porteus 5.0 x64 OpenBox
- Location: NZ
- Contact:
Porteus USB always mounted as /mnt/porteus
Yes I do the same! Only I had to make some links hardlinks (mount --bind) because some software resolve symlinks back to /mnt/sd{a,b,c,...}, and break when booting on a different machine: for example conda derivatives.Rava wrote: ↑20 Nov 2022, 03:11have on all my Porteus setups some code via /etc/rc.d/rc.local that creates some symlinks based on where certain external harddrive partitions are mounted - regardless if the mount point in itself is /mnt/sda1 or /mnt/sdb1 or /mnt/sdc1 … making my own code resulting in invariant paths via symlinks created by /etc/rc.d/rc.local
I've recently edited initrd just to remove guest ownership of some windows FS mounts. I'm still considering modifying it to add an extra (host) repository folder where to activate modules from: a special folder on the host system's fast SSD has some of my larger modules. I'm injecting them into aufs later in the /etc/rc.d/rc.local -- but it slows down the booting process quite a bit probably because it then have to update indexes, databases, etc.... Initial module activation inside initrd seems faster ... and conceptually the right stage to do it. I heard for example overlayfs doesn't even allow delayed modules injection.
Well, one can always just roll back and reboot using the old initrd
- Rava
- Contributor
- Posts: 5401
- Joined: 11 Jan 2011, 02:46
- Distribution: XFCE 5.01 x86_64 + 4.0 i586
- Location: Forests of Germany
Porteus USB always mounted as /mnt/porteus
Sure, someone who managed to find a way of editing the initrd (even when there is a GUI way of doing the extraction of the cpio image and putting it back together into a new cpio image [not that I know of a GUI based tool that assists in that regard, and IMHO there should be none, a user who cannot handle simply terminal tasks should have no business editing any initrd]) should be clever enough to have at least one backup config that uses a standard known-to-work initrd.
Added in 5 hours 52 minutes 32 seconds:
And rych, just my 2 cents on that matter but I recommend you altering initrd.xz's entry in /etc/porteus/ as well.
Example, you use 20220928 as base for your initrd.xz and you keep it like so and post the info
Code: Select all
guest@porteus:~$ cat /etc/porteus/initrd.ver
initrd.xz:20220928
It is also better for yourself to keep track on your own changes. And you also see when booting and asking the entry in /etc/porteus/initrd.ver what version you are running. One minor edit but it gives you much advantage in keeping track especially when debugging your initrd, you would not want to boot an outdated edited one by mistake and not realizing it cause all your initrd's give the very same info in /etc/porteus/initrd.ver …
Cheers!
Yours Rava
Yours Rava