Mounting Drive - Constant Drive Letter

Booting, installing, newbie
Message
Author
crocombe
Posts: 1
Joined: Wed 28 Aug 2013, 06:34

Mounting Drive - Constant Drive Letter

#1 Post by crocombe »

hi
How do I force Puppy to mount a external drive with the same drive letter?
I have Samba running, I rebooted the Pc and the Drive changed from sdb1 to sdc1 so my smb mount would not work..

Love the software.

Mike

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#2 Post by musher0 »

Did you add a USB drive in the meantime?
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Re: Mounting Drive - Constant Drive Letter

#3 Post by L18L »

crocombe wrote:hi
How do I force Puppy to mount a external drive with the same drive letter?
I have Samba running, I rebooted the Pc and the Drive changed from sdb1 to sdc1 so my smb mount would not work..

Love the software.

Mike
No idea what your smb mount is doing but..
mount --help wrote:A device can be given by name, say /dev/hda1 or /dev/cdrom,
or by label, using -L label or by uuid, using -U uuid .
using UUID seems to be best method.
(better answers may follow)

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#4 Post by sunburnt »

Hey Mike; L18L is correct, that is if you want to dig into UUID and how to use it.

In rxvt type: blkid
This will show you a list of all the mounted devices, their UUID, and device type.

Understand. As you plug in USBs, they take the next drive slot.
So it`s hard to say if you can reserve a slot.

# However you can always make your own link: /mnt/usbHD => ( Where ever the USB device is mounted.).

If you can do a little Bash scripting, then you should be able to get it to work.
If you have trouble, post back and we`ll help you out.
.

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#5 Post by mikeb »

I believe udev rules are meant to handle this stuff... on here devices get created for the basic device and also additional ones for uuid and so on so you do have the possibility of a consistant device node. Indeed I have a wacom rule that always creates a /dev/wacom link to whatever input device it becomes....

As for how and so on I am not the one to ask,,,

Unfortunately since usb is handled in the initrd before udev I am not 100% sure this info is useful but in the sysinit udev should rerun on already existing devices so such rules can be followed.

Another hairy point is that now all devices are sda so sometimes the order changes depending on speed of initialisation... my older kernels have hda so our external drive is always sda1. As it happens I manually add NFS shares on the fly after boot through the gui so even if an extra stick is left in I just choose whichever the external is and the family don't murder me.
Could samba add drives on the fly? I have never used it...

mike

User avatar
charlie6
Posts: 1230
Joined: Mon 30 Jun 2008, 04:03
Location: Saint-Gérard / Walloon part of Belgium

Re: Mounting Drive - Constant Drive Letter

#6 Post by charlie6 »

Hi,
crocombe wrote:hi
How do I force Puppy to mount a external drive with the same drive letter?...
i have the same-till-now-unsolved-little-trouble for... years ! it is like a stone in one's shoe ..one can live with it :)

i then jump on this threads opportunity...

Till now, i found this workaround: just reboot Puppy to somehow "reset" the drive letter arrangement.

I'd appreciate another way to "reset that arrangement" without the need of reboot.

Thanks for any further idea.
Charlie

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#7 Post by 8-bit »

Depending on how many devices you have attached and have mounted, your /mount directory will fill up with new folders for each device.
I have on occasion, deleted a number of those folders and let puppy start over when a new device was mounted.
Just be sure that the /mnt folders that you delete are not mounted at the time!

User avatar
charlie6
Posts: 1230
Joined: Mon 30 Jun 2008, 04:03
Location: Saint-Gérard / Walloon part of Belgium

#8 Post by charlie6 »

@8-bit
Thanks !!
I was already aware of looking in /mnt for mounted device(s) and manualy unmount them by right-click on their icon. Upon the last occurence of that «trouble», I indeed got a look in my /mnt folder ... but did not found any usb-mounted device left.

Another «workaround» might be (please do correct if wrond):
Wait at least 6 seconds time spacings between unplugging and plugging operations of usb devices. Here i can hear the sound of my hard-disk when the (un)plugging is somehow «registered».
(i'm using «» quotes to tell the used words may be somewhat subjective).

cheers, charlie

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#9 Post by sunburnt »

Here`s a simple solution I made.
When the script is run, it looks for the file "DriveLink" in the "/" of all mounted partitions.
If there is a DriveLink file, it contains the name of the link you want for your USB access.
This is nice because you can control where the link is made and the name of the link.
And of course it makes the same link no matter where the USB drive is mounted.

# Example for my red 8GB USB drive:

The contents of the DriveLink file: /mnt/USB-Red-8GB

This will create the link: /mnt/USB-Red-8GB => ( My red 8GB USB drive with DriveLink file in it`s / )

# This seems to work very well, and is very simple too. Hope it helps.

There is some text help at the start of the file.
I also added it to my script that mounts all partitions found.
.
Attachments
drvlink.gz
Ungzip file and copy to: /root/Startup
(692 Bytes) Downloaded 201 times

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#10 Post by greengeek »

sunburnt wrote:# Example for my red 8GB USB drive:

The contents of the DriveLink file: /mnt/USB-Red-8GB

This will create the link: /mnt/USB-Red-8GB => ( My red 8GB USB drive with DriveLink file in it`s / )
.
So are you saying that regardless of what sdx number puppy assigns to the drive, it will always be mounted to the same place? (eg sdc2 or sdc3 or sdd3 always becomes /mnt/musicarchive if that is it's drivelink)

But wouldn't that mean I would have to force puppy to mount ALL drives first, so that the drivelink could be read? Is there a way to get puppy to read the drivelink without first mounting the partition?

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#11 Post by sunburnt »

greengeek; It makes links, it does not mount partitions.
So the mount point is irrelevant if you use a link pointing to it that is always the same /path/link

I assumed that crocombe already had the USB drive mounting at boot.
But he has no reliable fixed /path to access it with. A link is an easy fix.

I made a comment that I added the code to another script I made that mounts all partitions.

And yes, like Puppy does searching for it`s files, you could: mount, check, and unmount.
Puppy already has a boot mount manager, so I figure it`s good for most purposes.

Another script of mine usb-auto auto mounts/unmounts USB drives, it could use this too.
Unfortunately it clashes head to head with hotpup, both doing the same task causes problems.

Is there something you have in mind greengeek.? I could make it search all the drives...

Other possiblities are: Use the "Drive Label" as a link name, then no file is needed.
Apparently the Disk Label can be accessed without the partitions being mounted.


### Update: Yes indeed the Volume Label can be read when the partition is not mounted.

I learned a long time ago to avoid using Volume Labels, can`t change the disk parameters.
But this may only be in DOS ( it`s been that long...), so maybe it`s not such a bad idea.

### If there`s interest, I`ll rewrite drvlink to use Volume Labels instead of a file. Auto mount.?
.

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#12 Post by greengeek »

When you say volume label - is that the same thing as UUID?

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#13 Post by sunburnt »

No... Google it. It`s a little used aspect of HDs.
Each partition can be given a name.

# Commands:
tune2fs = set / del. labels for: ext-2-3-4
dosfslabel = set / del. labels for: fat16-32 & vfat
ntfslabel = set / del. labels for: ntfs
.

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#14 Post by mikeb »

Udev is a bit of a cryptic beastie but on slax it makes device node symlinks in 4 folders ... by-id, by-label, by-path and by-uuid which all are links made to the sda(x)(n) actual devices.... sort of covers every possibility.
There may be a point to this post..if so send me a postcard

mike

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#15 Post by greengeek »

mikeb wrote:Udev is a bit of a cryptic beastie but on slax it makes device node symlinks in 4 folders ... by-id, by-label, by-path and by-uuid which all are links made to the sda(x)(n) actual devices.... sort of covers every possibility.
I think I may be wanting to do the exact opposite of this - instead of symlinks pointing to sdx, I want a particular sdx to be "reserved" so it can only be applied to a specific UUID. ie: I want sdx to be a symlink to the /mnt/UUIDxxxxx or to something like the drivelink sunburnt memtioned.

So that if my usb stick was physically absent (not plugged in) then NO OTHER DEVICE would be allowed to be called say, sdc2 because that is reserved for the specifc UUID that is not present.

I suspect that is too deeply ingrained in puppy for me to change it. (or maybe I'm just not understanding this fully...)

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#16 Post by sunburnt »

mikeb; I know what you mean...

greengeek; Here`s a web page showing how to use fstab to mount by label.
I`m not fond of fstab, so I prefer simple script mounting.

http://www.cyberciti.biz/faq/rhel-cento ... ion-label/

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#17 Post by mikeb »

Yo sunburnt.

I really don't get on with udev but if I understand correctly the kernel comes up with the /dev/sdxx and udev can only add links or play with names, or run actions when it happens. The idea of reserving a sdxx designation would be nice but the reality may well be a case of having your own special named device linked to a uuid or drive label via sunburnts script or a udev rule....definately don't quote me on this paragraph.

mike

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#18 Post by sunburnt »

Yes, I`ve learned also to avoid "I want it my way" and get on with something that works.

Like trying to find a Win. Ex. type File Browser that will recognize AppDir packages.

greengeek; I don`t see the point in wanting to reserve a device node.
.

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#19 Post by greengeek »

sunburnt wrote:greengeek; I don`t see the point in wanting to reserve a device node.
.
Well, here is my thinking:
At the moment if I plug in my music stick it appears on the desktop as either sdc2 or sdd2 (varying according to timing issues or something...). Lets say one of my family says "which icon do I click to get to the music" and I reply "click sdc2" then my answer will be wrong 10% of the time.

Sure, I can use the UUID and various other means (like the drivelink...) to get a script to find the correct partition regardless of what icon / devnode puppy gave it - that solves the issue for programs running behind the scenes - but that doesn't resolve the confusion in the eyes of the user who is looking at what icons are displayed on the desktop.

Also - I get circumstances where the usb stick changes it's icon/devnode halfway during the evening and goes from sdd2 to sde2. (I figure this is due to other devices I plug in causing bad connection or something...). Itd be nice to have a method to force puppy to reserve specific devnodes for specific, commonly used storage devices.

Maybe what I should really do is have NO drive icons on screen and instead create new symlinks on the desktop that ARE linked to UUID.

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#20 Post by mikeb »

Maybe what I should really do is have NO drive icons on screen and instead create new symlinks on the desktop that ARE linked to UUID.
you sort of read my mind... though why not have both.... the family get directed to the ones they need you created...could have an icon of a camera or something familiar.

You really don't want to get involve with the normal icons if you can help it.

mike

Post Reply