Hi all,
I recently installed CentOS 7 on my Raspberry Pi because I was not happy with the raspbian based systems I tried so far.
My problem now is pretty basic I think:
I want the system to automatically mount an external drive, as soon as it is plugged in
and
to mount them if they are plugged in while booting
Although I think this should not be that hard a task, I was not able to find a solution after a weekend of research.
What I don't want is:
- mounting every drive manually every time I want to access it
- having to maintain /etc/fstab - I want the system to be flexible: plug-in, browse, pull-out
- having to maintain config-files like autofs - I want to be able to plug in any drive and not only the ones I pre-configured
- having to install any GUI - system should stay as slim as possible
Somehow I can't believe that this should be so impossible. It does work with e.g. GNOME so there should be a way to do it without any GUI, shouldn't there?!
Thank you for your input and replys!
USB drive hotplug
-
- Posts: 10642
- Joined: 2005/08/05 15:19:54
- Location: Northern Illinois, USA
Re: USB drive hotplug
You do NOT want to pull a mounted drive.
You don't do that even with GNOME.
You don't do that even with GNOME.
Re: USB drive hotplug
Yes, you are of course right.gerald_clark wrote:You do NOT want to pull a mounted drive.
You don't do that even with GNOME.
Re: USB drive hotplug
I started writing something for this but then I got bored
the hotplug part is fairly easy with centos7, you should look into "systemctl --switch-root", if you temporarily put your system in rescue mode and switch root to your usb you will just run off of it and it will simply pivot your root to that new partition rather seamlessly (I had to do that because I started compiling stuff on the microsd without realizing it and decided to switch to an external usb drive)
anyway you cannot start the pi without its own uboot or a modified one. The problem is that in theory what you should do is create 2 partitions on the microsd, one containing your txt files and uboot bins, and another one with a fairly simple initrd that will do the process listed above. Because even with kernel 4.10 the pi doesn't see my usb drive from when the boot is still in the kernel's bony hands.
the hotplug part is fairly easy with centos7, you should look into "systemctl --switch-root", if you temporarily put your system in rescue mode and switch root to your usb you will just run off of it and it will simply pivot your root to that new partition rather seamlessly (I had to do that because I started compiling stuff on the microsd without realizing it and decided to switch to an external usb drive)
anyway you cannot start the pi without its own uboot or a modified one. The problem is that in theory what you should do is create 2 partitions on the microsd, one containing your txt files and uboot bins, and another one with a fairly simple initrd that will do the process listed above. Because even with kernel 4.10 the pi doesn't see my usb drive from when the boot is still in the kernel's bony hands.
Re: USB drive hotplug
He's not asking how to switch root to it, he just wants to mount it.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke