PDA

View Full Version : [Persistent home] How to increase [SOLVED]



Béèm
09-10-2006, 09:05 PM
I have been working with home=scan and myconfig=scan
So far so good to get my home and config back after rebooting.
But I made a quite long session and now I have no room in home anymore in such a way that I can't even start Knoppix/KDE.

Is there a way to come out of this situation and not losing the data in knoppix.img?
If I boot without home=scan and create another bigger persistent home, can I sort of mount the old knoppix.img and recover the data in there?

BTW I did a search and I apparently didn't find this situation back in earlier posts.

Jacky
09-11-2006, 03:04 AM
Hi,

The persistent home image is stored as a regular img file and so can be mounted as a loop device.

The steps below is an example of a persistent home image stored as /media/hdb1/knoppix.img. I am also assuming what you want to copy are data files from the old persistent home image.

1. Start Knoppix but do not load the persistent home image. So, don't enter home=scan, and if prompted by Knoppix to load an image, just say cancel.
2. Mount the partition where the image is stored: in this case /media/hdb1. Make it writable.
3. Rename /media/hdb1/knoppix.img to some other name like test.img.
4. Open a shell and enter the following codes:


mkdir /media/image
mount /media/hdb1/test.img /media/image -o loop=/dev/loop3

5. The contents of your old persistant image are now viewable under the folder /media/image. For example the stuff on the old desktop is found at /media/image/home/knoppix/Desktop.
6. Create a new persistent home image of larger size.
7. Copy over whatever you want from /media/image to the home folder or desktop or wherever you want. These will now be part of the new persistant home image.
8. Umount /media/image.

It worked for me, so I hope it works for you. Regards.

Béèm
09-11-2006, 11:17 AM
Thank you for the procedure.
I tried to mount the persistent image but not as a loop device.
When done I'll let know if the procedure worked.

Béèm
09-13-2006, 06:39 PM
I followed the precedure Jacky described and can understand and execute up to point 6
The content of the old knoppix.img is indeed viewable and seems to start from '/'
When trying to copy I get errors of files being there already.

Also I wonder, when I copy files to f.e. desktop, how does the old knoppix.img, which seem to start from '/', incorporate with the existing file system and to bring that info to the new knoppix.img..

My old knoppix was 124MB with some 10KB free.

I rebooted and looked at the size of the new knoppix.img.
It is indeed 186MB (altho I added 64MB) instead of 124MB and 69MB is used now in stead of 124MB while in the ols knoppix situation.
Where is the rest gone too?

What was in the old knoppix.img, what I don't have in the new knoppix.img anymore?

I feel, there is a lack of a simple procedure to increase (or decrease) the size of the knoppix.img file without loosing data.
If I remember well, the advice I saw here, was to work preferably in the LiveCD mode.

Any other advice is welcome.

(BTW: I use also PuppyLinux. There is also the possibility to save the home data, called pup_save.3fs. There is a simple procedure to increase or decrease this pup_save.3fs file to any extend in parts of 32MB. I use a pup_save.3fs of 1.4GB for the moment)

ockham23
09-13-2006, 06:45 PM
How did you copy the files? Did you use "cp -a" command to include hidden files and to preserve file attributes?
cp -a /path_to_source_directory/* /path_to_destination_directory/

Béèm
09-13-2006, 08:26 PM
:oops:
No I tried in Konqueror with drag and drop.
Expecting problems of ownership, I called the super mode Konqueror
So with cp (the way you stated) , I can copy the contents of my old knoppix.img to '/' while I have booted.
I suppose there are files with the same name and the question will probably made 'do you want to overide' (as I had in SU Konqueror)
I said overide, and I had an unstable system.
Not that dramatic as a reboot brought me back a stable system.

I'll try it and as I am still intesting mode (LiveCD), no real harm can be done.

Béèm
09-13-2006, 08:42 PM
So I went to Konsole in SU mode.
Mounted the old knoppix.img at /media/knoppix_old and performed the command.
This is what comes on the Konsole.

root@3[knoppix]# cp -a /media/knoppix_old/* /
cp: cannot overwrite non-directory `/etc' with directory `/media/knoppix_old/etc'
cp: cannot overwrite non-directory `/home' with directory `/media/knoppix_old/home'
cp: cannot overwrite non-directory `/lib' with directory `/media/knoppix_old/lib'
cp: cannot overwrite non-directory `/lost+found' with directory `/media/knoppix_old/lost+found'
cp: cannot overwrite non-directory `/root' with directory `/media/knoppix_old/root'
cp: cannot overwrite non-directory `/tmp' with directory `/media/knoppix_old/tmp'
cp: cannot overwrite non-directory `/usr' with directory `/media/knoppix_old/usr'
cp: cannot overwrite non-directory `/var' with directory `/media/knoppix_old/var'
root@3[knoppix]#

I expected some trouble like this.
Apparently I didn't catch the procedure yet to get my old knnoppix.img into the system after having created a new and bigger one.

Béèm
09-13-2006, 08:48 PM
BTW, this are the mounted file systems.

root@3[knoppix]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 2.5M 27K 2.4M 2% /
/ramdisk 193M 3.6M 189M 2% /ramdisk
/UNIONFS 2.1G 2.0G 115M 95% /UNIONFS
/dev/hdd 697M 697M 0 100% /cdrom
/dev/cloop 1.9G 1.9G 0 100% /KNOPPIX
/dev/hda6 3.5G 3.1G 419M 89% /media/hda6
/media/hda6/knoppix.img
186M 72M 115M 39% /KNOPPIX.IMG
/media/hda6/knoppix_0.img
124M 124M 1.0K 100% /media/knoppix_old
root@3[knoppix]#
The old knoppix.img was 124 MB, the new one 186 MB (I increased with 64 MB) but it only contains 72 MB.
I use also myconfig=scan.

ockham23
09-13-2006, 10:37 PM
root@3[knoppix]# cp -a /media/knoppix_old/* / You specified "/" (root directory) as destination directory; no wonder you got these error messages. Instead, take the mount point of your new home image file such as "/media/mount_point/".

Béèm
09-14-2006, 11:40 AM
Ockham23, Thank you I got the picture now.
Only I wasn't pepared what to reply if I should overwrite or not.

I first tried to overwrit all files.
Well, I ended up with a faulty system; a lot of things not working anymore.

I started the whole sequence again and this time I didn't overwirte.
The new persistent home is now 125 MB, while the old one was 124 MB, so I presume all old data is added to the new one.

In any case, I did a suggestion at the proper place, to have a one click procedure, with just one question: how much to increase/decrease.
That would be much easier.

Béèm
09-14-2006, 11:49 AM
Hi,

The persistent home image is stored as a regular img file and so can be mounted as a loop device.

It worked for me, so I hope it works for you. Regards.
I think your advice was basically correct, so thank you.
I just didn't catch quite well the details of the copying phase.
And as for you, it works now for me as well.