Refracta Development, Scripts, etc.
Post a reply

Thoughts on using a persistant folder.

Wed Apr 02, 2014 9:30 pm

A partition with a persistence folder /live-rw , so persistence could be a partition, an image file, or a folder.

And if the Live O.S. partition had the /live-rw folder, then all of it could be quickly fsck early in the boot.
If the partition were about 2 to 4 GB in size then lots of room for apps, and the fsck would not take long.

I noticed Debian Live does not do a fsck ( I think...), but Porteus and a few other do.
A complete fsck would be boot, O.S., and persistence partitions, and the persistence image file too.
So between 1 to 4 fsck at boot, controlled by a simple boot counter.

# Does Refracta do any of this.?
.

Re: Thoughts on using a persistant folder.

Thu Apr 03, 2014 12:20 am

No, refracta does not do fsck. You can run one manually on the persistent partition if you boot without persistence, so that the partition is not mounted. There's no need to do it to the operating system, because none of those files can change.

Have you used a folder for persistence? Someone asked about that yesterday, and nobody here has ever tried it. I know that either a partition or a file can be used, but I don't think a folder/directory will work.

If you want to be able to write to the live media while you're running the live system, you can set that up with refracta2usb. Run patch-initrd from the advanced menu. It will create a new initrd and make the appropriate boot menu entry. Then you'll be able to mess with the files in the partition that holds the OS, but you won't be able to do anything with the OS itself. Only the files you would see on a live-CD if you mounted it in a running system are available. The OS files are inside filesystem.squashfs, and you can't change those without unsquashing that file, make the changes and then squash it again.

Re: Thoughts on using a persistant folder.

Thu Apr 03, 2014 5:43 pm

Thanks fsmithred; I have never made an O.S. CD, I always mount and copy to HD or USB and set boot.
fscks our main used partitions of course, so it does not matter what`s on them, they just need fsck before mount.
For most setups there will be only one partition to fsck as the O.S. and persistence file are on the boot partition.
Having a persistence file means there`s another fs that needs checking, increasing the time required to do it.
It kinda like booting an iso file, sure it`s neat and convenient, but fewer mounts is faster, secure, and reliable.

A save folder will work of course as any union just layers directories, it does not matter if they`re a mount point.
Porteus for sure, and Slax I think both can use a folder.
As I say, if the common setup is O.S. and persistence on one partition that`s about 2 to 4 GB, then fsck is quick.
Even having a few O.S.s on one partition will only be about 10 GB, so the fsck will still be reasonably fast.
.

Re: Thoughts on using a persistant folder.

Thu Apr 03, 2014 7:29 pm

I don't know how debian-live turns off fsck. Figure out that, and you can make a new iso that allows fsck to run at boot. Or else run fsck from another drive or partition. You really want it to run every time you boot? I generally set mine to run every 50 boots or so. I think the default setting is around 30.

Re: Thoughts on using a persistant folder.

Fri Apr 04, 2014 10:33 am

Quote from "man live-boot":
persistence
live-boot will probe devices for persistence media. These can be
partitions (with the correct GPT name), filesystems (with the cor‐
rect label) or image files (with the correct file name). Overlays
are labeled/named "persistence" (see persistence.conf(5)). Overlay
image files have extensions which determines their filesystem, e.g.
"persistence.ext4".

I don't see "directories" mentioned. Whether or not you can use directories for unionfs in other applications is another matter.

If you want to start hacking ramdisks and live-boot code (because that's where the mounts are done, after which you can't fsck) maybe forcing automatic fsck is possible.. but why, when (only occasional) manual maintenance is enough? .

Re: Thoughts on using a persistant folder.

Thu Apr 10, 2014 8:38 pm

Sorry about the delayed response guys, and thanks for the feedback.

fsmithred; I`ve booted Debian Live well over 100 times and I`ve never seen it do a fsck yet.
But maybe I missed it...

dzz; All mounts are directories ( union or not ), and a union`s mount point is a directory also.
If they are normal directories or mount points does not matter, both appear as populated directories.
But maybe you were referring to something else.?

Re: Thoughts on using a persistant folder.

Fri Apr 11, 2014 1:06 am

I was talking about my installed system. I've never seen fsck run in a live session, either.

Mount points are directories, but what you mount to them are filesystems. I just tried to mount a directory to see what would happen, and I got a "not a block device" message.

Re: Thoughts on using a persistant folder.

Fri Apr 11, 2014 1:32 am

maybe you were referring to something else.?

Yes. The way "persistence" works in debian-live (live-boot) at initramfs level. It requires a dedicated filesystem which can be mounted with write access.

Re: Thoughts on using a persistant folder.

Sat Apr 12, 2014 7:33 am

Ahhh... It may be so that debian-live is limited in how it can deal with unions.

Ultimately it`s a dir. that`s unioned, regardless if something is mounted on that dir. or not.
True you can`t mount a dir., but you can bind mount it. Which is kinda what a union mount does.


In fact if bind mount could merge 2 dirs into one, it could act like a poorboy`s union.

Or... If there was a transparent mount option: mount -t ext2 -o transparent /dev/sda3 /
Instead of covering up preexisting mounts like a stack, it would allow them to show through.

Kinda like the junction link I proposed that utilizes a full path in place of just a single path.
A link can hold a path, but Linux file systems don`t support it. Do: ln -s /bin:/sbin jct
You can see the link "jct" holds the path, but it`s a dead link as it`s not recognized as usable.
This would allow individual files and dirs. to have a search path, acting somewhat like a union.
.

Re: Thoughts on using a persistant folder.

Sun Apr 13, 2014 6:21 am

A partition with a persistence folder /live-rw , so persistence could be a partition, an image file, or a folder.
To accommodate users booting from unetbootin etc FAT32 pendrive, the persistence data really needs to be contained within
a savefile -- cpio archive or squashfs or ??? -- then extracted to, then mounted from, a dir.

Porteus3.0 supports this, in an awkward manner. To setup savefile handling, user must edit config + boot line...
...and, in my testing, Porteus puked when I attempted on-demand (vs at shutdown) savefile update.

Ahhh... It may be so that debian-live is limited in how it can deal with unions.

Reading that as "perhaps debian-live is limited in regard to how it can handle..."

overlayfs is not available in debian. Functionality of debian-live scripts is limited to what can be achieved using unionfs, plus aufs

In fact if bind mount could merge 2 dirs into one, it could act like a poorboy`s union.

Or... If there was a transparent mount option: mount -t ext2 -o transparent /dev/sda3 /
Instead of covering up preexisting mounts like a stack, it would allow them to show through.
sounds like you're describing unionfs-fuse :
http://linux.die.net/man/8/unionfs-fuse
Post a reply