apt-mirror: can't create /media/usb/apt-mirror/mirror directory at /usr/bin/apt-mirror line 342 - onto USB drive

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








up vote
2
down vote

favorite












This question is related to this:
apt-mirror: can't create /dir:/mirror directory at /usr/bin/apt-mirror line 342 But the answer there did not help, because the setup is a bit different.



I need to run apt-mirror to store onto an external USB HDD, NTFS formatted.
Running apt-mirror runs into the same error as user Miphix in his post.



As given in the man page I am used



 su - apt-mirror -c apt-mirror


and get this error



apt-mirror: can't create /media/usb/apt-mirror/mirror directory at /usr/bin/apt-mirror line 342


which is cause by trying to create a directory where there is a directory already.



The answer to run apt mirror as user apt-mirror does not work on an USB HDD with NFTS, because after mounting the drive chown apt-mirror:apt-mirror dir does nothing. This is according to Cannot chmode and chown on a ntfs usb drive, because on external USB drives with NTFS there is only a default ownership.I tried changing the mount directory, but it was converted to root:root after the mount.



Since a new download would be 130GB and would take several days, I need to use the existing repostory and just do an update. Also I can not copy it to the local hard drive, because not enough space.



Any ideas?







share|improve this question


























    up vote
    2
    down vote

    favorite












    This question is related to this:
    apt-mirror: can't create /dir:/mirror directory at /usr/bin/apt-mirror line 342 But the answer there did not help, because the setup is a bit different.



    I need to run apt-mirror to store onto an external USB HDD, NTFS formatted.
    Running apt-mirror runs into the same error as user Miphix in his post.



    As given in the man page I am used



     su - apt-mirror -c apt-mirror


    and get this error



    apt-mirror: can't create /media/usb/apt-mirror/mirror directory at /usr/bin/apt-mirror line 342


    which is cause by trying to create a directory where there is a directory already.



    The answer to run apt mirror as user apt-mirror does not work on an USB HDD with NFTS, because after mounting the drive chown apt-mirror:apt-mirror dir does nothing. This is according to Cannot chmode and chown on a ntfs usb drive, because on external USB drives with NTFS there is only a default ownership.I tried changing the mount directory, but it was converted to root:root after the mount.



    Since a new download would be 130GB and would take several days, I need to use the existing repostory and just do an update. Also I can not copy it to the local hard drive, because not enough space.



    Any ideas?







    share|improve this question
























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      This question is related to this:
      apt-mirror: can't create /dir:/mirror directory at /usr/bin/apt-mirror line 342 But the answer there did not help, because the setup is a bit different.



      I need to run apt-mirror to store onto an external USB HDD, NTFS formatted.
      Running apt-mirror runs into the same error as user Miphix in his post.



      As given in the man page I am used



       su - apt-mirror -c apt-mirror


      and get this error



      apt-mirror: can't create /media/usb/apt-mirror/mirror directory at /usr/bin/apt-mirror line 342


      which is cause by trying to create a directory where there is a directory already.



      The answer to run apt mirror as user apt-mirror does not work on an USB HDD with NFTS, because after mounting the drive chown apt-mirror:apt-mirror dir does nothing. This is according to Cannot chmode and chown on a ntfs usb drive, because on external USB drives with NTFS there is only a default ownership.I tried changing the mount directory, but it was converted to root:root after the mount.



      Since a new download would be 130GB and would take several days, I need to use the existing repostory and just do an update. Also I can not copy it to the local hard drive, because not enough space.



      Any ideas?







      share|improve this question














      This question is related to this:
      apt-mirror: can't create /dir:/mirror directory at /usr/bin/apt-mirror line 342 But the answer there did not help, because the setup is a bit different.



      I need to run apt-mirror to store onto an external USB HDD, NTFS formatted.
      Running apt-mirror runs into the same error as user Miphix in his post.



      As given in the man page I am used



       su - apt-mirror -c apt-mirror


      and get this error



      apt-mirror: can't create /media/usb/apt-mirror/mirror directory at /usr/bin/apt-mirror line 342


      which is cause by trying to create a directory where there is a directory already.



      The answer to run apt mirror as user apt-mirror does not work on an USB HDD with NFTS, because after mounting the drive chown apt-mirror:apt-mirror dir does nothing. This is according to Cannot chmode and chown on a ntfs usb drive, because on external USB drives with NTFS there is only a default ownership.I tried changing the mount directory, but it was converted to root:root after the mount.



      Since a new download would be 130GB and would take several days, I need to use the existing repostory and just do an update. Also I can not copy it to the local hard drive, because not enough space.



      Any ideas?









      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 30 at 19:49









      N0rbert

      15k33069




      15k33069










      asked Apr 30 at 18:40









      CatMan

      527319




      527319




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          0
          down vote













          Hopefully not the best and final one, but I found a way to get it working.



          I added the NTFS USB drive via /etc/fstab, recycling the options from a smb mount. The line looked like this



          in /etc/fstab add
          /dev/sdc1 /media/usbdrive ntfs defaults,credentials=/home/user/.smbcredentials,uid=1000,gid=1000,iocharset=utf8 0 0


          With this, apt-mirror did start without complaining. Maybe all the options are not really required (I did not further testing) but it did work.






          share|improve this answer



























            up vote
            0
            down vote













            It looks things can turn out to be rather trivial. I now seems to work.



            The answer is very close to the linked post above apt-mirror: can't create /dir:/mirror directory at /usr/bin/apt-mirror line 342, but not exactly the same.



            In case of an NTFS drive, the permission system does not work. (I guess) Linux sets some workaround that allows the local user to access the drive, despite most files there being owned by root (this is quite interesting, but another story. Should someone have background on this, please put a link into the comments). Thus the solution is most trivial: run apt-mirror without anything.



            To copy paste here is a full example procedure to use an external USB HDD at /dev/sdb with apt-mirrror (do not type the comments after (an including) '//'):



            $ sudo fdisk -l|grep /dev/sd // find USB device name
            Disk /dev/sdb: 2000 GiB // example output
            /dev/sdb1 2048 15973654123 1185893215654 2000.0G // example output, bogus values
            $ sudo mkdir /mnt/testdrive
            $ sudo mount /dev/sdb1 /mnt/testdrive
            $ apt-mirror
            ...
            some lengthy output here
            ...
            $ sudo umount /dev/sdb1 // unmount the


            The '$' is the prompt. It marks the lines with commands, other lines are screen output



            The important change from the other post above is



            $ apt-mirror


            Which runs apt-mirror as the normal unprivileged user. I think the statements both in the apt-mirror help file and the wiki are misleading. At least in my case they did not work.
            Done.






            share|improve this answer




















              Your Answer







              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "89"
              ;
              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: true,
              noModals: false,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              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%2faskubuntu.com%2fquestions%2f1030262%2fapt-mirror-cant-create-media-usb-apt-mirror-mirror-directory-at-usr-bin-apt%23new-answer', 'question_page');

              );

              Post as a guest






























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              0
              down vote













              Hopefully not the best and final one, but I found a way to get it working.



              I added the NTFS USB drive via /etc/fstab, recycling the options from a smb mount. The line looked like this



              in /etc/fstab add
              /dev/sdc1 /media/usbdrive ntfs defaults,credentials=/home/user/.smbcredentials,uid=1000,gid=1000,iocharset=utf8 0 0


              With this, apt-mirror did start without complaining. Maybe all the options are not really required (I did not further testing) but it did work.






              share|improve this answer
























                up vote
                0
                down vote













                Hopefully not the best and final one, but I found a way to get it working.



                I added the NTFS USB drive via /etc/fstab, recycling the options from a smb mount. The line looked like this



                in /etc/fstab add
                /dev/sdc1 /media/usbdrive ntfs defaults,credentials=/home/user/.smbcredentials,uid=1000,gid=1000,iocharset=utf8 0 0


                With this, apt-mirror did start without complaining. Maybe all the options are not really required (I did not further testing) but it did work.






                share|improve this answer






















                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  Hopefully not the best and final one, but I found a way to get it working.



                  I added the NTFS USB drive via /etc/fstab, recycling the options from a smb mount. The line looked like this



                  in /etc/fstab add
                  /dev/sdc1 /media/usbdrive ntfs defaults,credentials=/home/user/.smbcredentials,uid=1000,gid=1000,iocharset=utf8 0 0


                  With this, apt-mirror did start without complaining. Maybe all the options are not really required (I did not further testing) but it did work.






                  share|improve this answer












                  Hopefully not the best and final one, but I found a way to get it working.



                  I added the NTFS USB drive via /etc/fstab, recycling the options from a smb mount. The line looked like this



                  in /etc/fstab add
                  /dev/sdc1 /media/usbdrive ntfs defaults,credentials=/home/user/.smbcredentials,uid=1000,gid=1000,iocharset=utf8 0 0


                  With this, apt-mirror did start without complaining. Maybe all the options are not really required (I did not further testing) but it did work.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered May 4 at 14:44









                  CatMan

                  527319




                  527319






















                      up vote
                      0
                      down vote













                      It looks things can turn out to be rather trivial. I now seems to work.



                      The answer is very close to the linked post above apt-mirror: can't create /dir:/mirror directory at /usr/bin/apt-mirror line 342, but not exactly the same.



                      In case of an NTFS drive, the permission system does not work. (I guess) Linux sets some workaround that allows the local user to access the drive, despite most files there being owned by root (this is quite interesting, but another story. Should someone have background on this, please put a link into the comments). Thus the solution is most trivial: run apt-mirror without anything.



                      To copy paste here is a full example procedure to use an external USB HDD at /dev/sdb with apt-mirrror (do not type the comments after (an including) '//'):



                      $ sudo fdisk -l|grep /dev/sd // find USB device name
                      Disk /dev/sdb: 2000 GiB // example output
                      /dev/sdb1 2048 15973654123 1185893215654 2000.0G // example output, bogus values
                      $ sudo mkdir /mnt/testdrive
                      $ sudo mount /dev/sdb1 /mnt/testdrive
                      $ apt-mirror
                      ...
                      some lengthy output here
                      ...
                      $ sudo umount /dev/sdb1 // unmount the


                      The '$' is the prompt. It marks the lines with commands, other lines are screen output



                      The important change from the other post above is



                      $ apt-mirror


                      Which runs apt-mirror as the normal unprivileged user. I think the statements both in the apt-mirror help file and the wiki are misleading. At least in my case they did not work.
                      Done.






                      share|improve this answer
























                        up vote
                        0
                        down vote













                        It looks things can turn out to be rather trivial. I now seems to work.



                        The answer is very close to the linked post above apt-mirror: can't create /dir:/mirror directory at /usr/bin/apt-mirror line 342, but not exactly the same.



                        In case of an NTFS drive, the permission system does not work. (I guess) Linux sets some workaround that allows the local user to access the drive, despite most files there being owned by root (this is quite interesting, but another story. Should someone have background on this, please put a link into the comments). Thus the solution is most trivial: run apt-mirror without anything.



                        To copy paste here is a full example procedure to use an external USB HDD at /dev/sdb with apt-mirrror (do not type the comments after (an including) '//'):



                        $ sudo fdisk -l|grep /dev/sd // find USB device name
                        Disk /dev/sdb: 2000 GiB // example output
                        /dev/sdb1 2048 15973654123 1185893215654 2000.0G // example output, bogus values
                        $ sudo mkdir /mnt/testdrive
                        $ sudo mount /dev/sdb1 /mnt/testdrive
                        $ apt-mirror
                        ...
                        some lengthy output here
                        ...
                        $ sudo umount /dev/sdb1 // unmount the


                        The '$' is the prompt. It marks the lines with commands, other lines are screen output



                        The important change from the other post above is



                        $ apt-mirror


                        Which runs apt-mirror as the normal unprivileged user. I think the statements both in the apt-mirror help file and the wiki are misleading. At least in my case they did not work.
                        Done.






                        share|improve this answer






















                          up vote
                          0
                          down vote










                          up vote
                          0
                          down vote









                          It looks things can turn out to be rather trivial. I now seems to work.



                          The answer is very close to the linked post above apt-mirror: can't create /dir:/mirror directory at /usr/bin/apt-mirror line 342, but not exactly the same.



                          In case of an NTFS drive, the permission system does not work. (I guess) Linux sets some workaround that allows the local user to access the drive, despite most files there being owned by root (this is quite interesting, but another story. Should someone have background on this, please put a link into the comments). Thus the solution is most trivial: run apt-mirror without anything.



                          To copy paste here is a full example procedure to use an external USB HDD at /dev/sdb with apt-mirrror (do not type the comments after (an including) '//'):



                          $ sudo fdisk -l|grep /dev/sd // find USB device name
                          Disk /dev/sdb: 2000 GiB // example output
                          /dev/sdb1 2048 15973654123 1185893215654 2000.0G // example output, bogus values
                          $ sudo mkdir /mnt/testdrive
                          $ sudo mount /dev/sdb1 /mnt/testdrive
                          $ apt-mirror
                          ...
                          some lengthy output here
                          ...
                          $ sudo umount /dev/sdb1 // unmount the


                          The '$' is the prompt. It marks the lines with commands, other lines are screen output



                          The important change from the other post above is



                          $ apt-mirror


                          Which runs apt-mirror as the normal unprivileged user. I think the statements both in the apt-mirror help file and the wiki are misleading. At least in my case they did not work.
                          Done.






                          share|improve this answer












                          It looks things can turn out to be rather trivial. I now seems to work.



                          The answer is very close to the linked post above apt-mirror: can't create /dir:/mirror directory at /usr/bin/apt-mirror line 342, but not exactly the same.



                          In case of an NTFS drive, the permission system does not work. (I guess) Linux sets some workaround that allows the local user to access the drive, despite most files there being owned by root (this is quite interesting, but another story. Should someone have background on this, please put a link into the comments). Thus the solution is most trivial: run apt-mirror without anything.



                          To copy paste here is a full example procedure to use an external USB HDD at /dev/sdb with apt-mirrror (do not type the comments after (an including) '//'):



                          $ sudo fdisk -l|grep /dev/sd // find USB device name
                          Disk /dev/sdb: 2000 GiB // example output
                          /dev/sdb1 2048 15973654123 1185893215654 2000.0G // example output, bogus values
                          $ sudo mkdir /mnt/testdrive
                          $ sudo mount /dev/sdb1 /mnt/testdrive
                          $ apt-mirror
                          ...
                          some lengthy output here
                          ...
                          $ sudo umount /dev/sdb1 // unmount the


                          The '$' is the prompt. It marks the lines with commands, other lines are screen output



                          The important change from the other post above is



                          $ apt-mirror


                          Which runs apt-mirror as the normal unprivileged user. I think the statements both in the apt-mirror help file and the wiki are misleading. At least in my case they did not work.
                          Done.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered May 13 at 20:39









                          CatMan

                          527319




                          527319






















                               

                              draft saved


                              draft discarded


























                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1030262%2fapt-mirror-cant-create-media-usb-apt-mirror-mirror-directory-at-usr-bin-apt%23new-answer', 'question_page');

                              );

                              Post as a guest













































































                              Popular posts from this blog

                              pylint3 and pip3 broken

                              Missing snmpget and snmpwalk

                              How to enroll fingerprints to Ubuntu 17.10 with VFS491