[PLUG] Imaging CF card...

Rodney W. Grimes freebsd at gndrsh.dnsmgr.net
Thu Aug 8 17:18:06 UTC 2019


> > Ditto what Tomas said. For looking at it locally, dd'ing the partition
> > (/dev/sdb1) is fine, but to make a full backup of the CF card so that you
> > can reproduce it, you want an image of /dev/sdb as well.
> 
> That assumes the size of the CF card is the same. I would use fdisk to
> partition it and then write the image to sdb1.

I would not write an image, but would rather fdisk and format
the new empty msdos partition, then use mount(s) and tar to
copy the contents.

Imaging msdos file systems to changed partition parameters is
frought with bad issues.

> 
> > The loopback
> > device (see losetup) is a fun trick, worth learning about.
> 
> The loop option can also be used on mount. You can also mount .iso files
> as well. (Which is useful if you need to yank something out of an install
> disc.)
> 
> >
> > On Thu, Aug 8, 2019 at 9:50 AM Tomas Kuchta <tomas.kuchta.lists at gmail.com>
> > wrote:
> >
> >> If you dd sdb1, you will still need the boot sector and partition table
> >> from sdb to be able to use the new CF card.
> >>
> >> -T
> >>
> >> On Thu, Aug 8, 2019, 12:25 <michael at robinson-west.com> wrote:
> >>
> >> > That's the secret sauce!  /dev/sdb1 instead of /dev/sdb.  Thank you
> >> ;-)
> >> >
> >> > August 8, 2019 11:19 AM, alan at clueserver.org wrote:
> >> >
> >> > > On your dd command try using /dev/sdb1 instead of /dev/sdb.
> >> > >
> >> > > dd if=/dev/sdb1 of=image.img
> >> > >
> >> > > mount -o loop image.img /mnt
> >> > >
> >> > >> [mrobinson at turion-roch-robinson-west-com ~]$ sudo fdisk -l /dev/sdb
> >> > >>
> >> > >> Disk /dev/sdb: 1018 MB, 1018773504 bytes, 1989792 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 label type: dos
> >> > >> Disk identifier: 0x001c2022
> >> > >>
> >> > >> Device Boot Start End Blocks Id System
> >> > >> /dev/sdb1 * 63 1989791 994864+ c W95 FAT32 (LBA)
> >> > >> [mrobinson at turion-roch-robinson-west-com ~]$
> >> > >>
> >> > >> The partition starts at 63, how do I use losetup?
> >> > >>
> >> > >> August 8, 2019 10:42 AM, "Ken Stephens"
> >> <kennethgstephens at gmail.com>
> >> > >> wrote:
> >> > >>
> >> > >>> Micheal,
> >> > >>>
> >> > >>> You using losetup to mount the image to a /dev/loop0?
> >> > >>>
> >> > >>> Ken
> >> > >>>
> >> > >>> On Thu, Aug 8, 2019 at 8:37 AM <michael at robinson-west.com> wrote:
> >> > >>
> >> > >> The server uses a CF card in place of a hard disk. The server oddly
> >> > >> enough
> >> > >> is Windows 98 SE based. I have a CentOS 7 box with a USB CF card
> >> > >> reader.
> >> > >> I am trying to image the CF card and write the image to a second CF
> >> > >> card.
> >> > >> Kind of a, make a backup to experiment with scenario and use the
> >> > >> backup.
> >> > >>
> >> > >> This my CentOS 7 box doesn't work:
> >> > >>
> >> > >> $ sudo dd if=/dev/sdb of=win98seQSP2predrivers.img bs=1M count=1000
> >> > >> status=progress
> >> > >>
> >> > >> The file created cannot be mounted. If you write it to another CF
> >> card,
> >> > >> you get garbage.
> >> > >> _______________________________________________
> >> > >> PLUG mailing list
> >> > >> PLUG at pdxlinux.org
> >> > >> http://lists.pdxlinux.org/mailman/listinfo/plug
> >> > >>> _______________________________________________
> >> > >>> PLUG mailing list
> >> > >>> PLUG at pdxlinux.org
> >> > >>> http://lists.pdxlinux.org/mailman/listinfo/plug
> >> > >>
> >> > >> _______________________________________________
> >> > >> PLUG mailing list
> >> > >> PLUG at pdxlinux.org
> >> > >> http://lists.pdxlinux.org/mailman/listinfo/plug
> >> > >
> >> > > Q: Why do programmers confuse Halloween and Christmas?
> >> > > A: Because OCT 31 == DEC 25.
> >> > >
> >> > > _______________________________________________
> >> > > PLUG mailing list
> >> > > PLUG at pdxlinux.org
> >> > > http://lists.pdxlinux.org/mailman/listinfo/plug
> >> > _______________________________________________
> >> > PLUG mailing list
> >> > PLUG at pdxlinux.org
> >> > http://lists.pdxlinux.org/mailman/listinfo/plug
> >> >
> >> _______________________________________________
> >> PLUG mailing list
> >> PLUG at pdxlinux.org
> >> http://lists.pdxlinux.org/mailman/listinfo/plug
> >>
> > _______________________________________________
> > PLUG mailing list
> > PLUG at pdxlinux.org
> > http://lists.pdxlinux.org/mailman/listinfo/plug
> >
> 
> 
> Q: Why do programmers confuse Halloween and Christmas?
> A: Because OCT 31 == DEC 25.
> 
> _______________________________________________
> PLUG mailing list
> PLUG at pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
> 

-- 
Rod Grimes                                                 rgrimes at freebsd.org



More information about the PLUG mailing list