Re: [opensuse] Very basic dd question
An update: The dd command as suggested by Greg worked fine, I was able to take the original 2 good hdds (or working pulls w/ os on them) and back them up to a couple of files in the temp dir, then write back out to a couple of unpartitioned drives of equal or larger size. I tried to resize with gparted but it fails to resize and I don't have any other tool (yet) to do that. Orig hdd is 1 GB with about 110MB of data in FAT16 partition and the other is about that size with maybe a bit more data. One has Win 3.11 and the other is Win95 (I said it was old crap). Issue is 3 spare drives from 172MB to 800MB size that I cannot use until I get the copied partition resized down to 172MB. The copied partitions are on drives that are too thick to fit into his laptops. It's always something ... Thanks, all. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Stevens
02/28/17 9:54 PM >>>
Issue is 3 spare drives from 172MB to 800MB size that I cannot use until I get the copied partition resized down to 172MB. The copied partitions are on drives that are too thick to fit into his laptops. It's always something ...
In case it helps, these are notes that I have on resizing .img files created by dd: Mounting: https://yaoq.gitbooks.io/starter-kit-for-pcduino8-uno-user-guide/content/pos... root@countryside:/data/exclude/nfs# fdisk -l pcduino8.img Disk pcduino8.img: 1677 MB, 1677721600 bytes 255 heads, 63 sectors/track, 203 cylinders, total 3276800 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000b9be4 Device Boot Start End Blocks Id System pcduino8.img1 2048 73727 35840 83 Linux pcduino8.img2 73728 139263 32768 83 Linux Units: sectors of 1 x 512 = 512 bytes (512 is from the I/O size above) mount -v -o offset=1048576 -t vfat pcduino8.img /mnt/img/one mount -v -o offset=37748736 -t ext4 pcduino8.img /mnt/img/two (can also try 'auto' instead of vfat, ext4, etc.) Create a blank .img file: http://sirlagz.net/2012/06/20/how-to-resize-partitions-on-an-image-file/ dd bs=1M count=3600 if=/dev/zero of=test.img Copy the first XXXX bytes of an img file to the new .img file: dd bs=1M count=3600 if=orig.img of=test.img Shrink and copy an sd card: Shrink the partition down using gparted. Partition table entries are not in disk order. Disk /dev/sdc: 7.3 GiB, 7780433920 bytes, 15196160 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x000b9be4 Device Boot Start End Sectors Size Id Type /dev/sdc1 2048 73727 71680 35M 83 Linux /dev/sdc2 73728 139263 65536 32M 83 Linux /dev/sdc3 139264 1777663 1638400 800M 83 Linux For the count= in the line below, do: (sectors * sector_size) / copy_block_size (1638400 * 512) / 4096 root@probook:/home/christopher/Desktop# dd if=/dev/sdc of=pcduino8_small.img bs=4096 count=204800 204800+0 records in 204800+0 records out 838860800 bytes (839 MB) copied, 52.2033 s, 16.1 MB/s -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 01/03/17 03:54, Stevens wrote:
An update:
The dd command as suggested by Greg worked fine, I was able to take the original 2 good hdds (or working pulls w/ os on them) and back them up to a couple of files in the temp dir, then write back out to a couple of unpartitioned drives of equal or larger size. I tried to resize with gparted but it fails to resize and I don't have any other tool (yet) to do that. Orig hdd is 1 GB with about 110MB of data in FAT16 partition and the other is about that size with maybe a bit more data. One has Win 3.11 and the other is Win95 (I said it was old crap).
Issue is 3 spare drives from 172MB to 800MB size that I cannot use until I get the copied partition resized down to 172MB. The copied partitions are on drives that are too thick to fit into his laptops. It's always something ...
Has he got VirtualBox or similar? Can you copy the images to a laptop hard-drive? Can you mount the images in VirtualBox? Actually, it's just struck me - linux has no trouble loopback-mounting a disk image - can you mount those images in linux and just copy the files out of it? If all you want to do is recover the disk contents, with those drives you could almost certainly just mount them in linux, burn the contents to a CD, and let him recover the stuff off that! Cheers, Wol -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 03/01/2017 01:58 PM, Anthony Youngman wrote:
Has he got VirtualBox or similar? Can you copy the images to a laptop hard-drive? Can you mount the images in VirtualBox?
Actually, it's just struck me - linux has no trouble loopback-mounting a disk image - can you mount those images in linux and just copy the files out of it? If all you want to do is recover the disk contents, with those drives you could almost certainly just mount them in linux, burn the contents to a CD, and let him recover the stuff off that!
Cheers, Wol
Wol (and others), it isn't a matter of just wanting to have the files. That data we have, more or less. No, it is a bit of a conundrum, to wit: (please follow without condemnation) - friend has some old IBM laptops from Win 3.11 and Win 95 era - 2 of these are used by him for very specific purpose that seems not to work with any other hardware/software combination - This project is not to recover data or to fix drives, it is to take blank drives and essentially make them copies of those that boot and run so his other hardware will work just like the 2 working laptops - Due to the driver requirements of those antique OS, (and lack thereof in his junkbox) basically only a cloned drive will boot and run - I, of course, said Oh, yeah, I can do that, then the fun started. - Said friend lives several miles from here, so any changes done here have to wait until our paths cross. Not difficult but not quick, either. I might also add that the original drives are around 1GB with less than 170MB of data and the spare drives range from 176MB to 1GB AND my gparted will NOT resize a working FAT16 drive (maybe won't any other, either but don't know). I want to thank everyone who has chimed in with suggestions. Some have been spot on and have worked great. I will try just copying the first 170MB or so of the image and we shall see how that works. I'll report back whenever I find out. =================== -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2017-03-02 00:59, Stevens wrote:
I might also add that the original drives are around 1GB with less than 170MB of data and the spare drives range from 176MB to 1GB AND my gparted will NOT resize a working FAT16 drive (maybe won't any other, either but don't know).
You need "partition magic".
I want to thank everyone who has chimed in with suggestions. Some have been spot on and have worked great. I will try just copying the first 170MB or so of the image and we shall see how that works. I'll report back whenever I find out.
It may initially work, but then the OS may want to access somewhere beyond the disk size (the partition says what size to expect, but it is wrong) and it will crash. -- Cheers / Saludos, Carlos E. R. (from 42.2 x86_64 "Malachite" (Minas Tirith))
On 01/03/17 23:59, Stevens wrote:
On 03/01/2017 01:58 PM, Anthony Youngman wrote:
Has he got VirtualBox or similar? Can you copy the images to a laptop hard-drive? Can you mount the images in VirtualBox?
Actually, it's just struck me - linux has no trouble loopback-mounting a disk image - can you mount those images in linux and just copy the files out of it? If all you want to do is recover the disk contents, with those drives you could almost certainly just mount them in linux, burn the contents to a CD, and let him recover the stuff off that!
Cheers, Wol
Wol (and others), it isn't a matter of just wanting to have the files. That data we have, more or less. No, it is a bit of a conundrum, to wit: (please follow without condemnation) - friend has some old IBM laptops from Win 3.11 and Win 95 era - 2 of these are used by him for very specific purpose that seems not to work with any other hardware/software combination - This project is not to recover data or to fix drives, it is to take blank drives and essentially make them copies of those that boot and run so his other hardware will work just like the 2 working laptops - Due to the driver requirements of those antique OS, (and lack thereof in his junkbox) basically only a cloned drive will boot and run - I, of course, said Oh, yeah, I can do that, then the fun started. - Said friend lives several miles from here, so any changes done here have to wait until our paths cross. Not difficult but not quick, either.
There's more than one way to skin a cat ... Your Win3/Dos system - that shouldn't need to be a direct clone? Can you format the new disk? One partition, fat16, make it bootable, make sure the disk has got an mbr. Copy ALL the files from the old disk to the new with a "cp -a". One clone that should work fine. I expect the same technique should work for Win95. The other thing is, ask if anybody here has stuff in their toolbox to help. I've got DOS6.22 disk images, Win3.11, Win95/8 rescue floppy, etc etc. Little tip - I don't know whether you said it in your original post, but if you always say WHAT you are trying to achieve (here rescue a couple of systems) and don't focus on the HOW (cloning the disks), you're likely to get a far broader range of helpful pointers.
I might also add that the original drives are around 1GB with less than 170MB of data and the spare drives range from 176MB to 1GB AND my gparted will NOT resize a working FAT16 drive (maybe won't any other, either but don't know).
I want to thank everyone who has chimed in with suggestions. Some have been spot on and have worked great. I will try just copying the first 170MB or so of the image and we shall see how that works. I'll report back whenever I find out.
Oh - and try to run his system in DosBox or similar - if you can get him off this hardware, that'll be far better - what will you do when something more serious dies? Cheers, Wol -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2017-03-02 13:53, Wols Lists wrote:
On 01/03/17 23:59, Stevens wrote:
There's more than one way to skin a cat ...
Your Win3/Dos system - that shouldn't need to be a direct clone?
Can you format the new disk? One partition, fat16, make it bootable, make sure the disk has got an mbr.
Copy ALL the files from the old disk to the new with a "cp -a".
Or with mtools, mcopy, because it should copy all msdos attributes. You just have to be careful not to overwrite the two inmutable or unmovable files - sorry, I don't remember the names, and they can vary a bit. The boot record has the position of those two files created at format /s time hard written. -- Cheers / Saludos, Carlos E. R. (from 42.2 x86_64 "Malachite" (Minas Tirith))
On 02/03/17 13:02, Carlos E. R. wrote:
On 2017-03-02 13:53, Wols Lists wrote:
On 01/03/17 23:59, Stevens wrote:
There's more than one way to skin a cat ...
Your Win3/Dos system - that shouldn't need to be a direct clone?
Can you format the new disk? One partition, fat16, make it bootable, make sure the disk has got an mbr.
Copy ALL the files from the old disk to the new with a "cp -a".
Or with mtools, mcopy, because it should copy all msdos attributes.
You just have to be careful not to overwrite the two inmutable or unmovable files - sorry, I don't remember the names, and they can vary a bit. The boot record has the position of those two files created at format /s time hard written.
Okay, with cp then, the appropriate option is --no-clobber. Cheers, Wol -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 El 2017-03-02 a las 14:35 -0000, Wols Lists escribió:
On 02/03/17 13:02, Carlos E. R. wrote:
On 2017-03-02 13:53, Wols Lists wrote:
On 01/03/17 23:59, Stevens wrote:
Or with mtools, mcopy, because it should copy all msdos attributes.
You just have to be careful not to overwrite the two inmutable or unmovable files - sorry, I don't remember the names, and they can vary a bit. The boot record has the position of those two files created at format /s time hard written.
Okay, with cp then, the appropriate option is --no-clobber.
For a disk to be used on msdos/windows, you really should use mcopy, not cp. Otherwise, you have to use mattrib to restore a copy of the msdos attributes. Otherwise, just use msdos for the copy. Use xcopy, it runs fast. I used it a lot in the past. - -- Cheers Carlos E. R. (from 42.2 x86_64 "Malachite" (Minas Tirith)) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iF4EAREIAAYFAli4xWoACgkQja8UbcUWM1x9sQD+LVw4h9AOgbrQ7HL+GILHZb0g vDyDcf+mJCn8bAQsGgAA/2OnAQdRMFWLK7q7E+gehrRoMxgttGjAA6sKiwWx4SpI =yoG7 -----END PGP SIGNATURE-----
On 02/03/2017 15:02, Carlos E. R. wrote:
On 2017-03-02 13:53, Wols Lists wrote:
On 01/03/17 23:59, Stevens wrote:
There's more than one way to skin a cat ...
Your Win3/Dos system - that shouldn't need to be a direct clone?
Can you format the new disk? One partition, fat16, make it bootable, make sure the disk has got an mbr.
Copy ALL the files from the old disk to the new with a "cp -a". Or with mtools, mcopy, because it should copy all msdos attributes.
You just have to be careful not to overwrite the two inmutable or unmovable files - sorry, I don't remember the names, and they can vary a bit. The boot record has the position of those two files created at format /s time hard written.
IO.SYS and MSDOS.SYS Dave P -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
"the two inmutable or unmovable files - sorry, I don't remember the names, and they can vary a bit. The boot record has the position of those two files created at format /s time hard written."
I believe the names of those files are: IO.SYS and MSDOS.SYS and they have to be listed as the first and second files respectively in the root directory. ----- Original Message ----- Sent: Thursday, March 02, 2017 5:02 AM Subject: Re: [opensuse] Very basic dd question On 2017-03-02 13:53, Wols Lists wrote:
On 01/03/17 23:59, Stevens wrote:
There's more than one way to skin a cat ...
Your Win3/Dos system - that shouldn't need to be a direct clone?
Can you format the new disk? One partition, fat16, make it bootable, make sure the disk has got an mbr.
Copy ALL the files from the old disk to the new with a "cp -a".
Or with mtools, mcopy, because it should copy all msdos attributes. You just have to be careful not to overwrite the two inmutable or unmovable files - sorry, I don't remember the names, and they can vary a bit. The boot record has the position of those two files created at format /s time hard written. -- Cheers / Saludos, Carlos E. R. (from 42.2 x86_64 "Malachite" (Minas Tirith)) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2017-03-03 18:04, Alec Destry wrote:
"the two inmutable or unmovable files - sorry, I don't remember the names, and they can vary a bit. The boot record has the position of those two files created at format /s time hard written."
I believe the names of those files are: IO.SYS and MSDOS.SYS and they have to be listed as the first and second files respectively in the root directory.
Yes, those were the typical names. Another variant was something like ibmio.sys, I think. But the position in the root directory was irrelevant: what mattered was the actual blocks in the disk they occupied. The function that reads them into memory at boot knows nothing about reading directories. It just loads blocks of disk data into specified memory location. It is the same function, I believe, that the boot record code uses currently to load grub on MBR disks. They were the first entries in the directory because normally they were created on empty disks. But you could create them much later on a disk that already hold data with the command SYS. -- Cheers / Saludos, Carlos E. R. (from 42.2 x86_64 "Malachite" (Minas Tirith))
Carlos E. R. composed on 2017-03-03 19:13 (UTC+0100):
Another variant was something like ibmio.sys, I think.
PC-DOS 2000 40726 Apr 30 1998 ibmbio.com 37066 Apr 30 1998 ibmdos.com -- "The wise are known for their understanding, and pleasant words are persuasive." Proverbs 16:21 (New Living Translation) Team OS/2 ** Reg. Linux User #211409 ** a11y rocks! Felix Miata *** http://fm.no-ip.com/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2017-03-04 00:43, Felix Miata wrote:
Carlos E. R. composed on 2017-03-03 19:13 (UTC+0100):
Another variant was something like ibmio.sys, I think.
PC-DOS 2000 40726 Apr 30 1998 ibmbio.com 37066 Apr 30 1998 ibmdos.com
It must be ages since I see that one... And I did see it, so I'm too old for my liking. :-} -- Cheers / Saludos, Carlos E. R. (from 42.2 x86_64 "Malachite" (Minas Tirith))
participants (8)
-
Alec Destry
-
Anthony Youngman
-
Carlos E. R.
-
Christopher Myers
-
Dave Plater
-
Felix Miata
-
Stevens
-
Wols Lists