PDA

View Full Version : how to mount .aes persistent file



nopics
12-15-2012, 11:30 AM
Hello All,

I am new to Linux and to Knoppix.

I installed Knoppix 7.0.4 on my usb stick (ext3), and I also created
a .img persistent file which is not encrypted.
I worked on it for few days, installed some stuff here and there, and life were good.
I later realized I want to create an encrypted .aes persistent file,
so I moved the knoppix-data.img file to another partition on my usb stick,
I changed its name to "nocrypt-persist.img", and I restarted Knoppix (booted from the usb stick).
Sure enough I got the option to create a new persistent file and I created
a .aes file which is named knoppix-data.aes and is located in the KNOPPIX folder.

I now want to transfer all the saved configurations form the old .img file
to the new .aes file .

I booted my Ubuntu laptop and connected my usb stick, with the intention
to mount the .img file and the .aes file, and transfer data between them.

The .img file was mounted with the command:
sudo mount /media/sdb1/nocrypt-persist.img /media/nocrypt -o loop

And it works like a charm. I am able to navigate into it and see its content.

I got stuck when I tried to do the same for the .aes file .
I tried to mount it with the command:

sudo mount /media/sdb1/KNOPPIX/knoppix-data.aes /media/aes -o loop,encryption=aes
It ask me for the ubuntu password (due to the "sudo") and I type it - ok .
It then ask me for the aes password, I type it but it gives the following message:

ioctl: LOOP_SET_STATUS: Invalid argument

I don't want to redo everything. I want to do it the smart way
and I want to learn to mount a .aes file .
I exhausted google, and also exhausted Knoppix knowledge base.
I also tried all kinds of encryption options in the mount command:
256, aes256, but it just keeps giving the same "ioctl:...." message .

As I mentioned above - I am stuck .

Well, I thought it might be helpful if I add my mtab file, so here it is:

/dev/sda5 / ext4 rw,errors=remount-ro 0 0
proc /proc proc rw,noexec,nosuid,nodev 0 0
none /sys sysfs rw,noexec,nosuid,nodev 0 0
none /sys/fs/fuse/connections fusectl rw 0 0
none /sys/kernel/debug debugfs rw 0 0
none /sys/kernel/security securityfs rw 0 0
none /dev devtmpfs rw,mode=0755 0 0
none /dev/pts devpts rw,noexec,nosuid,gid=5,mode=0620 0 0
none /dev/shm tmpfs rw,nosuid,nodev 0 0
none /var/run tmpfs rw,nosuid,mode=0755 0 0
none /var/lock tmpfs rw,noexec,nosuid,nodev 0 0
none /lib/init/rw tmpfs rw,nosuid,mode=0755 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,noexec,nosuid,nodev 0 0
gvfs-fuse-daemon /home/chitti/.gvfs fuse.gvfs-fuse-daemon rw,nosuid,nodev,user=chitti 0 0
/dev/sdb2 /media/Knoppix_7_on_Bla ext3 rw,nosuid,nodev,uhelper=udisks 0 0
/dev/sdb1 /media/0AEB94CE78177026 fuseblk rw,nosuid,nodev,allow_other,blksize=4096,default_p ermissions 0 0
/dev/sdb1 /media/sdb1 fuseblk rw,nosuid,nodev,allow_other,blksize=4096 0 0
/dev/sdb2 /media/sdb2 ext3 rw 0 0
/dev/loop0 /media/nocrypt ext2 rw 0 0


Any assistance appreciated.

Thank you,

nopics.

Werner P. Schulz
12-15-2012, 03:57 PM
Look at:
http://www.wp-schulz.de/summary/summary-backup.html
http://www.wp-schulz.de/scripte/backup-script.html

First time boot Knoppix with the not encrypted .img file and create a backup
Second time boot Knoppix with the encrypted .aes file and restore the backup.

nopics
12-15-2012, 08:54 PM
Thank you.
I will try the backup and restore method,
and I will post the results.
However, can you assist with the proper way to mount an independent .aes file ?

Thank you,

nopics

Blacksimon
12-15-2012, 11:21 PM
I think you can try this:

- Start Knoppix 7.0.4 with your new knoppix-data.aes
- Open the root terminal an use the command:

mkdir /ramdisk/copy
mount -o loop=/dev/loop6 /media/sdb1/nocrypt-persist.img /ramdisk/copy
rsync -ax /ramdisk/copy /KNOPPIX-DATA/
- Restart Knoppix

Note: size of .aes >= .img

nopics
12-26-2012, 11:38 AM
Hello All, I am still stuck. 8-(

1. Schulz suggested backing up the .img file and then restoring it to the .aes file.

I assumed there is a Knoppix backup tool and I looked for it in the menu but I didn't find such tool. I searched google for such a tool but didn't find anything that worked on my Knoppix 7 .

2. I also tried to mount the .aes file - to no avail. I searched this forum, and the internet, and I realized a .aes file has to be mounted in a different way.

I booted Knoppix without mounting any persistent file, and tried the command:
losetup -e aes -p 0 /dev/loop6 /path/to/my/aes but I got the error:
Cannot allocate memory, couldn't lock into memory, exitingI also tried to mount the .aes file from my memory stick to my Ubuntu intallation, with the comand:

sudo mount /path/to/aes /media/aes -o encryption=aes,keybits=256,loop but I got the error:

ioctl:LOOP_SET_STATUS:Invalid argument3. Blacksimon suggested something with "ramdisk" and "rsync", but I am not going to try anything I don't understand, so I didn't try it. I will appreciate any assistance with tutorial about Blacksimon suggestion.

Thanks in advance for all who are trying to assist. nopics.

------------------------------------
Please use the "Go Advanced" button to have more abilities to format the posting; before sending your posting use "Preview" to see how it looks like.
WPS

Werner P. Schulz
12-26-2012, 12:05 PM
Why didn't you follow the links I told you?

nopics
12-26-2012, 12:33 PM
I forgot to mention that I did try the links you posted. When I switch to: /mnt-system/KNOPPIX and run the command: ./kn-backup.sh I get the message: "You have no flash disk installation". But I do have flash disk installation. I am actually booted from my flash disk installation when I activate this script. The only Knoppix installation I have is a flash disk installation. So I am still stuck. nopics.

Blacksimon
12-26-2012, 03:44 PM
Hi nopics,
there is no tutorial to follow. Mine is just one of the possible methods to copy data from a knoppix-data.img to a knoppix-data.aes

- Boot Knoppix without mounting any persistent file
- Open Root terminal
- preparing the working directory where mount knoppix-data.img, you can do it wherever you want. I use the ramdisk so I do not mind having to delete when I'm done. Turn off the computer and the ram clears :-)

mkdir /ramdisk/img
- mount your knoppix-data.img in /ramdisk/img

mount -o loop=/dev/loop6 /path to/knoppix-data.img /ramdisk/img
- preparing the working directory where mount knoppix-data.aes

mkdir /ramdisk/aes
- mount your knoppix-data.aes in /ramdisk/aes

mount -t ext2 /path to/knoppix-data.aes /ramdisk/aes -o encryption=aes,keybits=256,loop
- insert correct knoppix-data.aes password
- copy from /ramdisk/img to /ramdisk/aes using rsync (is a file transfer program)

rsync -ax /ramdisk/img/* /ramdisk/aes

Werner P. Schulz
12-26-2012, 05:34 PM
When I switch to: /mnt-system/KNOPPIX and run the command: ./kn-backup.sh I get the message: "You have no flash disk installation".
If you did the Knoppix flash disk installation, you'll have the file "ldlinux.sys" at "/mnt-system/" and my script kn-backup.sh test for existence of this file at this position. If you get an error message, you don't have the typical Knoppix installation.

nopics
12-27-2012, 03:07 PM
Blacksimon:

Thank you so much for your assistance.
I got somewhat intimidated by your "ramdisk" mount point.
I didn't realize it is just a simple mount point.

I also found some explanations in this link:

http://csulb.pnguyen.net/loopbackDev.html


I then managed to mount the .aes file in the following way:

losetup -e aes /dev/loop3 /mnt-system/KNOPPIX/name/of/knoppix/aes/file.aes
mount -t ext2 /dev/loop3 /media/aes -o loop

I also mounted the knoppix .img (non-encrypted) file with the command:
mount -o loop /img/file/name.img /media/nocrypt

And I was able to see the content of these 2 files and to copy files between them.

I then unmounted the .aes file with the commands:
umount /media/aes
losetup -d /dev/loop3




Schultz :


Thank you so much for your explanation.

You wrote:

"If you get an error message, you don't have the typical Knoppix installation."



and it got me thinking.
I installed my Knoppix with unetbootin

( http://unetbootin.sourceforge.net/ ) ,
so perhaps unetbootin is doing its installation
different than the way knoppix
is doing it.
I want my knoppix to copy itself to the RAM, and run from the RAM,

and I want it to only update the flash disk during shutdown,
in order to limit flash disk write cycles.
I also wanted to install my Knoppix to an ext2 partition
on my usb stick, without deleting the ntfs partition on the same stick.
Unetbootin did all that.


Anyway, I searched for "ldlinux.sys" with the "find" command and I did not find
this file, so I guess you are correct.

How can I get this file ?

I mounted the Knoppix .iso file on my usb stick
but the file ldlinux.sys
is not there.



I do want to use your backup utility.



Thank you,

nopics.

Werner P. Schulz
12-27-2012, 08:13 PM
I do want to use your backup utility.Sorry, you cannot use the script, if parts of Knoppix are anywhere else and not at typical position. It's so for security reason.

nopics
12-28-2012, 05:03 PM
Well then, Thank you Blacksimon and schultz.

Erez.

utu
01-06-2013, 07:45 PM
I haven't been following this saga, but
I ran across this strange file on my own system.
I notice it shows up on yours as well.
Worth a look, maybe. See post #10, especially.

http://forums.opensuse.org/english/get-technical-help-here/applications/387162-permission-denied-gvfs.html

Blacksimon
01-06-2013, 11:32 PM
The .gvfs problem, in my case, does not affect the rsync copy.
In fact (case of post #8 ) using a live DVD or the noimage cheatcode, the copy is simply made from knoppix-data.img to knoppix-data.aes manually mounted.