Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
If you're sticjking with the sdcard, 'noatime' would be better than 'relatime.' Atime writes every 5 seconds; relatime writes every 15 seconds; noatime is best.
i think you should delete your custom udev rules and stick with the shell script, and the advice given in post #2.
or, you should reformulate your problem from scratch.
here's a simple rule:
you never say "it doesn't work" without providing full disclosure about commands issued, output received (errors or not), general system information etc.
When I now put the sd_card in the beaglebone, the folder are created, when I remove the sdcard, it will be delete.
Now I want to mount over with the sh.script the sdcard. When I put the sdcard in the beaglebone, I get in the syslog:
Code:
Aug 20 10:35:23 foxc0a800bd kernel: [320476.390036] mmc0: host does not support reading read-only switch, assuming write-enable
Aug 20 10:35:23 c0a800bd kernel: [320476.395067] mmc0: new high speed SDHC card at address 0007
Aug 20 10:35:23 c0a800bd kernel: [320476.411492] mmcblk0: mmc0:0007 SD16G 14.4 GiB
Aug 20 10:35:23 c0a800bd kernel: [320476.419344] mmcblk0: p1
but the folder in /media/card is empty
When I run after in den commandline:
/bin/mount /dev/mmcblk0p1 /media/card/
I see now in the syslog:
Aug 20 10:53:49 c0a800bd systemd-udevd[20525]: Process '/home/domo/sdcard_insertion.sh' failed with exit code 32.
Aug 20 10:53:53 c0a800bd systemd-udevd[20525]: Process '/home/domo/sdcard_insertion.sh' failed with exit code 32.
Aug 20 10:53:56 c0a800bd systemd-udevd[20525]: Process '/home/domo/sdcard_insertion.sh' failed with exit code 32.
Error 32 means:
mount failure
Same when I remove the sdcard:
Aug 20 10:56:45 c0a800bd kernel: [321758.605831] mmc0: card 0007 removed
Aug 20 10:56:45 c0a800bd kernel: [321758.716607] FAT-fs (mmcblk0p1): FAT read failed (blocknr 802)
Aug 20 10:56:45 c0a800bd kernel: [321758.730084] FAT-fs (mmcblk0p1): unable to read boot sector to mark fs as dirty
Aug 20 10:56:45 c0a800bd systemd-udevd[20666]: Process '/bin/sh /home/domo/sdcard_removed.sh' failed with exit code 32.
Aug 20 10:56:45 c0a800bd systemd-udevd[20671]: Process '/bin/sh /home/domo/sdcard_removed.sh' failed with exit code 32.
Aug 20 10:56:45 c0a800bd systemd-udevd[20666]: Process '/bin/sh /home/domo/sdcard_removed.sh' failed with exit code 32.
But why 3-times?
Here the new scripts:
cat sdcard_insertion.sh
#! /bin/sh
Aug 21 06:48:48 foxc0a800bd kernel: [ 332.849825] mmc0: host does not support reading read-only switch, assuming write-enable
Aug 21 06:48:48 foxc0a800bd kernel: [ 332.855045] mmc0: new high speed SDHC card at address 0007
Aug 21 06:48:48 foxc0a800bd kernel: [ 332.871791] mmcblk0: mmc0:0007 SD16G 14.4 GiB
dmesg
Code:
[ 332.849825] mmc0: host does not support reading read-only switch, assuming write-enable
[ 332.855045] mmc0: new high speed SDHC card at address 0007
[ 332.871791] mmcblk0: mmc0:0007 SD16G 14.4 GiB
[ 332.879312] mmcblk0: p1
tail -f /var/log/syslog
Code:
Aug 21 06:48:48 c0a800bd kernel: [ 332.849825] mmc0: host does not support reading read-only switch, assuming write-enable
Aug 21 06:48:48 c0a800bd rsyslogd-2007: action 'action 17' suspended, next retry is Mon Aug 21 06:49:18 2017 [try http://www.rsyslog.com/e/2007 ]
Aug 21 06:48:48 c0a800bd kernel: [ 332.855045] mmc0: new high speed SDHC card at address 0007
Aug 21 06:48:48 c0a800bd kernel: [ 332.871791] mmcblk0: mmc0:0007 SD16G 14.4 GiB
Aug 21 06:48:48 c0a800bd kernel: [ 332.879312] mmcblk0: p1
Aug 21 06:48:52 c0a800bd systemd-udevd[5459]: Process '/bin/sh /home/domo/sdcard_insertion.sh' failed with exit code 32.
Aug 21 06:48:55 c0a800bd systemd-udevd[5459]: Process '/bin/sh /home/domo/sdcard_insertion.sh' failed with exit code 32.
Can we try a workaround? With the offending card out,
Code:
cd /dev
sudo ln - sf mmcblk0p1 mmc0
If that works, it's a gift, but I don't really expect it to. I did a basic grep in the kernel source, and mmc0 appears to be handed out by the kernel, and not udev, and seems to be part of various sdcard controllers and GPIO (General Purpose Input Output) stuff, as sdcards are not read by a bus. GPIO stuff is old, slow & clunky, implemented these days in a small corner of some asic. HP used to have a GPIO bus on their instruments to automate them (in the days before widespread automation), but nobody in their right mind outside of a factory environment ever used it :-/. I'm actually surprised to find it still alive.
brw-rw---- 1 root disk 179, 24 Aug 21 18:58 /dev/mmcblk0
brw-rw---- 1 root disk 179, 25 Aug 21 18:58 /dev/mmcblk0p1
brw-rw---- 1 root disk 179, 0 Aug 21 13:36 /dev/mmcblk1
brw-rw---- 1 root disk 179, 8 Aug 21 13:36 /dev/mmcblk1boot0
brw-rw---- 1 root disk 179, 16 Aug 21 13:37 /dev/mmcblk1boot1
brw-rw---- 1 root disk 179, 1 Aug 21 13:37 /dev/mmcblk1p1
without sdcard:
Code:
brw-rw---- 1 root disk 179, 0 Aug 21 13:36 /dev/mmcblk1
brw-rw---- 1 root disk 179, 8 Aug 21 13:36 /dev/mmcblk1boot0
brw-rw---- 1 root disk 179, 16 Aug 21 13:37 /dev/mmcblk1boot1
brw-rw---- 1 root disk 179, 1 Aug 21 13:37 /dev/mmcblk1p1
No mmc0? But it was there previously, and screwed things up.
I THINK what's going on is that mmc0 is some bit of the sdcard apparatus, which is mistaken by the kernel for the actual sdcard. Then the card is seen on mmc0, not mmcblk0. If that's right, you might solve it with one of the following bodges:
1. Put mmc0 in /etc/fstab with a 'noauto' option, (before mmcblk0p1) so it will not be mounted.
2. Copy the fstab line for mmcblk0p1, except make mmc0 the device node. This line should go after mmcblk0p1. Both should not exist at the same time. Scripts will have to be changed to use the mount directory instead of the device node.
For your script in post #1, you would have something like
Otherwise, I'd look into whether you could cobble a kernel without mmc0. Distro kernels are inclined to have everything but the kitchen sink in them, but you mightn't need the offending stuff. What is /dev/mmcblk1 in your box?
forum site's accounts .research involves looking at not just one source/website but lots of sources and websites/videos to gather as much information as you can then come to a conclusion ahhaha [racism+personal attack].come at me i dare you-[WWII era racism, also seen earlier]
Note: Post very much edited by mod to remove harshest words and directed attacks against a member. It should seem clear that the OP here chose to go on the extreme offensive with the slightest provocation and this type of behavior is not acceptable within LQ ever.
No mmc0? But it was there previously, and screwed things up.
I THINK what's going on is that mmc0 is some bit of the sdcard apparatus, which is mistaken by the kernel for the actual sdcard. Then the card is seen on mmc0, not mmcblk0. If that's right, you might solve it with one of the following bodges:
1. Put mmc0 in /etc/fstab with a 'noauto' option, (before mmcblk0p1) so it will not be mounted.
2. Copy the fstab line for mmcblk0p1, except make mmc0 the device node. This line should go after mmcblk0p1. Both should not exist at the same time. Scripts will have to be changed to use the mount directory instead of the device node.
For your script in post #1, you would have something like
Otherwise, I'd look into whether you could cobble a kernel without mmc0. Distro kernels are inclined to have everything but the kitchen sink in them, but you mightn't need the offending stuff. What is /dev/mmcblk1 in your box?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.