Re: Making a Windows disk a file on Linux
On Thu, 9 Sep 2004 23:12:46 -0400 Jeff Macdonald <[EMAIL PROTECTED]> wrote: > Hi, > I just bought a new Dell Laptop for my wife and I'd like to use her > old one for Linux. I have a file server running Gentoo that has mp3 > and videos and runs Samba for windows networking. What I'd like to do > is dd the windows disk and have the target be a file and then mount > that file as a FAT32 file system. In other words I don't want to > create a partition for the data. I just want to keep it around for a > while until I'm sure I don't need it anymore (a few years, just for > good measure). > > Here is the catch, the disk is 60Gigs but only 11Gigs is being used. > So I'd rather have just a 11Gig file instead of a 60 Gig file (I only > have 20 Gigs free anyway). Can I do something like: > dd {opts} | gzip {options} > file > mount {options to read compressed file} > mount {loop options to present previous mount a FAT32} > > or should I shrink the drive instead? I don't think you can do it that way. FAT32 is a file system. But, you could use tar or zip to save all the files as an archive, or simply copy the Windows directory tree into a Linux directory. The main difference here is that the Linux permission structure is used on native Linux file systems where FAT32 has some attributes, such as hidden. Note that Win4Lin and WINE simulate Windows file systems as Linux directory trees. -- Jerry Feldman <[EMAIL PROTECTED]> Boston Linux and Unix user group http://www.blu.org PGP key id:C5061EA9 PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9 pgpfN6H4bLcSk.pgp Description: PGP signature
Re: Making a Windows disk a file on Linux
On Thu, 2004-09-09 at 23:12 -0400, Jeff Macdonald wrote: > Hi, > I just bought a new Dell Laptop for my wife and I'd like to use her > old one for Linux. I have a file server running Gentoo that has mp3 > and videos and runs Samba for windows networking. What I'd like to do > is dd the windows disk and have the target be a file and then mount > that file as a FAT32 file system. In other words I don't want to > create a partition for the data. I just want to keep it around for a > while until I'm sure I don't need it anymore (a few years, just for > good measure). Are you just trying to preserve just the data, or are you trying to preserve the Windows system itself? If you are just trying to preserve the data, you could use mkisofs and create an iso9660 file system, then mount it like this: mount -t iso9660 -o ro,loop=/dev/loop0 windows.iso /foo All of the files will be preserved and usable (not writable, though), but it will no longer be a usable windows system. Or, you could just tar and bzip the filesystem, then extract it when you need it. HTH, Kenny -- Kenneth E. Lussier <[EMAIL PROTECTED]> signature.asc Description: This is a digitally signed message part
Re: Making a Windows disk a file on Linux
Kenneth E. Lussier wrote: AIf you are just trying to preserve the data, you could use mkisofs and create an iso9660 file system, then mount it like this: mount -t iso9660 -o ro,loop=/dev/loop0 windows.iso /foo All of the files will be preserved and usable (not writable, though), but it will no longer be a usable windows system. Or... if it's a relatively small disk, you could just take an image of the disk (or partition), itself, using "dd" or even "cat" (eg. dd if=/dev/hda1 of=image_of_c_drive.img), and then mount it thusly: mount -t vfat -o loop image_of_c_drive.img /foo You could read and write it, then, but you'd also pay the penalty of having the image file include all the empty space on the partition. Just another option... -Ken ___ gnhlug-discuss mailing list [EMAIL PROTECTED] http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss
Re: Making a Windows disk a file on Linux
On Thu, 2004-09-09 at 23:12, Jeff Macdonald wrote: > Hi, > I just bought a new Dell Laptop for my wife and I'd like to use her > old one for Linux. I have a file server running Gentoo that has mp3 > and videos and runs Samba for windows networking. What I'd like to do > is dd the windows disk and have the target be a file and then mount > that file as a FAT32 file system. In other words I don't want to > create a partition for the data. I just want to keep it around for a > while until I'm sure I don't need it anymore (a few years, just for > good measure). I believe this can be done using '-o loop' in mount, allowing you to mount a file as a mounted file system. I haven't tried it myself, so I'm not sure. You'll just need to specify '-t vfat' or somesuch. And, you may also need to specify something to force logical block addressing for the filesystem. It will require someone who has done it before, or some playing with on your part. But it should be do-able. > Here is the catch, the disk is 60Gigs but only 11Gigs is being used. > So I'd rather have just a 11Gig file instead of a 60 Gig file (I only > have 20 Gigs free anyway). Can I do something like: > dd {opts} | gzip {options} > file > mount {options to read compressed file} > mount {loop options to present previous mount a FAT32} > > or should I shrink the drive instead? I don't know enough about VFAT vs FAT32 to know if the 110GB file will pose a problem or not. --Bruce signature.asc Description: This is a digitally signed message part
Re: Making a Windows disk a file on Linux
On 10 Sep 2004 09:26:21 -0400, Bruce Dawson <[EMAIL PROTECTED]> wrote: > On Thu, 2004-09-09 at 23:12, Jeff Macdonald wrote: > > Hi, > > I just bought a new Dell Laptop for my wife and I'd like to use her > I don't know enough about VFAT vs FAT32 to know if the 110GB file will > pose a problem or not. FAT: Volumes from floppy disk size up to 4 gigabytes (GB). Maximum file size is 2 GB. FAT32: Volumes from 512 MB to 2 TB. In Windows XP, you can format a FAT32 volume up to 32 GB only. Maximum file size is 4 GB. Sorry for posting it in a strange format, I copied and pasted the information from Microsoft Knowledge Base within Visual Studio.NET.. ___ gnhlug-discuss mailing list [EMAIL PROTECTED] http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss
Re: Making a Windows disk a file on Linux
On Fri, 10 Sep 2004 08:40:15 -0400, Ken D'Ambrosio wrote: > Kenneth E. Lussier wrote: > > Or... if it's a relatively small disk, you could just take an image of > the disk (or partition), itself, using "dd" or even "cat" (eg. dd > if=/dev/hda1 of=image_of_c_drive.img), and then mount it thusly: > mount -t vfat -o loop image_of_c_drive.img /foo > You could read and write it, then, That is my thinking to. Seems to me that would preserve the file system the best. > but you'd also pay the penalty of > having the image file include all the empty space on the partition. That is why I was asking about compressing stuff. There is a file system call squashFS that compresses filesystems. I just noticed that last night. I don't know if 2.6 kernels have it, but that might be an option. The other option for getting rid of extra space is shrinking the partition. I haven't played with those tools, but I'd imagine parted or a similar tool on a Knoppix CD is reliable. Have you folks had good luck shrinking partitions? > > Just another option... > And I like it. -- Jeff Macdonald Ayer, MA ___ gnhlug-discuss mailing list [EMAIL PROTECTED] http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss
Re: Making a Windows disk a file on Linux
Unless it's vitally important to preserve some of the obscure Windows-specific file attributes, tar seems like a fine solution. Otherwise, if I were doing this I think I'd create a partition that's just large enough to hold the collection of files in question, initialize that raw partition with some repetititve pattern (read: highly compressible, like all zeroes) then initialize that partition with a Windows filesystem, then use Windows to copy all files of interest to that partition, then dd that partition image into Linux file, then compress that image file, but noting whether any useful compression was achieved. If no useful compression I'd access it via straight loopback mount, else compressed loopback mount. BTW, somebody mentioned "logical block addressing" but note that LBA doesn't come into play at this level. ___ gnhlug-discuss mailing list [EMAIL PROTECTED] http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss
Re: Making a Windows disk a file on Linux
Just to elaborate on what Michael said, you can get cloop from the knoppix guys: http://developer.linuxtag.net/knoppix/sources/ I think there also some "security" software for Windows that will zero unused space on a live filesystem - that should help with compression. -Bill ___ gnhlug-discuss mailing list [EMAIL PROTECTED] http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss
Re: Making a Windows disk a file on Linux
You've gotten some good advice so far, but I just wanted to mention another alternative that I've done on several different systems, including GNU/Linux and FreeBSD. If you really are interested in having a FAT32 or some specific filesystem available on a drive without repartitioning, then another workable solution is to create an empty file of the desirable size by using dd if=/your/file of=/dev/zero with other appropriate options. You can then format that file with a file system and mount it with the appropriate options. You can read and write to that file as if it were a regular filesystem. I've even used the above to make a "bootable" file for VMWare. It has been a year or more since I've done that and the specifics vary by OS (lately, I've been using FreeBSD more for that sort of thing), but finding instructions was fairly easy on the 'Net last time I needed to look. Also, if prodded, I could probably get you the proper sequence of commands on your OS choice after a few minutes refreshing my memory with the man and info pages. ___ gnhlug-discuss mailing list [EMAIL PROTECTED] http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss
Re: Making a Windows disk a file on Linux
On Fri, 10 Sep 2004 19:55:34 -0400, Jason Stephenson <[EMAIL PROTECTED]> wrote: > If you really are interested in having a FAT32 or some specific > filesystem available on a drive without repartitioning, then another > workable solution is to create an empty file of the desirable size by > using dd if=/your/file of=/dev/zero with other appropriate options. You > can then format that file with a file system and mount it with the > appropriate options. You can read and write to that file as if it were a > regular filesystem. I've even used the above to make a "bootable" file > for VMWare. Thanks, I ended up taking the easy way out and just used rsync. :) In the end I decided I didn't need a true copy of the FAT32 system. As long as I can get to data I'm happy, as I don't really need to run any programs (cross my fingers). Thanks again all for the advice. -- Jeff Macdonald Ayer, MA ___ gnhlug-discuss mailing list [EMAIL PROTECTED] http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss