My Pi 3B's, usually, automatically mount a newly inserted uSD card (in a USB adapter) in /media/pi, which is convenient for my script that dumps all my "standard" customizations to a newly flashed card.
But one of them doesn't auto-mount at all. I tried applying the usbmount package, but now they're mounting in /media/usb0, /media/usb1, etc. which is not really what I want.
Does anyone know how to restore (or add) the feature that mounts them in /media/pi?
-
- Posts: 60
- Joined: Mon Apr 17, 2017 12:39 pm
Re: USB storage auto-mount in /media/pi
Pcmanfm does the auto-mounting. It uses udiskctl to do it from the backend.
You can run this manually:
/dev/sda is the path to the device you want to mount. Find your device with lsblk.
/dev/sda1 is the path to a certain partition on your selected disk. Change to 2 if your usb device has a second partition.
If that ^ doesn't work, then maybe your uSD card is corrupted or unformatted. Use SD Card Copier to duplicate a good sd card to this faulty one, and see if that solves your problem.
You can run this manually:
Code: Select all
udisksctl mount -b /dev/sda1
/dev/sda1 is the path to a certain partition on your selected disk. Change to 2 if your usb device has a second partition.
If that ^ doesn't work, then maybe your uSD card is corrupted or unformatted. Use SD Card Copier to duplicate a good sd card to this faulty one, and see if that solves your problem.
Easily install anything on your Pi using Pi-Apps. Over 2 million users.
Over 200 apps including image editors, IDEs, games, web browsers, appearance themes, and more to upgrade your Raspberry Pi desktop.
More info: https://github.com/Botspot/pi-apps
Over 200 apps including image editors, IDEs, games, web browsers, appearance themes, and more to upgrade your Raspberry Pi desktop.
More info: https://github.com/Botspot/pi-apps
-
- Posts: 60
- Joined: Mon Apr 17, 2017 12:39 pm
Re: USB storage auto-mount in /media/pi
Interesting. For reasons unknown, I can't connect to the X desktop on this Pi (it's headless, and I can't plug it into a monitor right now).Botspot wrote: ↑Mon Jun 08, 2020 2:13 pmPcmanfm does the auto-mounting. It uses udiskctl to do it from the backend.
You can run this manually:/dev/sda is the path to the device you want to mount. Find your device with lsblk.Code: Select all
udisksctl mount -b /dev/sda1
/dev/sda1 is the path to a certain partition on your selected disk. Change to 2 if your usb device has a second partition.
If that ^ doesn't work, then maybe your uSD card is corrupted or unformatted. Use SD Card Copier to duplicate a good sd card to this faulty one, and see if that solves your problem.
Since I can't get a graphical display, I can't run pcmanfm.
But more to the point: rather than running it manually - is there a way to enable the automatic behavior?
Re: USB storage auto-mount in /media/pi
The "automatic behavior" is based on pcmanfm. But if you can't run pcmanfm (because you can't run a X server), then you can't run the automatic behavior.wildbillnj1975 wrote: ↑Mon Jun 08, 2020 4:26 pmInteresting. For reasons unknown, I can't connect to the X desktop on this Pi (it's headless, and I can't plug it into a monitor right now).
Since I can't get a graphical display, I can't run pcmanfm.
But more to the point: rather than running it manually - is there a way to enable the automatic behavior?
One thing to try:
Code: Select all
vncserver
Easily install anything on your Pi using Pi-Apps. Over 2 million users.
Over 200 apps including image editors, IDEs, games, web browsers, appearance themes, and more to upgrade your Raspberry Pi desktop.
More info: https://github.com/Botspot/pi-apps
Over 200 apps including image editors, IDEs, games, web browsers, appearance themes, and more to upgrade your Raspberry Pi desktop.
More info: https://github.com/Botspot/pi-apps
-
- Posts: 60
- Joined: Mon Apr 17, 2017 12:39 pm
Re: USB storage auto-mount in /media/pi
wildbillnj1975 wrote: ↑Mon Jun 08, 2020 4:26 pmI connected it to another Pi for X display, and ran pcmanfm. Inserted the card. Nothing happened.Botspot wrote: ↑Mon Jun 08, 2020 2:13 pmPcmanfm does the auto-mounting. It uses udiskctl to do it from the backend.
You can run this manually:/dev/sda is the path to the device you want to mount. Find your device with lsblk.Code: Select all
udisksctl mount -b /dev/sda1
/dev/sda1 is the path to a certain partition on your selected disk. Change to 2 if your usb device has a second partition.
If that ^ doesn't work, then maybe your uSD card is corrupted or unformatted. Use SD Card Copier to duplicate a good sd card to this faulty one, and see if that solves your problem.
(I checked the preferences for mounting newly inserted cards. They're all checked.)
Card itself is definitely, absolutely, unquestionably fine. It's not the card. Same card inserted in another Pi is automounted in /media/pi (/boot in /media/pi/boot and / in /media/pi/rootfs).
But more to the point: rather than running it manually - is there a way to enable the automatic behavior?
The fact that it's automounting in /media/pi with knowledge of what the two partitions mean, suggests to me that it has to be a specific service or feature that's doing this.
Re: USB storage auto-mount in /media/pi
That's not strictly true...wildbillnj1975 wrote: ↑Mon Jun 08, 2020 4:26 pmInteresting. For reasons unknown, I can't connect to the X desktop on this Pi (it's headless, and I can't plug it into a monitor right now).
Since I can't get a graphical display, I can't run pcmanfm.
Enable vnc. Connect over that and run pcmanfm
Or enable X11 forwarding over ssh and run it on a remote X server though that'll take more setup and you'll need to know what command to use to run it.
Knowledge, skills, & experience have value. If you expect to profit from someone's you should expect to pay for them.
All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides
All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides
Re: USB storage auto-mount in /media/pi
Or do what I suggested and run vncserver. It loads the default desktop session (with a pcmanfm desktop background), and so takes no more user interaction than that one single command.
Easily install anything on your Pi using Pi-Apps. Over 2 million users.
Over 200 apps including image editors, IDEs, games, web browsers, appearance themes, and more to upgrade your Raspberry Pi desktop.
More info: https://github.com/Botspot/pi-apps
Over 200 apps including image editors, IDEs, games, web browsers, appearance themes, and more to upgrade your Raspberry Pi desktop.
More info: https://github.com/Botspot/pi-apps
-
- Posts: 60
- Joined: Mon Apr 17, 2017 12:39 pm
Re: USB storage auto-mount in /media/pi
I must have been editing my post while you were replying to it.
I was able to run pcmanfm but that didn't automount the card (and yes, I checked the preferences to ensure that was enabled).
But more to the point: rather than running it manually - is there a way to enable the automatic behavior?
The fact that it's automounting in /media/pi with knowledge of what the two partitions mean, suggests to me that it has to be a specific service or feature that's doing this.
The problem I'm trying to solve isn't "How can I automount this card?"
The problem I'm trying to solve is "How can I permanently and universally restore the missing automount-in-/media/pi behavior?"
Re: USB storage auto-mount in /media/pi
Yes. this "service or feature" is pcmanfm, and it runs by default in graphical Raspberry Pi OS.wildbillnj1975 wrote: ↑Mon Jun 08, 2020 6:00 pmThe fact that it's automounting in /media/pi with knowledge of what the two partitions mean, suggests to me that it has to be a specific service or feature that's doing this.
So if you are running headless (i.e., no desktop), then it won't work.
Specifically, it's the pcmanfm desktop process. So if you only run pcmanfm, nothing will happen.
I noticed you added some stuff to your main post and now I'm confused. What is your real question?
- "usb drives are auto-mounting, but to the wrong spot. How to make them auto-mount to /media/pi like they did before?"
Answer: uninstall usbmount. You may have to reboot afterwards to stop any residual in-memory processes. Still not working? Provide more information. - "All my uSD cards auto-mount, except for this one weird uSD card that doesn't auto-mount. How to fix it?"
Answer: I'd try to re-flash the SD card (with "New Partition UUIDs" checked) and see if that fixes it. Sometimes a partition ID matches another partition ID, and the kernel struggles to keep track which is which. - "All my Pies auto-mount, except for this one Pi. Why?"
Answer: Likely that one Pi is headless, or not running pcmanfm --desktop. Or it;s possible you're having a UUID problem (see above)
Easily install anything on your Pi using Pi-Apps. Over 2 million users.
Over 200 apps including image editors, IDEs, games, web browsers, appearance themes, and more to upgrade your Raspberry Pi desktop.
More info: https://github.com/Botspot/pi-apps
Over 200 apps including image editors, IDEs, games, web browsers, appearance themes, and more to upgrade your Raspberry Pi desktop.
More info: https://github.com/Botspot/pi-apps
Re: USB storage auto-mount in /media/pi
Very possibly. The possibility is why I try to avoid major edits once a post has gone "live"wildbillnj1975 wrote: ↑Mon Jun 08, 2020 6:00 pmI must have been editing my post while you were replying to it.
Oh, one more thing: headless and doesn't have the desktop installed/running are not the same thing. It's perfectly possible to have a pi booting into a loged in desktop without having a monitor, mouse or keyboard connected. Wouldn't be sensible but it is possible.
Likewise, it's possible to have a pi with monitor, mouse, and keyboard attached but booting to command line even if the desktop is installed.
Knowledge, skills, & experience have value. If you expect to profit from someone's you should expect to pay for them.
All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides
All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides
-
- Posts: 60
- Joined: Mon Apr 17, 2017 12:39 pm
Re: USB storage auto-mount in /media/pi
Ok. I've always used "headless" to refer to a machine with no KVM attached. "Head" being part of the "body" from which physically there head is missing, regardless whether there's a software desktop. And it sure does make sense to have a full desktop running on those machines. I don't have spare monitors to attach to Pis. The ones with a desktop, I access via VNC.Botspot wrote: ↑Mon Jun 08, 2020 6:14 pmYes. this "service or feature" is pcmanfm, and it runs by default in graphical Raspberry Pi OS.wildbillnj1975 wrote: ↑Mon Jun 08, 2020 6:00 pmThe fact that it's automounting in /media/pi with knowledge of what the two partitions mean, suggests to me that it has to be a specific service or feature that's doing this.
So if you are running headless (i.e., no desktop), then it won't work.
Specifically, it's the pcmanfm desktop process. So if you only run pcmanfm, nothing will happen.
I noticed you added some stuff to your main post and now I'm confused. What is your real question?
- "usb drives are auto-mounting, but to the wrong spot. How to make them auto-mount to /media/pi like they did before?"
Answer: uninstall usbmount. You may have to reboot afterwards to stop any residual in-memory processes. Still not working? Provide more information.- "All my uSD cards auto-mount, except for this one weird uSD card that doesn't auto-mount. How to fix it?"
Answer: I'd try to re-flash the SD card (with "New Partition UUIDs" checked) and see if that fixes it. Sometimes a partition ID matches another partition ID, and the kernel struggles to keep track which is which.- "All my Pies auto-mount, except for this one Pi. Why?"
Answer: Likely that one Pi is headless, or not running pcmanfm --desktop. Or it;s possible you're having a UUID problem (see above)
Generally I always install the full desktop version on 3's (and later), and the "lite" no-desktop version on Zeroes.
This is a 3B+ with the X desktop installed, but it's not running, so I need to go diagnose that.
Thanks for clarifying that it's specifically an X desktop feature.
Since my Zeroes don't have convenient spare USB ports, I have not used them for this sort of thing, therefore never noticed that none of them do the auto-mounting-in-/media/pi thing.
Re: USB storage auto-mount in /media/pi
No problem. Thank you too for clarifying.wildbillnj1975 wrote: ↑Mon Jun 08, 2020 8:24 pmThis is a 3B+ with the X desktop installed, but it's not running, so I need to go diagnose that.
Thanks for clarifying that it's specifically an X desktop feature.
If the 3B+ doesn't boot with a monitor attached, it will not start the desktop. To override that, edit /boot/config.txt:
Code: Select all
sudo nano /boot/config.txt
Code: Select all
hdmi_force_hotplug=1
Easily install anything on your Pi using Pi-Apps. Over 2 million users.
Over 200 apps including image editors, IDEs, games, web browsers, appearance themes, and more to upgrade your Raspberry Pi desktop.
More info: https://github.com/Botspot/pi-apps
Over 200 apps including image editors, IDEs, games, web browsers, appearance themes, and more to upgrade your Raspberry Pi desktop.
More info: https://github.com/Botspot/pi-apps
-
- Posts: 60
- Joined: Mon Apr 17, 2017 12:39 pm
Re: USB storage auto-mount in /media/pi
I actually have scripts that set up all my "standard" customizations on every Pi... which is why it's handy to be able to expect their boot & root sectors to automagically show up in /media/pi...Botspot wrote: ↑Mon Jun 08, 2020 8:30 pmNo problem. Thank you too for clarifying.wildbillnj1975 wrote: ↑Mon Jun 08, 2020 8:24 pmThis is a 3B+ with the X desktop installed, but it's not running, so I need to go diagnose that.
Thanks for clarifying that it's specifically an X desktop feature.
If the 3B+ doesn't boot with a monitor attached, it will not start the desktop. To override that, edit /boot/config.txt:And add this line to the bottom of the file:Code: Select all
sudo nano /boot/config.txt
Or, use the trick I mentioned above to run a virtual desktop session: run vncserver. You don't have to connect to the server, but that command will start a virtual desktop, and will therefore start the necessary auto-mounting process.Code: Select all
hdmi_force_hotplug=1
One of them is that I always add that hotplug parameter in config.txt
Results, IMHO, can be inconsistent.
But I have that one relocated now, to a place where I always can plug in a monitor if I need to reboot it.
Or if not, I'll start a vncserver.
So the problem is essentially resolved.
Thanks for your help.
Re: USB storage auto-mount in /media/pi
Does the vncserver solution still work? I have a fresh Buster (desktop version) Pi4, which boots into CLI and when I run then it didn't seem to automount. Apologies if my noobishness is causing me not to understand. Is there some kind of vncserver setting I need to change
I am running Buster full version, but edited to boot into CLI auto-logged in and I also changed the resolution to a specific figure as recommended by this post. However, the pi is not auto-mounting USB drives. I also changed the video output to analog, tried other resolutions, and enabled VNC all within raspi-config, but no effect.
Thanks
Code: Select all
vncserver
I am running Buster full version, but edited
Code: Select all
sudo raspi-config
Thanks