Mounting Drive - Constant Drive Letter
Mounting Drive - Constant Drive Letter
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
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
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
Re: Mounting Drive - Constant Drive Letter
No idea what your smb mount is doing but..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
using UUID seems to be best method.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 .
(better answers may follow)
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.
.
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.
.
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
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
- charlie6
- Posts: 1230
- Joined: Mon 30 Jun 2008, 04:03
- Location: Saint-Gérard / Walloon part of Belgium
Re: Mounting Drive - Constant Drive Letter
Hi,
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
i have the same-till-now-unsolved-little-trouble for... years ! it is like a stone in one's shoe ..one can live with itcrocombe wrote:hi
How do I force Puppy to mount a external drive with the same drive letter?...
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
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!
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!
- charlie6
- Posts: 1230
- Joined: Mon 30 Jun 2008, 04:03
- Location: Saint-Gérard / Walloon part of Belgium
@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
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
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.
.
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
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)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 / )
.
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?
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.?
.
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.?
.
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.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.
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...)
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/
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/
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
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
Well, here is my thinking:sunburnt wrote:greengeek; I don`t see the point in wanting to reserve a device node.
.
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.
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.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 really don't want to get involve with the normal icons if you can help it.
mike