The entire reason the word "squash" is in "squashfs" is because it is a compressed file system.
It's a bit of a "cute" word for compressed.
The entire reason the word "squash" is in "squashfs" is because it is a compressed file system.
It's a bit of a "cute" word for compressed.
Last edited by Slim Odds; January 4th, 2011 at 10:46 PM.
24 beers in a case, 24 hours in a day. Coincidence? I think not!
Trusty Tahr 64 bit, AMD Phenom II 955 Quad Core 3.2GHz, GeForce 9600 GT
16G PC2-6400 RAM, 128 GB SSD, Twin 1TB SATA 7200 RPM RAID0
On reading this thread (I haven't done it dispite having adequate ram specs) I wondered if it would be possible to sync/mirror the ram drive (rdd) to a copy of your squashfs via rsync.
In my mind:
squashfs > rdd ... rsync (rdd > hdd) | [cron job] +5m
on synaptic/apt-get/whatever/, data is written to rdd then
rsync approprate dirs for changes. Would this cause problems?
If I understand you correctly, you're wondering if it's possible to run a cron job, say every 5 min, to rsync the RAM session you're in to the squashfs image.
In theory, it should be. There are a few problems that need to be overcome in order to make this happen however:
Since the filesystem.squashfs file is a readonly file and cannot be modified, the cronjob would have to rsync the RAM Session to the /var/squashfs folder from which the filesystem.squashfs image is created. This means the squashfs image would need to be recreated from /var/squashfs before the image could be usable (before the updates rsync has produced can be available). This poses a different problem:
Recreating the squashfs image using mksquashfs every 5 minutes would use up a significant amount of processing power. This would unnecessarily slow down the RAM Session because the CPU would always be busy. I say "unnecessarily" because most of that processing power would go towards creating images that would NOT be used - only the last image created before you reboot would be used. This means running mksquashfs every time you rsync would be impractical.
What that means is that the user will have to either run a command or a script just before he reboots that will run mksquashfs for him, in order to recreate the squashfs image and make the updates copied over by rsync available next time he reboots. That also means that it would take the user several minutes to reboot his computer. He could of course opt out of running mksquashfs during the reboot, and the /var/squashfs folder would remain updated, but that would mean the filesystem.squashfs file would not be. This would result in the user booting into an older, un-updated version of the RAM session. From there, the user can run the mksquashfs command and reboot again to boot from the new image, but the problem then becomes: if crontab updates an already updated /var/squashfs automatically it will override any updates that /var/squashfs may have had.
In order to solve this problem, the script can force a mksquashfs command to run upon reboot or shutdown. The unfortunate side-effect of this would be that the user will be unable to use his computer while the script is running as I imagine the script would run at a stage in the shutdown process that would make the desktop, and other applications (such as firefox) unavailable to him. This would cause the user to have no choice but to stare at the screen as mksquashfs does its thing, or go for a walk.
The entire problem could be avoided if you could write directly to the read-only filesystem.squashfs image, and from what I've read, this could be possible if you combine the image with a union mount filesystem such as UnionFS or aufs, but I know far too little about either to know if this is something that could be done.
I have this very same problem.
I already have a home partition.
When i try to uninstall it says it has uninstalled but upon restarting the script it just tells me i need to uninstall. the only way to fix this is to manualy delete Original_OS.
here is what my terminal spits out if it helps.
Code:1) Launch gparted (it will be installed if necessary) 2) Enter device name to use for /home 3) Exit script -ne Your choice: 2 -e You have chosen to enter the device name to use for /home -e Please enter the device name of the partition you wish to use for /home. This should be something like /dev/hda2 or similar. Please be certain about your choice as any data on the partition you choose will be deleted permanently! Your choice: read: 1235: Illegal option -e RAM_booster.sh: 1235: [[: not found RAM_booster.sh: 1235: [[: not found -e Running file check on your device... RAM_booster.sh: 1235: [[: not found RAM_booster.sh: 1235: [[: not found RAM_booster.sh: 1235: [[: not found Everything checks out. -e Formatting
I have this very same problem.
I already have a home partition.
When i try to uninstall it says it has uninstalled but upon restarting the script it just tells me i need to uninstall. the only way to fix this is to manualy delete Original_OS.
here is what my terminal spits out if it helps.
Code:1) Launch gparted (it will be installed if necessary) 2) Enter device name to use for /home 3) Exit script -ne Your choice: 2 -e You have chosen to enter the device name to use for /home -e Please enter the device name of the partition you wish to use for /home. This should be something like /dev/hda2 or similar. Please be certain about your choice as any data on the partition you choose will be deleted permanently! Your choice: read: 1235: Illegal option -e RAM_booster.sh: 1235: [[: not found RAM_booster.sh: 1235: [[: not found -e Running file check on your device... RAM_booster.sh: 1235: [[: not found RAM_booster.sh: 1235: [[: not found RAM_booster.sh: 1235: [[: not found Everything checks out. -e Formatting
sorry double post
Last edited by joesnose; January 15th, 2011 at 09:31 PM.
I have this very same problem.
I already have a home partition.
When i try to uninstall it says it has uninstalled but upon restarting the script it just tells me i need to uninstall. the only way to fix this is to manualy delete Original_OS.
here is what my terminal spits out if it helps.
Code:1) Launch gparted (it will be installed if necessary) 2) Enter device name to use for /home 3) Exit script -ne Your choice: 2 -e You have chosen to enter the device name to use for /home -e Please enter the device name of the partition you wish to use for /home. This should be something like /dev/hda2 or similar. Please be certain about your choice as any data on the partition you choose will be deleted permanently! Your choice: read: 1235: Illegal option -e RAM_booster.sh: 1235: [[: not found RAM_booster.sh: 1235: [[: not found -e Running file check on your device... RAM_booster.sh: 1235: [[: not found RAM_booster.sh: 1235: [[: not found RAM_booster.sh: 1235: [[: not found Everything checks out. -e Formatting
The only reason '[[' would not be found (as in the line "RAM_booster.sh: 1235: [[: not found") that I can think of (and the simplest explanation) is that you're forcing the script to run in /bin/sh rather than /bin/bash because /bin/sh has no idea what '[[' is. This script will NOT work in /bin/sh. Try again by making it executable with:
and running it with:Code:sudo chmod a+x ./RAM_booster.sh
Code:./RAM_booster.sh
Thanks Terminator, that solved all my problems, both uninstalling and installing.
thanks for the great script.
Bookmarks