Bob McGowan wrote:
Bob McGowan wrote:Mike McCarty wrote:David Fox wrote:On Sun, Sep 14, 2008 at 1:16 PM, Mag Gam <firstname.lastname@example.org> wrote:<<<<--- deleted tar/cpio disucssion ->But perhaps an iso or other disk image format would work better? The file would be mounted using to loop device, updated with rsync, and randomly accessed as needed.The mount command would be: mount -t iso9660 -o loop /path/to/image/file.iso /mnt Then, use files or rsync files between the /mnt the the "real" work area.Good grief, what am I thinking?? Can't use an ISO image, as once it's created it's static.You need a disk img from a random access type, like a floppy or hard disk.Not sure exactly how to create an image from scratch, though I'm sure there are utilities to do it. I'll get back on this once I figure it out.
OK, here's one way, must be done as root to set it up: 1. dd if=/dev/zero of=filename bs=1024k count=## where ## is the size of the file, in megabytes for this bs. 2. losetup -f prints the name of the next available loop device, in my case it was /dev/loop0 3. losetup /dev/loop0 /path/to/filename 4. losetup /dev/loop0 /dev/loop0: :8032956 (/path/to/filename) to confirm things worked as expected 5. mkfs -t fstype /dev/loop0 use other options if desired, such as "-m 1" with ext3 for 1% reserved block count instead of 5%. 6. mkdir /mnt/diskimg or use /media/??? or ... 7. mount -t fstype /dev/loop0 /mnt/diskimg 8. rsync the source files to this mount point. 9. edit /etc/fstab, add a line like: /path/to/filename /media/diskimg auto ro,loop,user,noauto 0 0Now, users can mount the disk image file, use it, rsync it for files they own, or root can rsync the whole thing. The file can be backed up and used elsewhere, etc. I did steps 1-7 and it works like a charm.
Steps 1-7 above come from: http://www.walkernews.net/2007/07/01/create-linux-loopback-file-system-on-disk-file/ -- Bob McGowan
Description: S/MIME Cryptographic Signature