Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 20 Nov 2019, 03:54
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
Howto make permanent USB mount points with "udev"
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 2 [21 Posts]   Goto page: Previous 1, 2
Author Message
jafadmin

Joined: 19 Mar 2009
Posts: 1003

PostPosted: Tue 20 Feb 2018, 17:46    Post subject:  

@GG

Switch to the wizard. The first one is just a demo that shows proof of concept.

Read the README ..

I am not aware of name length restrictions on devices. You might just be afflicted by voodoo at your outpost ..
Back to top
View user's profile Send private message 
jafadmin

Joined: 19 Mar 2009
Posts: 1003

PostPosted: Tue 20 Feb 2018, 22:56    Post subject:  

TyroBGinner wrote:
there any way to modify this utility so that drive uniqueness can be preserved with fanout devices like usb hubs and multi-drive HDD "docks"? I gather that is a lot to ask since the udev rules seem to correspond to the device immediately in contact with the computer's usb connection.


It works with USB hubs as long as you plug them in one at a time to create the initial ".rules" file. After that you can plug a bunch into the hub and they seem to mount ok. Anyways, they do for me. I can get two identical Sandisk Cruisers to work right in a hub.

I may spend some time later working with the udevadm info dumps to try to tweak that.

As far as the HD cradles are concerned, one would have to do a bunch more research on how to grab those. Maybe grab events from dmesg or something ..
Back to top
View user's profile Send private message 
gychang


Joined: 29 Nov 2008
Posts: 303
Location: San Diego, CA

PostPosted: Mon 19 Aug 2019, 13:04    Post subject: Re: Howto make permanent USB mount points with "udev"
Subject description: Hotplugging, suspending, power loss, accidental disconnects, and reboots handled gracefully
 

jafadmin wrote:


Now just plug in the USB disk you want to use for this, then open a console in /root/bin and type: "./mkrule /dev/sdX" (where X is your usb device). This will create the udev rule and put it where it needs to go.

At this point all partitions on your USB disk should be mounted at: /MyUSB

From now on, that, and only that USB disk, will always mount as /MyUSB/MyUSB-1, /MyUSB/MyUSB-2, etc ..

Drag a link to /MyUSB to your desktop.

Prosper.

That is all.


On my Bionipup64, after typing in the command ./mkrule /dev/sdg there is no error but no /MyUSB directory is created.

What am I doing wrong?

_________________
---
trying to learn puppylinux...
---
Back to top
View user's profile Send private message 
Mike Walsh


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

PostPosted: Mon 19 Aug 2019, 14:42    Post subject:  

gychang wrote:
On my Bionipup64, after typing in the command ./mkrule /dev/sdg there is no error but no /MyUSB directory is created.

What am I doing wrong?


Greg:-

You're not looking for a /MyUSB 'directory', as such. What you're looking for is a 'mount-point'.....and you won't find it in /root.

IF 'MyUSB' is the name you've used for your drive (it's really just an example - you could use any name you like), then you should see it by doing the following.

In ROX's /root 'window', click on the upward-pointing arrow at the far left end of the menu bar - this'll take you up a level into the main file-system. You should see MyUSB alongside /root, /var, /lib, /bin, /usr, etc.

The instructions for this are a wee bit misleading, unfortunately. There's no /root/bin directory. What you're looking for is the /root/udev directory. Like this:-





Click on that to open it:-





Mine has 3 files; the middle one is my personal 'mount-point'. It's a Seagate Expansion Desktop drive, so I've named it SeaDesk. You should only see the two outside ones, because the 3rd one won't exist until you've run the command in the terminal.

After you've done that, you should then see the new 'mount-point' alongside the other system files, under '/'. Like this:-





I've dressed it up with a drive icon, to make it more obvious what it is. From this point on, this drive will always mount to the new mount-point that you've just created.


Mike. Wink

_________________
MY 'PUPPY' PACKAGES

Back to top
View user's profile Send private message 
gychang


Joined: 29 Nov 2008
Posts: 303
Location: San Diego, CA

PostPosted: Mon 19 Aug 2019, 15:35    Post subject:  

Mike Walsh wrote:
gychang wrote:
On my Bionipup64, after typing in the command ./mkrule /dev/sdg there is no error but no /MyUSB directory is created.

What am I doing wrong?


Greg:-

You're not looking for a /MyUSB 'directory', as such. What you're looking for is a 'mount-point'.....and you won't find it in /root.

IF 'MyUSB' is the name you've used for your drive (it's really just an example - you could use any name you like), then you should see it by doing the following.

Mike. Wink


MIke I really appreciate your effort, now working fine.

_________________
---
trying to learn puppylinux...
---
Back to top
View user's profile Send private message 
rufwoof


Joined: 24 Feb 2014
Posts: 3627

PostPosted: Mon 19 Aug 2019, 18:13    Post subject:  

The device naming lottery can be a pain when some hard code device names into scripts and the kernel decides that after another reboot to swap those names all around. Personally I tend to manually mount things

mkdir /mnt/usb
mount /dev/sdb1 /mnt/usb

where usually I use fdisk -l to quickly review devices

In some cases I do script based mounting and when so I tend to include a identity file on devices, where the script loops through mounting things and looking for a particular unique filename that I've pre-created on that device, and when found it creates a /mnt/xxx folder and mounts the device to that mount point.

Other approaches are to use UUID, or device label (disk label), or device name. For instance in gparted there's a option to set a partitions label and once you've done that, such as setting a usb with a single partition to have a label of 'whiteusb' (perhaps for a white coloured usb stick), then you can mount that using

mkdir /mnt/whiteusb
mount -L whiteusb /mnt/whiteusb

If you use that consistently, then your scripts can reference that reliably

cd /mnt/whiteusb
.... etc.

Mount points don't have to be under the /mnt folder. You could for instance mount it to a folder within /root

mkdir /root/whiteusb
mount -L whiteusb /root/whiteusb

To umount when done ... umount /root/whiteusb

Labels are nice in that they remain consistent, under certain conditions for instance UUID's can change.

/etc/fstab is the list of devices that get mounted at bootup. For mounting using labels the format is something like

LABEL=whiteusb /mnt/whiteusb ext3 defaults 0 0

_________________
( ͡° ͜ʖ ͡°) :wq
Fatdog multi-session usb

echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 2 of 2 [21 Posts]   Goto page: Previous 1, 2
Post new topic   Reply to topic 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: 0.0495s ][ Queries: 12 (0.0143s) ][ GZIP on ]