Tiny Core Linux
Tiny Core Base => Raspberry Pi => Topic started by: boudinec on February 28, 2017, 09:52:21 AM
-
Hello
I am using some Rasperry Pi running piCore in such conditions that the power supply can be turned-off without being able to call poweroff or shutdown before.
I know this is a bad idea with raspbian, but is it dangerous to do this with piCore? Is there any risk to damage the SD card?
Regards
Cedric
-
If you do not need to backup anything, then yes, it is safe to unplug the power cable.
If you have a persistent directory (/home, /opt) on the USB or SD card, then no, it might damage your card.
-
Thanks for the answer.
I have some scripts running that are packaged in tcz files thus I never mount /home or /opt.
Mount gives me the following :
tmpfs on / type tmpfs (rw,relatime,size=400520k)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,mode=600,ptmxmode=000)
tmpfs on /dev/shm type tmpfs (rw,relatime)
/dev/mmcblk0p2 on /mnt/mmcblk0p2 type ext4 (rw,relatime,data=ordered)
/mnt/mmcblk0p2/tce/optional/mc.tcz on /tmp/tcloop/mc type squashfs (ro,relatime)
...
/mnt/mmcblk0p2/tce/optional/libgpg-error.tcz on /tmp/tcloop/libgpg-error type squashfs (ro,relatime)
Is it safe even if some partitions are mounted in rw mode (/mnt/mmcblk0p2 for instance).
-
The card should be unmounted, load the extensions to RAM.
-
The card should be unmounted, load the extensions to RAM.
Is there any way to configure piCore to do this automatically ?
As long as there are no write access to /mnt/mmcblk0p2, could it be mounted in ro mode at starup? And then pass from rw to ro (and vice-versa) when needed?
-
Is there any way to configure piCore to do this automatically ?
As long as there are no write access to /mnt/mmcblk0p2, could it be mounted in ro mode at starup? And then pass from rw to ro (and vice-versa) when needed?
Create a file copy2fs.flg in /mnt/mmcblk0p2/tce If it exists extensions will be copied to RAM and mmcblk0p2 unmounted. Content of file is not important, it can be zero length.
If you are not using the partition, better to unmount.
-
Mounting read-only can still corrupt some SD cards.
-
Create a file copy2fs.flg in /mnt/mmcblk0p2/tce If it exists extensions will be copied to RAM and mmcblk0p2 unmounted. Content of file is not important, it can be zero length.
If you are not using the partition, better to unmount.
Thanks. I'll try this.
If in any case I want install some packages with tce: sould I just manually mount and unmount mmcblk0p2 or will it be automatic ?
Mounting read-only can still corrupt some SD cards.
I done a couple of internet searches on a subject and my idea is not very about this subject. Do you have some interesting links to about this?
Thanks again for the help
Cedric
-
If in any case I want install some packages with tce: sould I just manually mount and unmount mmcblk0p2 or will it be automatic ?
It will not be automatic, you will need to mount the partition with your tce folder on, load the required extensions (with the copy2fs flag set) and then umount the partition.
-
Hi boudinec
If in any case I want install some packages with tce: sould I just manually mount and unmount mmcblk0p2 or will it be automatic ?
If those packages are the packaged scripts you referred to above you can add the package names to tce/onboot,lst. Then
they will load automatically when you boot.
-
Create a file copy2fs.flg in /mnt/mmcblk0p2/tce If it exists extensions will be copied to RAM and mmcblk0p2 unmounted. Content of file is not important, it can be zero length.
I created /mnt/mmcblk0p2/tce/copy2fs.flg.
When I boot, mount gives me:
tmpfs on / type tmpfs (rw,relatime,size=400516k)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,mode=600,ptmxmode=000)
tmpfs on /dev/shm type tmpfs (rw,relatime)
/dev/mmcblk0p2 on /mnt/mmcblk0p2 type ext4 (rw,relatime,data=ordered)
So /mnt/mmcblk0p2 is still mounted, so I added at the end of /opt/bootlocal.sh:
umount /mnt/mmcblk0p2
Is there any risk of conflct with something else?
-
Hi boudinec
If in any case I want install some packages with tce: sould I just manually mount and unmount mmcblk0p2 or will it be automatic ?
If those packages are the packaged scripts you referred to above you can add the package names to tce/onboot,lst. Then
they will load automatically when you boot.
This is what I actually do, my scripts are in a tcz referenced in onboot.lst as well as its dependencies.
Theoretically, I do not need to install more packages. But, this is theory, I can need to install some package for maintenance purpose: so I will manually handle the mmc mounting.
-
No conflict unless you have scripts that expect it to be mounted.
-
Great
Thanks a lot for the help
-
hi boudinec,
We are using piCore for piCorePlayer with hundreds of users, many just pull the power to turn the player off. They have been doing this for 3 or 4 years and to-date we haven't had complaints about corrupted SD cards. I haven't seen one personally. After the initial setup we don't write to the SD card.
We use the standard setup with /opt and /home in RAM and haven't found it necessary to copy to RAM or unmount mmcblk0p2, though technically is the right thing to do.
So the standard setup has proven extremely reliable.
The other thing, if you somehow manage to corrupt the SD card, the image is so small it takes very little time to burn a new one, in our case less than 10 seconds. This is a feature that should be shouted from the roof tops.
regards
Greg
-
hi boudinec,
We are using piCore for piCorePlayer with hundreds of users, many just pull the power to turn the player off. They have been doing this for 3 or 4 years and to-date we haven't had complaints about corrupted SD cards. I haven't seen one personally. After the initial setup we don't write to the SD card.
We use the standard setup with /opt and /home in RAM and haven't found it necessary to copy to RAM or unmount mmcblk0p2, though technically is the right thing to do.
So the standard setup has proven extremely reliable.
The other thing, if you somehow manage to corrupt the SD card, the image is so small it takes very little time to burn a new one, in our case less than 10 seconds. This is a feature that should be shouted from the roof tops.
regards
Greg
Hi Greg.
Thanks for the info, this is a good thing to know.
My concern is not about the time it takes to create a new sd card but more about the reliability and the physical access : one of my RPi is used for local control of some equipment and is bundled inside of it. So its access is a bit annoying.
Regards
-
access is a bit annoying.
Perhaps an 'SD card Extension Cable' could `fix` that ?