PDA

View Full Version : persistent home: can I resize the loopback file knoppix.img?



amador
02-26-2005, 10:20 PM
Hi, I'm a linux and knoppix newby. I recently created a persistent home directory by formatting a 2GB knoppix.img loopback file in a 40GB LaCie portable external drive (FAT32). I believe, however, that I may need a bigger loopback file in the future. Is it possible to resize the persistent home file from Knoppix?

If this is not possible, would it be possible to move the /home contents to another directory in the drive, erase knoppix.img, create a bigger loopback file, and then replant the previous /home contents in the new /home without losing any data?

Dave_Bechtel
03-25-2005, 06:52 AM
--2GB is the maximum single-filesize for Fat32. Your second scenario is definitely possible on any linux-native filesystem, such as Reiserfs or ext(2/3); use ' cd sourcedir; cp -apRv . destination-dir ' is what I'd recommend, or tar, or even ' mc '.

--You could also "stack" more 2GB loopback files on top of /home, like so:

' mkdir /home/you/extraspace '
' touch /home/you/extraspace/NOTHERE ' == If you LS the dir and see NOTHERE, ya know it's not mounted.

' dd if=/dev/zero of=/mnt/fat32drive/mnt-home-extraspace-2gb.img bs=1M count=2047 ' == Make the bigfile
' mkreiserfs /mnt/fat32drive/mnt-home-extraspace-2gb.img ' == Answer Y (Format it)

' mount /mnt/fat32drive/mnt-home-extraspace-2gb.img /home/you/extraspace -oloop,noatime,rw ' == Also you can use 'notail' as a mount option if you prefer speed over maximum storage space.

(I'm rather tired ATM; lemme know if you need more hints.)


Hi, I'm a linux and knoppix newby. I recently created a persistent home directory by formatting a 2GB knoppix.img loopback file in a 40GB LaCie portable external drive (FAT32). I believe, however, that I may need a bigger loopback file in the future. Is it possible to resize the persistent home file from Knoppix?

If this is not possible, would it be possible to move the /home contents to another directory in the drive, erase knoppix.img, create a bigger loopback file, and then replant the previous /home contents in the new /home without losing any data?

OErjan
03-25-2005, 08:24 AM
just a space is missing from your lines Dave.

mount /mnt/fat32drive/mnt-home-extraspace-2gb.img /home/you/extraspace -o loop,noatime,rw
by a space I mean that the space between -o and loop (in my line), if the space is not there it might (read should) not work
EDIT the MAX filesize is actually 4G minus one byte, but for some reason knoppix wont alow that.

moving home is not that hard.
just make another imagefile copy everything there and replace the entries in /etc/fstab so that your new file is listed instead,
you can certainly add another file and make that a subdirectory of your old one. i have that.
/home/user is one the original one
and home/user/extra is the "extra
then you can make a /home/user/extra2 and3...or a /home/user/extra/extra...
it is the textfile /etc/fstab that tells linux where the disks/partitions/images are to be mounted. man fstab might help you some more (and asking here aswell)./EDIT

Dave_Bechtel
03-25-2005, 06:57 PM
--Try it w/o the space. I do it all the time, it works. :) I've run into the 2GB max filesize limit more times than I can count ('zip' is famous for this) and finally just stopped using Fat32 for storage outside of native Windoze.

--Original poster, I'd highly recommend resizing the Fat32 partition on your drive, and making about 1/2 of it native Linux - reiserfs, ext3 or whatever. That way *you* get to use the maximum amount of space for whatever you want, including file permissions. I *think* Knoppix should be able to find your persistent home on just about any partition type, but you should experiment.


just a space is missing from your lines Dave.

mount /mnt/fat32drive/mnt-home-extraspace-2gb.img /home/you/extraspace -o loop,noatime,rw
by a space I mean that the space between -o and loop (in my line), if the space is not there it might (read should) not work
EDIT the MAX filesize is actually 4G minus one byte, but for some reason knoppix wont alow that.

moving home is not that hard.
just make another imagefile copy everything there and replace the entries in /etc/fstab so that your new file is listed instead,
you can certainly add another file and make that a subdirectory of your old one. i have that.
/home/user is one the original one
and home/user/extra is the "extra
then you can make a /home/user/extra2 and3...or a /home/user/extra/extra...
it is the textfile /etc/fstab that tells linux where the disks/partitions/images are to be mounted. man fstab might help you some more (and asking here aswell)./EDIT