-   Linux - Hardware (
-   -   Need some assistance with Knoppix USB stick issue (

babypeng 03-15-2013 02:50 AM

Need some assistance with Knoppix USB stick issue
Hello All,

I ran into a problem with Knoppix 7.0.4 .

I installed Knoppix 7 on my Sandisk Cruser Blade 32GB memory stick, using unetbootin. I made the memory stick bootable and I booted from it with no problem. I also created an encrypted persistent file (.aes). Knoppix sees it on boot, I enter the password, and it works.

Few days ago it stopped working. Knoppix hangs at the boot process, at the stage were it says "entering runlevel 5", and nothing happens. After searching for solutions and trying whatever I could find on the internet, I gave up and reinstalled Knoppix, and only then I realized that the problem is not with the Knoppix installation, but with the persistent file.

So I booted without using the persistent file, and Knoppix booted fine. I then managed to manually mount the persistent .aes file and navigate within its content. I installed many programs in this persistent file and I wanted to copy whatever is left in it, in order to save the work of recreating whatever was in there. But I am not able to copy it's content. On every trial it gives a different excuse why it can't copy. One time it's because of small volume in the destination partition, and another time it's because of denied permissions (even though I am sudo).

I have reached the point where I am willing to get any suggestion.

I used Puppy in the past, and puppy actually tells the user when it is writing data to the partition. I switched to Knoppix because I could not configure Puppy to create an encrypted persistent file.

Knoppix doesn't tell the user when it is writing data to the partition. It didn't say anything about saving data even when I added the "toram" cheat code.

I know Knoppix can run from a CD and it can save data to a persistent file on the HD, but is it designed NOT to constantly write data to the partition ?
If not, then it will quickly reach the flash memory write limit.

Could it be that I ruined my memory stick because Knoppix constantly writes to it ?

I appreciate any help with this issue.


Jebram 03-16-2013 05:11 AM

Several issues with Knoppix persistent overlay fs, file copy...
Hello babypeng

Answering Your questions is not really easy. Your descriptions
lack detail (Lots of guessing needed to formulate answers) and Your questions are very open-ended. I would suggest to improve Your request for help. You should at the very least provide/quote some of the commands You used (to mount the persistent file system, to mount the copy destination file system, an example of the commands used to backup/copy files to the destination etc.)
You might consider using Knoppix 7.0.5 (or newer). The "flash-knoppix2" installer in 7.0.5 allows creation of a "reiserfs" partition to be used as a writeable yet persistent overlay file system, optionally encrypted with AES. This lifts the 4 GB limit on persistent overlay file system, because such a reiserfs file system is a regular partion on the flash storage, no longer a big file on a FAT32 partition mounted as another file system via loop device and thus incurring limits imposed by access via vfat fs drivers. This would enable You to use a lot more space on Your 32 GB flash storage device for Linux files.

I hope this helps.

babypeng 03-17-2013 04:58 AM

I mounted the .aes file with the commands:
sudo losetup -e aes /dev/loop3 /mnt-system/KNOPPIX/aes-filename.aes
sudo mount -t ext2 /dev/loop3 /media/aes -o loop

And I am able to view its content, so I know the mounting procedure is fine.

One I am in the .aes file I typed the command:
sudo cp -r * /destination/folder

and the results were either "prmission denied" or if something was copied, then it would freeze
somewhere along the process.

FAT (16) limit is 2GB and FAT32 limit is 4GB. I don't get to these limits.
The size I am trying to copy is few hundreds MB .

I don't remember why I didn't use 7.0.5 . Maybe it was not available when I installed it,
or maybe 7.0.5 was not a stable release when I was doing the installation.

But what about the way Knoppix writes to the H.D. / flash disk ?
With Puppy it is clear, the user clicks on the "Save" icon, and the changes are also saved during
shutdown. But when is the data saved on Knoppix ? There is no "Save" button.
Can you please direct me to a link that explains this process ?

Thank you for any assistance.


Jebram 03-17-2013 09:54 AM

Recovering files from Your encrypted overlay file sytem
In order to avoid the "permission denied" errors, try these steps:

cd /destination
rm -rf folder # If this fails.. Is destination fs mounted readonly?
# Ownership and permissions of destination folder?
mkdir -p /destination/folder # Recreate owned by current user
chmod ug+rwx /destination/folder # Enable read, write and cd for user.
cd /media/aes/sourcedir # If the above did all succeed...
# Then this should not give a permission error:
sudo -u root cp -r * /destination/folder/

If any of this still gives You errors, please give the full
error message and the full command (so we can aid in diagnosing this.)

If your destination folder lives on a Non-Unix file system, then
You might try a "tar" archive for keeping your file copies stored with
their original permissions.

If you are getting stuck or getting I/O errors from the "cp" command,
then Your ".aes" partition image file might be partially unreadable.
Unmount it and try to make a copy of it with the dd_rescue command, then mount that copy.
If dd_rescue found errors, then some data might be lost - In this case, repair the copied file system using "fsck", then mount the copied partition image and retry the "cp" from there. The copy should now finish (But some data might be broken).

The reason You cannot find a "Save button" in Knoppix is that none is needed. Changes to the system (like echo 'my data' >/home/knoppix/my_file or sudo apt-get install dd_rescue) are stored directly in the overlay file system (if one is mounted and persistent) - Search "aufs" in the manpage for mount(1) for more on this. Also consult the Knoppix Wiki hints about installs with persistence and the forums.

babypeng 05-04-2013 07:48 AM

Hi Again,

So, here is what I did:

I looked again at the file and I realized I made a mistake.
My Knoppix encrypted (.aes) persistent file is not few hundreds MB in size, but it is 6.4 GB,
and it resides on an NTFS partition on my uSB stick, which is mounted to Knoppix.
The Knoppix installation resides on an ext3 partition on the same USB stick.

I copied the persistent .aes file to an ext4 partition on a HDD, and I was able to
configure it as a loop device (with "losetup") and mount it to Knoppix.

I then unmounted it and detached it (with "losetup"), and changed its name in order for Knoppix to ignore it, so I could create
another, non encrypted persistent file (.img), and I was able to mount it too.

I wanted to copy the content of the .aes file into the .img file, but I couldn't do it because
Knoppix is automatically openning the .img file on boot. I tried to open it on my Ubuntu HDD installation but I quickly found that
"losetup" on Ubuntu is different than "losetup" on Knoppix and considering my limited Linux knowledge it was just faster for me
to do it all on Knoppix.
From within Ubuntu I changed the name of the .img persistent file, so Knoppix will not see it, and will not open it during boot.
I then booted to Knoppix and was able to open both files, the .aes, and the .img, and I was able to copy the content of the .aes into the .img .

I then changed the .img file name back to "knoppix-data.img", and Knoppix identified it during boot and opened it.
I now have all my saved Knoppix configurations.
This could have been a perfect solution to my problem, but it's not.

When I boot Knoppix with my newly restored .img persistent file the LXDE system tray is gone ! vanished !
After lengthy search on the internet I found that LXDE system tray is called "lxpanel",
and I was able to revive it with the following set of commands:

sudo killall lxpanel
sudo nohup lxpanel

So now I can survive with the Knoppix while I search for a solution for this problem.
lxpanel still does not survice a reboot.
Anybody have any idea ?
Thank you in advance.


jefro 05-04-2013 03:43 PM

Knoppix was the KING of live cd's at one time. He didn't ever intend on making them permanent. After a decade of complaints he did some work on how to install them but I doubt they are very fully tested.

"Anybody have any idea ?"

It all seems to revolve around this casper filesystem. Stop using it.

Be sure to make backups of important data.

Don't trust flash drives.

Install a proper linux distro natively instead of a live over persistence.

babypeng 05-04-2013 04:21 PM

Thank you jefro,

I am doing it for the purpose of learning Linux,
and also, it is very usefull to take my opeating system with me
just like I take my data with me.

Do you happen to know how Knoppix write to a flash drive ?
With puppy it is done manually, so it will never get to the flash drive write cycles limit.
But how is it done with Knoppix ?
Is it mechanized ? automatic ? what's the algorithm ?
because it can very quickly reach the flash drive haedware limit.

Thanks for your assistance.


jefro 05-04-2013 10:01 PM

Puppy and Knoppix are one of a kind distro's unlike others.

The only thing I usually do is to not install swap. I kind of think the flash will be damaged from being in your pocket rather than write. Not sure I have had one fail because of write number. Guess it could happen.

Almost every modern distro made today can be installed to a flash drive. To the distro's point of view, the usb is just another hard drive. Notice it is called /dev/sdx. In puppy you would still see the old hdx reference.

All times are GMT -5. The time now is 08:56 PM.