Format windows (NTFS) hard drive on Ubuntu using command line

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












3















I had an old Windows machine which recently died. So I decided to put the hard drive into my Ubuntu server. This hard drive is currently NTFS file format, the Disk info is as follows



 description: ATA Disk
product: SAMSUNG HD502HI
physical id: 0.0.0
bus info: scsi@1:0.0.0
logical name: /dev/sdb
version: 1AG0
serial:
size: 465GiB (500GB)
capabilities: partitioned partitioned:dos
configuration: ansiversion=5 sectorsize=512 signature=000c6181


Part One



I need to get some files of this hard drive, but when I try to mount the hard drive all that seems to mount is the /boot partition. Here is what I am doing



Edit fstab and add the following:



/dev/sdb /media/Microsoft ntfs-3g defaults,locale=en_US.utf8 0 0


Then after this I mount using the following command



sudo mount -ro /dev/sdb /media/Microsoft 


Can some one tell me what I am doing wrong, and how I can mount the right partition?



Part Two



Once I have successfully mounted the hard drive and copied the files. How do I go about formatting the hard drive and make it usable for my Linux system? From what I have read I have to do something like



mkfs.ext3 /dev/sdb


then create a partition using fdisk



Can some one direct me to what I actually need to do?










share|improve this question




























    3















    I had an old Windows machine which recently died. So I decided to put the hard drive into my Ubuntu server. This hard drive is currently NTFS file format, the Disk info is as follows



     description: ATA Disk
    product: SAMSUNG HD502HI
    physical id: 0.0.0
    bus info: scsi@1:0.0.0
    logical name: /dev/sdb
    version: 1AG0
    serial:
    size: 465GiB (500GB)
    capabilities: partitioned partitioned:dos
    configuration: ansiversion=5 sectorsize=512 signature=000c6181


    Part One



    I need to get some files of this hard drive, but when I try to mount the hard drive all that seems to mount is the /boot partition. Here is what I am doing



    Edit fstab and add the following:



    /dev/sdb /media/Microsoft ntfs-3g defaults,locale=en_US.utf8 0 0


    Then after this I mount using the following command



    sudo mount -ro /dev/sdb /media/Microsoft 


    Can some one tell me what I am doing wrong, and how I can mount the right partition?



    Part Two



    Once I have successfully mounted the hard drive and copied the files. How do I go about formatting the hard drive and make it usable for my Linux system? From what I have read I have to do something like



    mkfs.ext3 /dev/sdb


    then create a partition using fdisk



    Can some one direct me to what I actually need to do?










    share|improve this question


























      3












      3








      3








      I had an old Windows machine which recently died. So I decided to put the hard drive into my Ubuntu server. This hard drive is currently NTFS file format, the Disk info is as follows



       description: ATA Disk
      product: SAMSUNG HD502HI
      physical id: 0.0.0
      bus info: scsi@1:0.0.0
      logical name: /dev/sdb
      version: 1AG0
      serial:
      size: 465GiB (500GB)
      capabilities: partitioned partitioned:dos
      configuration: ansiversion=5 sectorsize=512 signature=000c6181


      Part One



      I need to get some files of this hard drive, but when I try to mount the hard drive all that seems to mount is the /boot partition. Here is what I am doing



      Edit fstab and add the following:



      /dev/sdb /media/Microsoft ntfs-3g defaults,locale=en_US.utf8 0 0


      Then after this I mount using the following command



      sudo mount -ro /dev/sdb /media/Microsoft 


      Can some one tell me what I am doing wrong, and how I can mount the right partition?



      Part Two



      Once I have successfully mounted the hard drive and copied the files. How do I go about formatting the hard drive and make it usable for my Linux system? From what I have read I have to do something like



      mkfs.ext3 /dev/sdb


      then create a partition using fdisk



      Can some one direct me to what I actually need to do?










      share|improve this question
















      I had an old Windows machine which recently died. So I decided to put the hard drive into my Ubuntu server. This hard drive is currently NTFS file format, the Disk info is as follows



       description: ATA Disk
      product: SAMSUNG HD502HI
      physical id: 0.0.0
      bus info: scsi@1:0.0.0
      logical name: /dev/sdb
      version: 1AG0
      serial:
      size: 465GiB (500GB)
      capabilities: partitioned partitioned:dos
      configuration: ansiversion=5 sectorsize=512 signature=000c6181


      Part One



      I need to get some files of this hard drive, but when I try to mount the hard drive all that seems to mount is the /boot partition. Here is what I am doing



      Edit fstab and add the following:



      /dev/sdb /media/Microsoft ntfs-3g defaults,locale=en_US.utf8 0 0


      Then after this I mount using the following command



      sudo mount -ro /dev/sdb /media/Microsoft 


      Can some one tell me what I am doing wrong, and how I can mount the right partition?



      Part Two



      Once I have successfully mounted the hard drive and copied the files. How do I go about formatting the hard drive and make it usable for my Linux system? From what I have read I have to do something like



      mkfs.ext3 /dev/sdb


      then create a partition using fdisk



      Can some one direct me to what I actually need to do?







      filesystems mount ntfs fdisk






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 13 at 21:55









      Rui F Ribeiro

      39.7k1479132




      39.7k1479132










      asked Oct 25 '13 at 20:11









      c11adac11ada

      123114




      123114




















          3 Answers
          3






          active

          oldest

          votes


















          4














          Depending on who set up the old Windows machine (ie: if it's from HP, Lenovo, etc) you may have many different partitions on the disk that you normally wouldn't see with Windows. Those partitions might include recovery, unused space, etc. As mentioned in the answer above, use fdisk to see the partitions.



          fdisk -l /dev/sdb



          Using that information you can find out which partition is where the files you need are located. The largest partition is probably the one you want.



          Depending on your distribution and version of Windows, you might need to get the ntfs-4g package in order to mount the disk. It looks like you wanted to mount it readonly and that you expect it to be ntfs3 based on your fstab entry.



          mount -o ro /dev/sdbX /media/Microsoft



          For the second part of the question you should have several options depending on what you want to do. You can make a normal file systems with mkfs or you could create a logical volume. If you have a modern installation of a recent linux distribution then your system is more than likely using LVM - you can check with the command "vgs". If you receive output with details about a volume group then LVM is in place. You could add the disk to LVM to expand your existing partitions or create a new, independent disk that is mounted somewhere separately.






          share|improve this answer






























            3














            Find the partitions of /dev/sdb,and mount the right one which contain files you need to backup.Try below to list partitions of /dev/sdb:



            sudo fdisk -l /dev/sdb


            No need to edit /etc/fstab to mount.Just use the command like this.(man mount)



            sudo mount -t type device dir


            You need to specify the type,maybe ntfs or vfat,cause it is windows partitions.



            After that create partition using fdisk/gparted,then build filesystem using mkfs,mkfs.ext3,mkfs.ext4,anything you need.






            share|improve this answer






























              1














              firt mount the partition by:



              sudo fdisk -l or mount

              sudo umount /dev/sdb1

              sudo mkfs.vfat -n usbname -I /dev/sdb1


              or



              sudo mkntfs /dev/sdb1


              or any format for example .ext3, .ext4 and ...






              share|improve this answer

























              • The question asked how to make the disk usable primarily by a Linux system, so suggesting Windows file systems may not be the most useful advice...

                – dhag
                Apr 17 '15 at 15:51










              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',
              autoActivateHeartbeat: false,
              convertImagesToLinks: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              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%2f97623%2fformat-windows-ntfs-hard-drive-on-ubuntu-using-command-line%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              4














              Depending on who set up the old Windows machine (ie: if it's from HP, Lenovo, etc) you may have many different partitions on the disk that you normally wouldn't see with Windows. Those partitions might include recovery, unused space, etc. As mentioned in the answer above, use fdisk to see the partitions.



              fdisk -l /dev/sdb



              Using that information you can find out which partition is where the files you need are located. The largest partition is probably the one you want.



              Depending on your distribution and version of Windows, you might need to get the ntfs-4g package in order to mount the disk. It looks like you wanted to mount it readonly and that you expect it to be ntfs3 based on your fstab entry.



              mount -o ro /dev/sdbX /media/Microsoft



              For the second part of the question you should have several options depending on what you want to do. You can make a normal file systems with mkfs or you could create a logical volume. If you have a modern installation of a recent linux distribution then your system is more than likely using LVM - you can check with the command "vgs". If you receive output with details about a volume group then LVM is in place. You could add the disk to LVM to expand your existing partitions or create a new, independent disk that is mounted somewhere separately.






              share|improve this answer



























                4














                Depending on who set up the old Windows machine (ie: if it's from HP, Lenovo, etc) you may have many different partitions on the disk that you normally wouldn't see with Windows. Those partitions might include recovery, unused space, etc. As mentioned in the answer above, use fdisk to see the partitions.



                fdisk -l /dev/sdb



                Using that information you can find out which partition is where the files you need are located. The largest partition is probably the one you want.



                Depending on your distribution and version of Windows, you might need to get the ntfs-4g package in order to mount the disk. It looks like you wanted to mount it readonly and that you expect it to be ntfs3 based on your fstab entry.



                mount -o ro /dev/sdbX /media/Microsoft



                For the second part of the question you should have several options depending on what you want to do. You can make a normal file systems with mkfs or you could create a logical volume. If you have a modern installation of a recent linux distribution then your system is more than likely using LVM - you can check with the command "vgs". If you receive output with details about a volume group then LVM is in place. You could add the disk to LVM to expand your existing partitions or create a new, independent disk that is mounted somewhere separately.






                share|improve this answer

























                  4












                  4








                  4







                  Depending on who set up the old Windows machine (ie: if it's from HP, Lenovo, etc) you may have many different partitions on the disk that you normally wouldn't see with Windows. Those partitions might include recovery, unused space, etc. As mentioned in the answer above, use fdisk to see the partitions.



                  fdisk -l /dev/sdb



                  Using that information you can find out which partition is where the files you need are located. The largest partition is probably the one you want.



                  Depending on your distribution and version of Windows, you might need to get the ntfs-4g package in order to mount the disk. It looks like you wanted to mount it readonly and that you expect it to be ntfs3 based on your fstab entry.



                  mount -o ro /dev/sdbX /media/Microsoft



                  For the second part of the question you should have several options depending on what you want to do. You can make a normal file systems with mkfs or you could create a logical volume. If you have a modern installation of a recent linux distribution then your system is more than likely using LVM - you can check with the command "vgs". If you receive output with details about a volume group then LVM is in place. You could add the disk to LVM to expand your existing partitions or create a new, independent disk that is mounted somewhere separately.






                  share|improve this answer













                  Depending on who set up the old Windows machine (ie: if it's from HP, Lenovo, etc) you may have many different partitions on the disk that you normally wouldn't see with Windows. Those partitions might include recovery, unused space, etc. As mentioned in the answer above, use fdisk to see the partitions.



                  fdisk -l /dev/sdb



                  Using that information you can find out which partition is where the files you need are located. The largest partition is probably the one you want.



                  Depending on your distribution and version of Windows, you might need to get the ntfs-4g package in order to mount the disk. It looks like you wanted to mount it readonly and that you expect it to be ntfs3 based on your fstab entry.



                  mount -o ro /dev/sdbX /media/Microsoft



                  For the second part of the question you should have several options depending on what you want to do. You can make a normal file systems with mkfs or you could create a logical volume. If you have a modern installation of a recent linux distribution then your system is more than likely using LVM - you can check with the command "vgs". If you receive output with details about a volume group then LVM is in place. You could add the disk to LVM to expand your existing partitions or create a new, independent disk that is mounted somewhere separately.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Oct 25 '13 at 21:06









                  tamarintechtamarintech

                  34014




                  34014























                      3














                      Find the partitions of /dev/sdb,and mount the right one which contain files you need to backup.Try below to list partitions of /dev/sdb:



                      sudo fdisk -l /dev/sdb


                      No need to edit /etc/fstab to mount.Just use the command like this.(man mount)



                      sudo mount -t type device dir


                      You need to specify the type,maybe ntfs or vfat,cause it is windows partitions.



                      After that create partition using fdisk/gparted,then build filesystem using mkfs,mkfs.ext3,mkfs.ext4,anything you need.






                      share|improve this answer



























                        3














                        Find the partitions of /dev/sdb,and mount the right one which contain files you need to backup.Try below to list partitions of /dev/sdb:



                        sudo fdisk -l /dev/sdb


                        No need to edit /etc/fstab to mount.Just use the command like this.(man mount)



                        sudo mount -t type device dir


                        You need to specify the type,maybe ntfs or vfat,cause it is windows partitions.



                        After that create partition using fdisk/gparted,then build filesystem using mkfs,mkfs.ext3,mkfs.ext4,anything you need.






                        share|improve this answer

























                          3












                          3








                          3







                          Find the partitions of /dev/sdb,and mount the right one which contain files you need to backup.Try below to list partitions of /dev/sdb:



                          sudo fdisk -l /dev/sdb


                          No need to edit /etc/fstab to mount.Just use the command like this.(man mount)



                          sudo mount -t type device dir


                          You need to specify the type,maybe ntfs or vfat,cause it is windows partitions.



                          After that create partition using fdisk/gparted,then build filesystem using mkfs,mkfs.ext3,mkfs.ext4,anything you need.






                          share|improve this answer













                          Find the partitions of /dev/sdb,and mount the right one which contain files you need to backup.Try below to list partitions of /dev/sdb:



                          sudo fdisk -l /dev/sdb


                          No need to edit /etc/fstab to mount.Just use the command like this.(man mount)



                          sudo mount -t type device dir


                          You need to specify the type,maybe ntfs or vfat,cause it is windows partitions.



                          After that create partition using fdisk/gparted,then build filesystem using mkfs,mkfs.ext3,mkfs.ext4,anything you need.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Oct 25 '13 at 20:34









                          mnorsmnors

                          413




                          413





















                              1














                              firt mount the partition by:



                              sudo fdisk -l or mount

                              sudo umount /dev/sdb1

                              sudo mkfs.vfat -n usbname -I /dev/sdb1


                              or



                              sudo mkntfs /dev/sdb1


                              or any format for example .ext3, .ext4 and ...






                              share|improve this answer

























                              • The question asked how to make the disk usable primarily by a Linux system, so suggesting Windows file systems may not be the most useful advice...

                                – dhag
                                Apr 17 '15 at 15:51















                              1














                              firt mount the partition by:



                              sudo fdisk -l or mount

                              sudo umount /dev/sdb1

                              sudo mkfs.vfat -n usbname -I /dev/sdb1


                              or



                              sudo mkntfs /dev/sdb1


                              or any format for example .ext3, .ext4 and ...






                              share|improve this answer

























                              • The question asked how to make the disk usable primarily by a Linux system, so suggesting Windows file systems may not be the most useful advice...

                                – dhag
                                Apr 17 '15 at 15:51













                              1












                              1








                              1







                              firt mount the partition by:



                              sudo fdisk -l or mount

                              sudo umount /dev/sdb1

                              sudo mkfs.vfat -n usbname -I /dev/sdb1


                              or



                              sudo mkntfs /dev/sdb1


                              or any format for example .ext3, .ext4 and ...






                              share|improve this answer















                              firt mount the partition by:



                              sudo fdisk -l or mount

                              sudo umount /dev/sdb1

                              sudo mkfs.vfat -n usbname -I /dev/sdb1


                              or



                              sudo mkntfs /dev/sdb1


                              or any format for example .ext3, .ext4 and ...







                              share|improve this answer














                              share|improve this answer



                              share|improve this answer








                              edited Apr 17 '15 at 15:48

























                              answered Apr 17 '15 at 15:41









                              MohsenMohsen

                              112




                              112












                              • The question asked how to make the disk usable primarily by a Linux system, so suggesting Windows file systems may not be the most useful advice...

                                – dhag
                                Apr 17 '15 at 15:51

















                              • The question asked how to make the disk usable primarily by a Linux system, so suggesting Windows file systems may not be the most useful advice...

                                – dhag
                                Apr 17 '15 at 15:51
















                              The question asked how to make the disk usable primarily by a Linux system, so suggesting Windows file systems may not be the most useful advice...

                              – dhag
                              Apr 17 '15 at 15:51





                              The question asked how to make the disk usable primarily by a Linux system, so suggesting Windows file systems may not be the most useful advice...

                              – dhag
                              Apr 17 '15 at 15:51

















                              draft saved

                              draft discarded
















































                              Thanks for contributing an answer to Unix & Linux Stack Exchange!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid


                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.

                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f97623%2fformat-windows-ntfs-hard-drive-on-ubuntu-using-command-line%23new-answer', 'question_page');

                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown






                              Popular posts from this blog

                              How to check contact read email or not when send email to Individual?

                              Bahrain

                              Postfix configuration issue with fips on centos 7; mailgun relay