cpio: Operation not permitted

I executed
find boot -print | cpio -oacv | (cd /mnt/Linux.Backup ; cpio -icdmuv).  

Eleven of the 12 files in boot were copied to /mnt/Linux.Backup.  But when it came to boot.b the following error message appeared.

cpio: boot/boot.b: Operation not permitted

What went wrong?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

    This is installed as the basic boot sector. In the case of most modern
    distributions it is actually a symobolic link to one of four files /boot/
    boot-bmp.b, /boot/boot-menu.b, /boot/boot-text.b, /boot/boot-compat.b
    which allow a user to change the boot-up schema so that it utilises a
    splash screen, a simple menu, a text based interface or a minimal boot
    loader to ensure compatibility respectively. In each case re-installation
    of lilo is necessary in order to complete the changes. To change the
    actual 'boot-logo' you can either use utilites such as fblogo or the more
    refined bootsplash.
    more details:

    Not sure why cpio cann't handle it. (I have used cpio for different *nix machines, never
have any problem).

    Try to do:
    cp -p /boot/boot.b /mnt/Linux.Backup/boot/boot.b

    cp -p /boot/boot.b /mnt/Linux.Backup/boot.b

    see what happen
find  boot -print0 | cpio -p0vumd /mnt/Linux.Backup

GnustomeAuthor Commented:
When I executed
find boot -print0 | cpio -p0vumd /mnt/Linux.Backup
when it got to boot.b the result was the same as before:
cpio: /mnt/Linux.Backup/boot/boot.b: Operation not permitted

When I executed
cp -pv /boot/boot.b /mnt/Linux.Backup/boot/boot.b
the file was copied.  But is that a solution?  I thought cp was the wrong command to use for backup and restore purposes?  I thought cpio and dump were the commands that were needed.  I chose cpio because man dump states that it is for ext2 filesystems.  I have ext3.  If I understand correctly ext3 is an extension of ext2, so maybe the differences would be irrelevant.  But I would need clarification of that.
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

GnustomeAuthor Commented:
I've increased the point value to 500, since this has become more complex than it initally appeared.
In most case, cpio should do the job, it can handle special files. (as I already
mentioned, I have used it for other *nix favour backup, it never fail).

the "cp" command it not for system level backup. (it might not be able to handle
some of the special files). In your case, it is a workaround when cpio failed.

Have you try to use dump/restore? it is also a good tool.

GnustomeAuthor Commented:
I executed:
dump 0uf -boot | (cd /mnt/Linux.Backup ; restore rf -)
The response was:
     DUMP: Must specify disk or filesystem
     DUMP: The ENTIRE dump is aborted.
restore: Tape read error on first record
for dump, i would say
try using like
dump Ouf /boot(or diskname /dev/hd2)

could u try this one.
find /boot -mount -print | cpio -ocB /mnt/Linux.Backup
GnustomeAuthor Commented:
When I tried the cpio command, it printed out the word Usage: followed by many lines of options to be used with cpio.

When I executed:
dump 0uf /boot (/dev/hde5/Linux.Backup)
the response was:
bash: syntax error near unexpected token '(/'

When I executed:
dump 0uf /boot /dev/hde5/Linux.Backup
the response was:
   DUMP: You can't update the dumpdates file when dumping a subdirectory
   DUMP: The ENTIRE dump is aborted.
I suppose boot is mounted like
/boot on /dev/hde5.
dump 0uf /dev/hde5 /mnt/Linux.Backup
dump 0uf /boot  /mnt/Linux.Backup
GnustomeAuthor Commented:
No, I guess I misunderstood your post.  The entry in /etc/fstab is:
/dev/hde5     /mnt     vfat     defaults,umask=0000     0     0
and Linux.Backup is a directory on /dev/hde5.

/boot is mounted on /
i see the problem now.
your boot is mounted on /. mostly it is different from the root partition.

backup are taken when  /boot is unmounted. and nothing is getting changed during backup.

in your case u can umount /boot because here / and /boot are the same.

i would suggest goin to level 1, and try again.

The /boot is only really used during booting so doesn't need to be mounted for everyday use. it is also needed when  running lilo or compiling kernels.
also u can use partimage to take backups and restore, it is really a good product.

also u can use dd for backups too.
like if u want to backup the boot sector.
dd if=/dev/hd?? of=/mnt/other_drive/bootsect.img bs=512 count=1".

"I executed:
dump 0uf -boot | (cd /mnt/Linux.Backup ; restore rf -)"

it should be:

dump 0uf - boot | (cd /mnt/Linux.Backup ; restore rf -)

PS: "-" is stdout (you screen) you need to type a WHITE
      space between "-" and "boot"

GnustomeAuthor Commented:
I still get a response of:
bash: syntax error near unexpected token '(c'

I'm going to look at partimage.  That may be what I was looking for.
GnustomeAuthor Commented:
Shivsa, I downloaded and installed partimage via apt-get install partimage.  I edited fstab to include /dev/hde7 instead of /dev/hde5, because I needed more room.Without rebooting, /mnt was empty, so I created directory Linux.Backup, which made it the only directory on /mnt.  I backed up the Linux partition (/dev/hde3) to /mnt/Linux.Backup.  The backup image was assigned filename /mnt/Linux.Backup/parimage.img.000.  I then booted into Windows, but Linux.Backup was not present on /dev/hde7 (F: drive).  I created directory Linux.Backup, then rebooted into Linux.  At that time /mnt was populated with all the directories on F: drive.  I backed up the Linux partition again to /mnt/Linux.Backup, and the backup image was assigned file name /mnt/Linux.Backup/parimage.img.000.000.  I booted into Windows, and found the image file I had just created.  I booted back into Linux, and deleted the file using rm -vR Linux.Backup.  That got rid of the second image and it's directory.  But it appears the first image is still occupying space on /dev/hde7, but is hidden.  How do I find it and delete it, if necessary, so it isn't taking up space?
GnustomeAuthor Commented:
Shivsa, I have another problem.  My most recent backup was labeled /mnt/Linux.Backup/parimage.img.001.000.  There was no problem with creating the image, but I couldn't use the image to restore the partition, as a test of my ability to do so.  In the first window, when I tabbed down to the part that gave the option of create, restore, restore an MBR, I was unable to uncheck create, and check restore.  How do I do that?

Also, I could go to /mnt/Linux.Backup and run dir and find the image file.  But using slocate or KDE Find Files turned up nothing when searching / or even /mnt/Linux.Backup.
GnustomeAuthor Commented:
Shivsa, I've solved the mystery of the missing file parimage.img.000.  I removed from fstab all entries that refered to partitions shared with Windows, i.e., hde5 and hde7.  I then rebooted.  When I ran dir from /mnt the only directory was Linux.Backup, and the only file in that directory was the .000 file.  I deleted the directory and file.

Now, my only problem is being able to restore from an .img file, as I indicated above.  I have a boot floppy and a root floppy, since my method of installation was bf2.4, but the root floppy doesn't have partimage on it.  If I could find out how to restore from the HD, I could always boot into Linux using the floppies, then apt-get install partimage, then restore from the .img file.

Compiling a kernel is something I intend to learn to do some day, but it appears to be needed in order to create a boot floppy the partimage way (/usr/share/doc/partimage/BOOT-ROOT-creation.txt).  I have to be able to restore somehow, though, or having a backup is useless.
restore from partimage must be as easy as creating.

have to read this doc.
Saving An Image:

The following describes how  create an image of  root partition:

1) You can download partimage from the link above, then create the root/boot floppy disks or download the bootcd.iso and create a bootable Partition Image CD with a cdburner. For more info:
Partition Image Documentation

2) Next, boot Partimage with either the root/boot disks or the bootable cdrom.

3) You must mount a partition to save the image file to, this can not be the same partition that you are backing up. For this document I'm going to backup my root partition (/dev/hda6) to another partiton that I created to store backups and other files on (/dev/hda7). Both of these partitions are reiserfs filesystems so I mounted the backup partition with:

mount  -t  reiserfs  /dev/hda7  /mnt

4) Next type: partimage

5) Tab to: "image file to create/use", then type in the directory to save to and the name of what you want the image to be called. For example:


6) Next, tab to: "action to be done", choose "save partition into a new image file", hit F5 to continue. Note: Use the space bar to select/deselect an item.

7) Now choose your compression level, I chose "Gzip", go over the rest of the options and hit F5 to finish. You can create a smaller image file with Bzip2 but this will take longer, if you use this option make sure you change the extension in step 5 to to /mnt/rootimage.bz2

The root partition that I backed up was 1.5 GB, the resulting image file was 563 Mb and the whole process took about 12 minutes to complete.

Restoring An Image:

All data already on the partition you are restoring to will be lost!

1) Boot partimage and at the command prompt, mount the partition where the image to be restored was saved to, for example:

mount  -t  reiserfs  /dev/hda7  /mnt

2) Next, type partimage then tab to the existing partition where you want the image to be copied to.

3) Enter the path to the image file under "Image file to create/use" for example:


4) Choose "Restore partition from an image file", hit F5 to continue to the next screen. Here you can optionally select "Erase free blocks with zero values", hit F5 again to finish.

Restoring Boot Loader
If you dual boot, you most likely have a boot manager installed and you will have to restore Grub or Lilo to the MBR.  After restoring the image you'll need to boot with the rescue disk mentioned earlier, then as root open a console and type the following:

grub-install /dev/hda

hda = for primary master MBR
hdb = for secondary slave MBR


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
GnustomeAuthor Commented:
I figured out how to use the space bar, but thanks anyway.

It looks, from the partimage.org download page, that if I download the bootable .iso image and burn it to a CD I could do that on any computer and it would still function to boot me into Linux on my Linux computer.  Is that correct?

When I was installing Linux I installed the OS on a primary physical partition.  I also created a swap partition.  But when I tried to create additional logical partitions I was not allowed to do so.  Therefore, the OS and all files are on hde3.  But I created a backup image on hde7: specifically /mnt/F/Linux.Backup/parimage.img.001.000.  Tell me if I am wrong, but it seems to me that if I ever needed to restore that image (which will probably change weekly) I could boot from the boot floppy I already have, change to the root floppy to boot all the way into a minimal install of Linux, execute apt-get install partimage, mount hde7, run partimage, and restore parimage.img.001.000.  Since partimage will be running from RAM, it won't matter that the newly installed files get overwritten.  I could then run partimage again and invoke the third option, to use the image to restore the MBR (on which Lilo is stored).  Will that fly?
sound good to me.
but still i would suggest u to get your backup somewhere on CDROM. yes u can do from any computer but burn in iso format, readable to linux.

also i would suggest try it out once the whole procedure and see where u may see the problem.
GnustomeAuthor Commented:
My CD burner is on another computer on the LAN, which uses NTFS.  hde7 is FAT 32.  So I would have to transfer the image file from FAT 32 to NTFS, then burn it in .iso format.  Unless I use the network feature of partimage and burn the image directly from Linux to the CD.  Is that possible?
i will say use network feature of partimage.
i am afraid compatibility between FAT32 vs NTFS. it does not matter once we write the iso image but even i do not trust MS.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.