Announcement

Collapse
No announcement yet.

need help - sfdisk -d (backing up partition table) "permission denied"

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    need help - sfdisk -d (backing up partition table) "permission denied"

    I need help. I am trying to backup my partition table, including the extended partition table info. I used the following:

    cd /root
    mkdir partition-backup
    cd partition-backup
    dd if=/dev/hda of=backup-hda.mbr count=1 bs=512

    using sudo ... that part worked !

    then I tried to dump the extended partition info into a .sf file using :

    sudo sfdisk -d /dev/hda > backup-hda.sf

    BUT I GET "bash: backup-hda.sf: Permission denied"

    Can someone explain why I can't dump this info into the file for backup purposes?

    Thanks,
    Ken

    #2
    Re: need help - sfdisk -d (backing up partition table) "permission denied"

    I just read through the manual (man sfdisk) and I don't see a -d option.
    Windows no longer obstructs my view.
    Using Kubuntu Linux since March 23, 2007.
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

    Comment


      #3
      Re: need help - sfdisk -d (backing up partition table) "permission denied"

      There are many options.
      -d is just one of them:

      -d
      Dump the partitions of a device in a format useful as input to sfdisk. For example,

      % sfdisk -d /dev/hda > hda.out
      % sfdisk /dev/hda < hda.out

      I'm just not sure why I get a permission denied response when I'm running it as Sudo, and the first part (backing up the mbr) worked.

      Comment


        #4
        Re: need help - sfdisk -d (backing up partition table) &quot;permission denied&quot;

        My bad! :P Looked again, and there it is.

        I tested this, both as 'regular user' in my home directory with:
        Code:
        sudo sfdisk -d /dev/sda > backup.sda.sf
        and as root with:
        Code:
        sudo su
        sfdisk -d /dev/sda > backup.sda.sf
        Both worked in creating the file - the first in the users home directory and the second in the root directory.
        Windows no longer obstructs my view.
        Using Kubuntu Linux since March 23, 2007.
        "It is a capital mistake to theorize before one has data." - Sherlock Holmes

        Comment


          #5
          Re: need help - sfdisk -d (backing up partition table) &quot;permission denied&quot;

          Guess i wasn't switching using "su". Once I did that it seemed to work for me as well.

          Now on to the task of backing up my partitions themselves....

          Thanks for your help.

          Comment


            #6
            Re: need help - sfdisk -d (backing up partition table) &quot;permission denied&quot;

            You're welcome.
            Windows no longer obstructs my view.
            Using Kubuntu Linux since March 23, 2007.
            "It is a capital mistake to theorize before one has data." - Sherlock Holmes

            Comment

            Working...
            X