Errors using dd

openSUSE 13.2 64bit running at level 3

I just deleted a backup .iso file from a recently new USB stick using

rm /mnt/chromebook_suse.iso

I got a number of errors in the form of

EXT4-fs error (device sdc1): ext4_mb_generate_buddy:757: group 128, block bitmap and bg descriptor inconsistent: 13173 vs 32255 free clusters

with different groups and different free clusters. Then when I tried to create a fresh .iso using

dd if=/dev/sda of=/mnt/chromebook_suse.iso bs=100M

I got a number of similar errors again with different numbers.

Needless to say I booted from a live USB and the drive I was backing up was not mounted. Some Google responses suggested I should fsck the backup stick but I hate to disturb an .iso. Any suggestions?

Thanks in advance.

Well, apparently the filesystem on /dev/sdc1 has errors. If that’s your USB stick, you probably removed it at some point without unmounting it first?
And yes, you should run fsck to repair the filesystem IMHO.

If the .iso is just a backup, it shouldn’t matter much. Just create another .iso afterwards to be safe.
Or copy it to somewhere else before you run fsck.

Although the error message doesn’t really sound like an fsck could break your .iso file. And if it would, it is probably broken already anyway.

On 2015-06-13 16:36, ionmich wrote:
>
> I just deleted a backup .iso file from a recently new USB stick using
> Code:
> --------------------
> rm /mnt/chromebook_suse.iso
> --------------------

What is mounted on “/mnt”? The output of the “mount” command would say.

> I got a number of errors in the form of
> Code:
> --------------------
> EXT4-fs error (device sdc1): ext4_mb_generate_buddy:757: group 128, block bitmap and bg descriptor inconsistent: 13173 vs 32255 free clusters
> --------------------

Assuming that sdc1 is mounted on “/mnt”, you have to umount it, then
fsck /dev/sdc1. It is ext4, not iso.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

@ionmich.

While the two advices above sound correct to me, I get the idea that you have some misconceptions. When that is true, you might have problems understanding the advices as well as what is probably going on on your system.

As you might know, Unix/Linux has no concept of “extensions” thus the fact that the name of a file ends in the four characters .iso has no significance. However it is general the case that people give such a name to a file that is a direct copy of a complete ISO file system, just for the ease of the human brain. That means that while that file.ios contains the full contents (directories, files, internal contsructions like inodes) of an ISO file system, for the Linux system it is just a file.

Thus when you have problems removing and/or creating such a file on a file system (and seeing your information, it is most likely to be an Ext4 file system on /dev/sdc1 mounted at /mnt), then that Ext4 file system has problems. This would also be the case if the file you want to remove and/or create was named picture.jpeg (and would have the contents of a JPEG image).
Thus te advice to fsck that EXT4 file system on /dev/sdc1.

I do not quite understand why you copy all om /dev/sda to a file, in the same time naming it file.iso. That would be confusing, except when /dev/sda is an unpartitioned mass-storage device containing a file system of type ISO (like a CD or DVD or USB stick prepared as such). Is that the case?

I’m a bit confused is this a file on the USB which happens to be formatted ext4 or is this a bootable image that came from a ISO . This makes a world of diference

I think I need to clarify my objective.

I want to have a backup of my hard drive so that if it is damaged in some non-physical way I can restore it to its previous state. I think I can do that by using dd to copy the entire drive to a single file on a USB stick which I then name *.iso so I know that I must use dd to copy it back to the hard drive. It is my understanding that dd can do that by creating an exact image of the hard drive including super-block and partitioning. Please correct me if I am mistaken, so I don’t waste my time.

I booted from a live USB stick, mounted another ext4 USB stick to /mnt and performed the dd command as shown in my earlier post.

Now following your suggestions I unmounted the destination USB stick and ran fsck on it. This resulted in

# fsck /dev/sdc1
fsck from util-linux 2.25.1
e2fsck 1.42.12 (29-Aug-2014)
/dev/sdc1 contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes

Running additional passes to resolve blocks claimed by more than one inode...
Pass 1B: Rescanning for multiply-claimed blocks
Multiply-claimed block(s) in inode 12: 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2583 2584 2585 2586 2587 2588 2589 2590 2591 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575
Multiply-claimed block(s) in inode 13: 132096
Multiply-claimed block(s) in inode 1046634: 2224 2225 2226 2227 2228 2229
Multiply-claimed block(s) in inode 1046635: 2576 2577 2578 2579 2580 2581 2582
Multiply-claimed block(s) in inode 1046640: 67515 67516 67517 67518 67519 67520 67521 67522 67523 67524 67525 67526 67527 67528 67529 67530 67531 67532 67533 67534 67535 67536 67537 67538 67539 67540 67541 67542 67543 67544 67545 67546 67547 67548 67549 67550 67551 67552 67553 67554 67555 67556 67557 67558 67559 67560 67561 67562 67563 67564 67565 67566 67567 67568 67569 67570 67571 67572 67573 67574 67575 67576 67577 67578 99968 99969 99970 99971 99972 99973 99974 99975 99976 99977 99978 99979 99980 99981 99982 99983 99984 99985 99986 99987 99988 99989 99990 99991 99992 99993 99994 99995 99996 99997 99998 99999 100000 100001 100002 100003 100004 100005 100006 100007 100008 100009 100010 100011 100012 100013 100014 100015 100016 100017 100018 100019 100020 100021 100022 100023 100024 100025 100026 100027 100028 100029 100030 100031 100032 100033 100034 100035 100036 100037 100038

The numbers ran into the hundreds. I was however able to copy a whole directory of photographs which were on the destination drive to another USB stick. They are all there. At this point I plan on re-formatting the destination USB stick and creating a single partition to be used as ext4. I will wait for confirmation that I can backup my hard drive to a single file using dd before I try it again.

Thanks to all for your help.

I don’t see what iso’s have to do with dd copies/backups??

I personally use rsync, luckybackup in particular, since it only copies newer files thus reduce the ware on the USB memory. USB memory has a finite number of erase cycles. But I only copy personal data I see no reason to copy the OS

On 2015-06-13 18:26, ionmich wrote:
>
> I think I need to clarify my objective.
>
> I want to have a backup of my hard drive so that if it is damaged in
> some non-physical way I can restore it to its previous state. I think I
> can do that by using dd to copy the entire drive to a single file on a
> USB stick which I then name *.iso so I know that I must use dd to copy
> it back to the hard drive. It is my understanding that dd can do that by
> creating an exact image of the hard drive including super-block and
> partitioning. Please correct me if I am mistaken, so I don’t waste my
> time.

It is correct, but it is not an ISO image. It is a DISK image.
So you should name it something.img, for instance, or whatever, but not
…iso :slight_smile:


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

Agreed! I will use .img. Thank you.

Yes, your usage of the suffix .iso creates the confusion. You can of course call it what you want, but for other people this has a meaning.

BTW, tthere is no need to have a . (dot) anywhere in the file name. OTOH, you could e.g. call it: image.of.my.root.file.system. rotfl!

So the problem is now identified as an file system problem on the ext4 file system on the device numbered by the system as /dev/sdc1.