How do you use SSHFS to work on drives in /dev/

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












My laptop for some reason will not power an external 2.5" HDD, so I am using a Raspberry PI to connect to the drive.



The problem is, I am struggling to perform tasks such as formatting disks and backing-up/restoring partitions. For example:



$ sshfs zaz@192.168.1.93:/dev/ /media/pi-dev
# ntfsclone -r -O /media/pi-dev/sda1 backup.iso
[sudo] password for zaz:
ntfsclone v2016.2.22AR.2 (libntfs-3g)
ERROR(13): Couldn't access 'dev/sda1': Permission denied


How can I use sshfs to mount device files so that I can work with partitions?







share|improve this question























    up vote
    0
    down vote

    favorite












    My laptop for some reason will not power an external 2.5" HDD, so I am using a Raspberry PI to connect to the drive.



    The problem is, I am struggling to perform tasks such as formatting disks and backing-up/restoring partitions. For example:



    $ sshfs zaz@192.168.1.93:/dev/ /media/pi-dev
    # ntfsclone -r -O /media/pi-dev/sda1 backup.iso
    [sudo] password for zaz:
    ntfsclone v2016.2.22AR.2 (libntfs-3g)
    ERROR(13): Couldn't access 'dev/sda1': Permission denied


    How can I use sshfs to mount device files so that I can work with partitions?







    share|improve this question





















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      My laptop for some reason will not power an external 2.5" HDD, so I am using a Raspberry PI to connect to the drive.



      The problem is, I am struggling to perform tasks such as formatting disks and backing-up/restoring partitions. For example:



      $ sshfs zaz@192.168.1.93:/dev/ /media/pi-dev
      # ntfsclone -r -O /media/pi-dev/sda1 backup.iso
      [sudo] password for zaz:
      ntfsclone v2016.2.22AR.2 (libntfs-3g)
      ERROR(13): Couldn't access 'dev/sda1': Permission denied


      How can I use sshfs to mount device files so that I can work with partitions?







      share|improve this question











      My laptop for some reason will not power an external 2.5" HDD, so I am using a Raspberry PI to connect to the drive.



      The problem is, I am struggling to perform tasks such as formatting disks and backing-up/restoring partitions. For example:



      $ sshfs zaz@192.168.1.93:/dev/ /media/pi-dev
      # ntfsclone -r -O /media/pi-dev/sda1 backup.iso
      [sudo] password for zaz:
      ntfsclone v2016.2.22AR.2 (libntfs-3g)
      ERROR(13): Couldn't access 'dev/sda1': Permission denied


      How can I use sshfs to mount device files so that I can work with partitions?









      share|improve this question










      share|improve this question




      share|improve this question









      asked Jun 27 at 23:36









      Zaz

      1,1151110




      1,1151110




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          SSHFS cannot do this. It cannot access block devices. (Source.)



          You have four options:




          • SSH into the Pi, and mount the drive. Eg:



            root@pi# mount /dev/sda1 /mnt/disk


            Then use SSHFS to mount it on your laptop. Eg:



            user@laptop$ sshfs zaz@192.168.1.93:/mnt/disk/ /media/pi-disk


            Now you can modify files on the hard drive. However, I think this doesn't solve your problem - it sounds like you're trying to reformat or recover a failing disk.




          • SSH into the Pi, and run your disk recovery commands there. If you don't have enough space on the Pi to do a disk clone, consider trying something like:



            ntfsclone --save-image --output - /dev/hda1 | 
            gzip -c | ssh host 'cat > backup.img.gz'


            (Source: ntfsclone(8) manual.)



            This command clones a local partition, and saves it to a remote system.



          • Buy a powered USB hub. (The kind with a wall-wart.) They're pretty cheap, and you could connect your hard drive to your laptop without any power issues.


          • Use Network Block Device (NBD) to share the block device over the network. Example. I have never tried this, so you're on your own. ;)






          share|improve this answer





















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );








             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f452319%2fhow-do-you-use-sshfs-to-work-on-drives-in-dev%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            1
            down vote



            accepted










            SSHFS cannot do this. It cannot access block devices. (Source.)



            You have four options:




            • SSH into the Pi, and mount the drive. Eg:



              root@pi# mount /dev/sda1 /mnt/disk


              Then use SSHFS to mount it on your laptop. Eg:



              user@laptop$ sshfs zaz@192.168.1.93:/mnt/disk/ /media/pi-disk


              Now you can modify files on the hard drive. However, I think this doesn't solve your problem - it sounds like you're trying to reformat or recover a failing disk.




            • SSH into the Pi, and run your disk recovery commands there. If you don't have enough space on the Pi to do a disk clone, consider trying something like:



              ntfsclone --save-image --output - /dev/hda1 | 
              gzip -c | ssh host 'cat > backup.img.gz'


              (Source: ntfsclone(8) manual.)



              This command clones a local partition, and saves it to a remote system.



            • Buy a powered USB hub. (The kind with a wall-wart.) They're pretty cheap, and you could connect your hard drive to your laptop without any power issues.


            • Use Network Block Device (NBD) to share the block device over the network. Example. I have never tried this, so you're on your own. ;)






            share|improve this answer

























              up vote
              1
              down vote



              accepted










              SSHFS cannot do this. It cannot access block devices. (Source.)



              You have four options:




              • SSH into the Pi, and mount the drive. Eg:



                root@pi# mount /dev/sda1 /mnt/disk


                Then use SSHFS to mount it on your laptop. Eg:



                user@laptop$ sshfs zaz@192.168.1.93:/mnt/disk/ /media/pi-disk


                Now you can modify files on the hard drive. However, I think this doesn't solve your problem - it sounds like you're trying to reformat or recover a failing disk.




              • SSH into the Pi, and run your disk recovery commands there. If you don't have enough space on the Pi to do a disk clone, consider trying something like:



                ntfsclone --save-image --output - /dev/hda1 | 
                gzip -c | ssh host 'cat > backup.img.gz'


                (Source: ntfsclone(8) manual.)



                This command clones a local partition, and saves it to a remote system.



              • Buy a powered USB hub. (The kind with a wall-wart.) They're pretty cheap, and you could connect your hard drive to your laptop without any power issues.


              • Use Network Block Device (NBD) to share the block device over the network. Example. I have never tried this, so you're on your own. ;)






              share|improve this answer























                up vote
                1
                down vote



                accepted







                up vote
                1
                down vote



                accepted






                SSHFS cannot do this. It cannot access block devices. (Source.)



                You have four options:




                • SSH into the Pi, and mount the drive. Eg:



                  root@pi# mount /dev/sda1 /mnt/disk


                  Then use SSHFS to mount it on your laptop. Eg:



                  user@laptop$ sshfs zaz@192.168.1.93:/mnt/disk/ /media/pi-disk


                  Now you can modify files on the hard drive. However, I think this doesn't solve your problem - it sounds like you're trying to reformat or recover a failing disk.




                • SSH into the Pi, and run your disk recovery commands there. If you don't have enough space on the Pi to do a disk clone, consider trying something like:



                  ntfsclone --save-image --output - /dev/hda1 | 
                  gzip -c | ssh host 'cat > backup.img.gz'


                  (Source: ntfsclone(8) manual.)



                  This command clones a local partition, and saves it to a remote system.



                • Buy a powered USB hub. (The kind with a wall-wart.) They're pretty cheap, and you could connect your hard drive to your laptop without any power issues.


                • Use Network Block Device (NBD) to share the block device over the network. Example. I have never tried this, so you're on your own. ;)






                share|improve this answer













                SSHFS cannot do this. It cannot access block devices. (Source.)



                You have four options:




                • SSH into the Pi, and mount the drive. Eg:



                  root@pi# mount /dev/sda1 /mnt/disk


                  Then use SSHFS to mount it on your laptop. Eg:



                  user@laptop$ sshfs zaz@192.168.1.93:/mnt/disk/ /media/pi-disk


                  Now you can modify files on the hard drive. However, I think this doesn't solve your problem - it sounds like you're trying to reformat or recover a failing disk.




                • SSH into the Pi, and run your disk recovery commands there. If you don't have enough space on the Pi to do a disk clone, consider trying something like:



                  ntfsclone --save-image --output - /dev/hda1 | 
                  gzip -c | ssh host 'cat > backup.img.gz'


                  (Source: ntfsclone(8) manual.)



                  This command clones a local partition, and saves it to a remote system.



                • Buy a powered USB hub. (The kind with a wall-wart.) They're pretty cheap, and you could connect your hard drive to your laptop without any power issues.


                • Use Network Block Device (NBD) to share the block device over the network. Example. I have never tried this, so you're on your own. ;)







                share|improve this answer













                share|improve this answer



                share|improve this answer











                answered Jun 28 at 1:43









                Nick ODell

                8922819




                8922819






















                     

                    draft saved


                    draft discarded


























                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f452319%2fhow-do-you-use-sshfs-to-work-on-drives-in-dev%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    Peggy Mitchell

                    Palaiologos

                    The Forum (Inglewood, California)