(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 Fri 04 Dec 2020, 00:58
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
How to mount a partition, using only the command line?
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 [11 Posts]  
Author Message
mikeslr


Joined: 16 Jun 2008
Posts: 3913
Location: 500 seconds from Sol

PostPosted: Sat 08 Feb 2020, 16:47    Post subject:  How to mount a partition, using only the command line?
Subject description: with known UUID & PartUUID -- SOLVED BY WORKAROUND
 

If you boot bionicpup64 (probably others) from a USB-Key, unplug the key, then replug it the following will be automatically created: /dev/disk/by-partuuid and dev/disk/by-uuid.

Within those folders are files bearing the same labels (or parts-thereof) as would be generated by running the blkid command in a terminal. [Doing so, will create a text file, /tmp/blkid/blkid.tab, listing all loop devices and partitions by full UUID].

The files in /dev/disk/by-partuuid and dev/disk/by-uuid bear the same icons as symbolic links. However, clicking them will generate a notice that the system does not know what to do.

I know it is possible to mount ALL partitions using a "bash" script, http://www.murga-linux.com/puppy/viewtopic.php?p=822240&sid=c8246eec4077100c0e2dd382fbed911e#822240. [The first couple of lines, I think, perform a filtering process which may not be necessary when the (part)uuid is known].

But what script can be used to only mount one partition on the re-plugged USB-Key?

Blame this inquiry on nic007 and william2. nic007 has long championed converting SaveFiles/Folders to ?drv.sfs so that your system will be created on bootup from READ-Only files. william2 has made it clear that, if you have enough RAM, the entire contents of the system files will be copied into RAM. Perhaps this has stimulated ozsouth to consider creating more READ-ONLY SFSes than just adrv.sfs and ydrv.sfs. http://www.murga-linux.com/puppy/viewtopic.php?p=1049764#1049764. Perhaps, not. But these were the considerations leading me to wonder "If there are applications which I don't often need, could I replug the USB-Stick and call them from the Menu avoiding the need to file-browse to them". [I can probably come up with a bash+dialog routine to remind me to plug in the Key].

Last edited by mikeslr on Fri 14 Feb 2020, 20:59; edited 1 time in total
Back to top
View user's profile Send private message 
backi

Joined: 27 Feb 2011
Posts: 2007
Location: GERMANY

PostPosted: Tue 11 Feb 2020, 04:48    Post subject:  

Hi mikeslr !
This Forum is somehow a Treasure Trove .....but the Gems are almost lost or buried deep inside .

Maybe RSH (quite talented ....but now being banned from the Forum for being too nasty??) was follwing a similar Concept with his T.O.P.L.E.S.S and its Precursor Lazy Puppy ......not quite sure.....

maybe you can find some Ideas/ inspirations here.....give you the Link:
T.O.P.L.E.S.S.
http://www.murga-linux.com/puppy/viewtopic.php?t=102734

http://murga-linux.com/puppy/viewtopic.php?t=74544

Regards !
Back to top
View user's profile Send private message 
nic007


Joined: 13 Nov 2011
Posts: 3444
Location: Cradle of Humankind

PostPosted: Tue 11 Feb 2020, 08:50    Post subject: Re: How to mount a partition, using only the command line?
Subject description: with known UUID & PartUUID
 

mikeslr wrote:
If you boot bionicpup64 (probably others) from a USB-Key, unplug the key, then replug it the following will be automatically created: /dev/disk/by-partuuid and dev/disk/by-uuid.

Within those folders are files bearing the same labels (or parts-thereof) as would be generated by running the blkid command in a terminal. [Doing so, will create a text file, /tmp/blkid/blkid.tab, listing all loop devices and partitions by full UUID].

The files in /dev/disk/by-partuuid and dev/disk/by-uuid bear the same icons as symbolic links. However, clicking them will generate a notice that the system does not know what to do.

I know it is possible to mount ALL partitions using a "bash" script, http://www.murga-linux.com/puppy/viewtopic.php?p=822240&sid=c8246eec4077100c0e2dd382fbed911e#822240. [The first couple of lines, I think, perform a filtering process which may not be necessary when the (part)uuid is known].

But what script can be used to only mount one partition on the re-plugged USB-Key?

Blame this inquiry on nic007 and william2. nic007 has long championed converting SaveFiles/Folders to ?drv.sfs so that your system will be created on bootup from READ-Only files. william2 has made it clear that, if you have enough RAM, the entire contents of the system files will be copied into RAM. Perhaps this has stimulated ozsouth to consider creating more READ-ONLY SFSes than just adrv.sfs and ydrv.sfs. http://www.murga-linux.com/puppy/viewtopic.php?p=1049764#1049764. Perhaps, not. But these were the considerations leading me to wonder "If there are applications which I don't often need, could I replug the USB-Stick and call them from the Menu avoiding the need to file-browse to them". [I can probably come up with a bash+dialog routine to remind me to plug in the Key].

mikeslr - The application will only have a menu entry if the sfs package includes a .desktop file. Am I correct in assuming that you want to operate completely in RAM but there are extra sfs files which you only use occasionally and want to load those during a session from a usb-stick? Well, you will have to mount the usb-stick anyway to access the sfs files (I would suggest placing them all in the same location). This is what I would do: copy the sfs file you want to load to the running filesystem, say /root (don't copy it to /tmp). Now you can remove the usb-stick and load the sfs file from /root with the nocopy option. If you want to unload later, click on the sfs file in /root again and choose unload (the sfs will be unloaded and the actual sfs file in /root automatically deleted).

_________________
nicOS-Utility-Suite
Back to top
View user's profile Send private message 
mikeslr


Joined: 16 Jun 2008
Posts: 3913
Location: 500 seconds from Sol

PostPosted: Tue 11 Feb 2020, 16:14    Post subject: I'll see if part-hotplug handler works/comes close  

Hi nic,

Thanks for taking an interest.
The reason I've been pursuing this rather esoteric question is that what I have in mind is giving away a couple of USB-Keys with a fully functional and as secure as possible Puppy OS to some friends who are stuck in Windows. I'm trying to make it as easy as possible for them to 'work the system' without having to learn Puppy's quirks.

Under Windows, when you plug in a USB-Key, Windows automatically mounts it and offers to run a virus scan. When, under Puppy, you plug in a USB-Key, Puppy ‘notes it’s presence’ and availability, assigns it’s partitions labels – sdX-numbers-- displays desktop-drive-icons relating to those sdX partitions, but does not mount those partitions. I don’t know the mechanism/codes by which Puppies does any of that.

Newbies to Linux in general, Puppy in particular, will not be familiar with the Linux equivalent of familiar Window programs. After a decade, I still don’t think of making use of many applications which appear on Puppy’s Start-Menu. To make use of an application, a newbie has to (a) know it exists, (b) know what it can do, (c) and know how to start it. An unknown application ‘buried’ on an unmounted partition is unlikely ever to be discovered and used.

Puppy’s Menu with its divisions into Categories can, at least, alert a newbie to an application’s existence and provides a little bit of information about what it does. As I’ve posted several times, AppFinder [although developed for use under the XFCE window-manager] can be installed into any Puppy, assigned to a Task-bar launcher adjacent to the Start-Menu, and provide a significant amount of information about what an application does. Opening AppFinder, you can scroll through Puppy’s Categories in its Left-pane. In its Right-pane will appear both the names of applications, and under their name whatever description was included after “Comment=” in that application’s /usr/share/application/...desktop file. For example, the description which appears for LibreOffice Impress is “Create and edit presentations for slideshows, meeting and Web pages by using...”

To make use of a KNOWN and desired application on an unmounted partition, the user must, if the application is at the root of the partition (a) mount the partition –easiest by Left-Clicking the desktop-drive icon and (b) Left-Clicking the AppImage or (c) Right-Clicking and selecting and sfs_load if the application is an SFS. Greater knowledge of how to use Rox is required if the application is NOT at the root of a partition.

No knowledge of rox, mounting or Left-or-Right Clicking is required to start an application via the Menu or AppFinder. All that is required are the existence of three files: (a) a pixmap; (b) a /usr/share/applications/...desktop file whose Exec= argument calls a bash-script; and (c) a bash script detailing the path to the executable and naming the executable.

For example, if your nicOS-Remaster-Suite.sfs is at the root of /mnt/sdc1/ and partition sdc1 is mounted, the following bash script argument can be used to open it:

sfs_load /mnt/sdc1/nicOS-Remaster-Suite.sfs

Similarly, if fb-reader.Appimage is on mounted sdc1 this bash script argument will start it:
exec /mnt/sdc1/fb-reader.AppImage "$@".

If sdc1 is UNMOUNTED, the sfs_load command will display a “not found” error, and the exec AppImage command will display a “No Such file or directory” error.

So, one can provide Menu and AppFinder Listings for even AppImages and SFSes not currently available.

Having unplugged a USB-Key, Puppy will create several files, and generate and display a labeled desktop-drive icon when you again plug in the USB-Key. The question is how to make use of the information which, on replugging the USB-Key, is in Puppy’s system?

The initial label assigned will depend on how many internal & USB-drives the computer had when the Puppy on the USB-Stick booted; and if between the time you remove the Stick and replug it you’ve plugged in a different Stick, the label it receives may be different from that originally assigned. Hence, my interest in using the (part)-UUID.

Of course, finding an answer to the question isn’t particularly important. It’s highly likely that Window refugees are familiar with portable-programs. Learning to Right-Click an SFS and select sfs-load from the popup-menu shouldn’t strain even their dumbed-down mental capacity. It’s just annoying that I’m certain it is possible to accomplish something but can’t figure out how.

But, perhaps iguleder already did, or came close. I’ll have to examine his part-hotplug-handler, http://murga-linux.com/puppy/viewtopic.php?p=705398#705398 which I’ve just re-discovered.
Back to top
View user's profile Send private message 
musher0

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

PostPosted: Tue 11 Feb 2020, 19:52    Post subject:  

Hi mikeslr.

Just a marker. Will try to help later.

BFN.

_________________
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
Back to top
View user's profile Send private message 
musher0

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

PostPosted: Thu 13 Feb 2020, 18:10    Post subject:  

Hi mikeslr and all.

Sorry for the late reply.

I'm still trying to come up with a mental picture of the problem.
So please don't jump on me if I appear to say or repeat silly things!
In this post, I'm "thinking out loud".

First of all, a tentative overview:
-- We have a reference to RSH's experiments above.
-- Didn't BK already provide an experimental monitor / sensor for plug-in drives?

A couple of questions:
The bbiigg question, of course: what is this for?
A.: We wish to access sfs archives and AppImages from time to time, which are
located on USB drive N.

Why do we need to un-plug and re-plug the USB?
Modern computers have 4 usb ports, generally. Even on older computers with only
2, we can use 1 port to plug-in a multiple-USB-ports "whatchamacallit".

Off the top:
I think the ID's of the USB drive can not help us, unless we jot them down in
a little "memo" (text) file at boot-up for comparison later.

Why use blkid? It's quite slow. probepart is faster.

If we do need to un-plug/re-plug the USB drive, could we not use good old
mount in the usual way? The mount command will not re-mount a mounted drive,
so there is no risk.

Idea (in pseudo-code)
We wish to run file "blablablue", which is in sfs archive "bebop".
We check if archive bebop.sfs is already mounted through
Code:
sfs_load -i -c | grep bebop.sfs
If not, we mount partition sdN (after inserting the USB!!!)
and we run
Code:
sfs_load -c /mnt/sdN/bebop.sfs
sleep 4s # to make sure it is loaded
blablablue
Please notice the full path on the sfs file.
sfs_load will load it. The difference is that in this form sfs_load does not save
it in its log for next boot. (Which is what we want in this case, isn't?)

That's all I can come up with for now.
IHTH.

_________________
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
Back to top
View user's profile Send private message 
williams2

Joined: 14 Dec 2018
Posts: 337

PostPosted: Thu 13 Feb 2020, 19:23    Post subject:  

UID is a Unique ID, useful for 1 specific piece of hardware, not useful for every Puppy user in general. That is, a UID that works for you would not work for anyone else.

A LABEL (partition name) would work for you and every other Puppy user.

When a Puppy boot CD/DVD/flash drive it could be named for example PuppyLinuxOS, by the creator if the iso. Then this would be all that is needed to mount the Puppy boot usb drive:
Code:
test -d /mnt/PuppyLinuxOS || mkdir /mnt/PuppyLinuxOS
mount-FULL LABEL=PuppyLinuxOS /mnt/PuppyLinuxOS

Mounting using LABEL= does not require the drive to be unplugged then plugged in.
For example, something like this simple demo would automatically mount the Puppy boot flash drive and popup a rox window showing the contents of the dir extras:
Code:
test -d /mnt/PuppyLinuxOS || mkdir /mnt/PuppyLinuxOS
test -d /mnt/PuppyLinuxOS/extras && exec rox /mnt/PuppyLinuxOS/extras
mount-FULL -r LABEL=PuppyLinuxOS /mnt/PuppyLinuxOS || exit 1
rox /mnt/PuppyLinuxOS/extras

The rox window might look like this, if you like:
Code:
rox /usr/share/applications/

This simple demo would mount a partition named PuppyExtras and display the contents of a dir named extras:
Code:
P=PuppyExtras
test -d /mnt/$P || mkdir /mnt/$P
test -d /mnt/$P/extras && exec rox /mnt/$P/extras
mount-FULL -r LABEL=$P /mnt/$P || exit 1
rox /mnt/$P/extras

Otherwise, you would need to mount every partition and look inside to see if it contains what you are looking for. Or assume the last drive plugged in is the one you want. I think LABEL= is the best way.
Back to top
View user's profile Send private message 
musher0

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

PostPosted: Thu 13 Feb 2020, 20:39    Post subject:  

I think williams2 is on to something, here... Smile
_________________
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
Back to top
View user's profile Send private message 
perdido


Joined: 09 Dec 2013
Posts: 1601
Location: ¿Altair IV , Just north of Eeyore Junction.?

PostPosted: Thu 13 Feb 2020, 21:12    Post subject:  

One method of making consistent mount points. Implementing into a mount/unmount script might be possible.
Howto make permanent USB mount points with "udev"

.
Back to top
View user's profile Send private message 
mikeslr


Joined: 16 Jun 2008
Posts: 3913
Location: 500 seconds from Sol

PostPosted: Fri 14 Feb 2020, 20:58    Post subject:  

Thanks everyone for the feedback and ideas.

Thanks, especially, perdido, for the information about udev and the link to your thread and application. I think it should enable me to accomplish my objectives.

I don't have the time to work on it just now. If I run into a problem, or some question, I post to that thread.

I've added "Solved by Workaround" to the title of this thread.

Thanks, again.
Back to top
View user's profile Send private message 
Mike Walsh


Joined: 28 Jun 2014
Posts: 6397
Location: King's Lynn, UK.

PostPosted: Mon 24 Feb 2020, 22:48    Post subject:  

@ Mike:-

Don't forget, the 'Desktop Drive Icons Manager' (available by right-clicking any drive icon) gives you access to the 'Icon Handler' tab. This permits setting-things up so that plugging a USB stick in will cause ROX to not only mount it, but also to display the contents thereof.

This, in combination with jafadmin's 'Udev-rules' script for USB sticks/drives, permits me to always get the same drive mount-point for any given USB drive, along with then displaying the contents as soon as it's plugged in.....

Unless, of course, this is not what you're after.....and I've gotten hold of completely the wrong end of t'stick..!


T'other Mike. Wink

_________________
MY 'PUPPY' PACKAGES

Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [11 Posts]  
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 » Users ( For the regulars )
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: 2.1575s ][ Queries: 12 (1.9449s) ][ GZIP on ]