How can I copy three partitions of my disk with a specific beginning and ending using dd?

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

3

Using the fdisk -l command I got the following answer:

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048    28266495    14132224   27  Hidden NTFS WinRE
/dev/sda2        28268544    28473343      102400    7  HPFS/NTFS/exFAT
/dev/sda3        28473344   132552703    52039680    7  HPFS/NTFS/exFAT
/dev/sda4   *   132556798   625141759   246292481    5  Extended
/dev/sda5       193996800   198092799     2048000   82  Linux swap / Solaris
/dev/sda6       234960896   625141759   195090432    7  HPFS/NTFS/exFAT
/dev/sda7       198094848   234950316    18427734+  83  Linux
/dev/sda8       132556800   183756018    25599609+  83  Linux

I’d like to copy the three first partitions of my disk in an image using the dd command. So I mounted an external hard drive, entered in its folder and typed:

# dd count=$((132552703-2048)) if=/dev/sda of=./newImage.image

But this command copied all the sda disk to my external hard drive instead of just copying until the end of the sda3 partition.

How can I use the dd to create an image that starts at the beginning of sda1 and finishes at the end of sda3?

share|improve this question

  • try with dd bs=2048 count=$(( (132552703-2048)/204)) your other arg

    – Archemar
    Jul 12 ’15 at 5:31

3

Using the fdisk -l command I got the following answer:

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048    28266495    14132224   27  Hidden NTFS WinRE
/dev/sda2        28268544    28473343      102400    7  HPFS/NTFS/exFAT
/dev/sda3        28473344   132552703    52039680    7  HPFS/NTFS/exFAT
/dev/sda4   *   132556798   625141759   246292481    5  Extended
/dev/sda5       193996800   198092799     2048000   82  Linux swap / Solaris
/dev/sda6       234960896   625141759   195090432    7  HPFS/NTFS/exFAT
/dev/sda7       198094848   234950316    18427734+  83  Linux
/dev/sda8       132556800   183756018    25599609+  83  Linux

I’d like to copy the three first partitions of my disk in an image using the dd command. So I mounted an external hard drive, entered in its folder and typed:

# dd count=$((132552703-2048)) if=/dev/sda of=./newImage.image

But this command copied all the sda disk to my external hard drive instead of just copying until the end of the sda3 partition.

How can I use the dd to create an image that starts at the beginning of sda1 and finishes at the end of sda3?

share|improve this question

  • try with dd bs=2048 count=$(( (132552703-2048)/204)) your other arg

    – Archemar
    Jul 12 ’15 at 5:31

3

3

3

0

Using the fdisk -l command I got the following answer:

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048    28266495    14132224   27  Hidden NTFS WinRE
/dev/sda2        28268544    28473343      102400    7  HPFS/NTFS/exFAT
/dev/sda3        28473344   132552703    52039680    7  HPFS/NTFS/exFAT
/dev/sda4   *   132556798   625141759   246292481    5  Extended
/dev/sda5       193996800   198092799     2048000   82  Linux swap / Solaris
/dev/sda6       234960896   625141759   195090432    7  HPFS/NTFS/exFAT
/dev/sda7       198094848   234950316    18427734+  83  Linux
/dev/sda8       132556800   183756018    25599609+  83  Linux

I’d like to copy the three first partitions of my disk in an image using the dd command. So I mounted an external hard drive, entered in its folder and typed:

# dd count=$((132552703-2048)) if=/dev/sda of=./newImage.image

But this command copied all the sda disk to my external hard drive instead of just copying until the end of the sda3 partition.

How can I use the dd to create an image that starts at the beginning of sda1 and finishes at the end of sda3?

share|improve this question

Using the fdisk -l command I got the following answer:

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048    28266495    14132224   27  Hidden NTFS WinRE
/dev/sda2        28268544    28473343      102400    7  HPFS/NTFS/exFAT
/dev/sda3        28473344   132552703    52039680    7  HPFS/NTFS/exFAT
/dev/sda4   *   132556798   625141759   246292481    5  Extended
/dev/sda5       193996800   198092799     2048000   82  Linux swap / Solaris
/dev/sda6       234960896   625141759   195090432    7  HPFS/NTFS/exFAT
/dev/sda7       198094848   234950316    18427734+  83  Linux
/dev/sda8       132556800   183756018    25599609+  83  Linux

I’d like to copy the three first partitions of my disk in an image using the dd command. So I mounted an external hard drive, entered in its folder and typed:

# dd count=$((132552703-2048)) if=/dev/sda of=./newImage.image

But this command copied all the sda disk to my external hard drive instead of just copying until the end of the sda3 partition.

How can I use the dd to create an image that starts at the beginning of sda1 and finishes at the end of sda3?

shell partition dd

share|improve this question

share|improve this question

share|improve this question

share|improve this question

edited Jan 27 at 19:08

Rafael Muynarsk

asked Jul 12 ’15 at 3:21

Rafael MuynarskRafael Muynarsk

427616

427616

  • try with dd bs=2048 count=$(( (132552703-2048)/204)) your other arg

    – Archemar
    Jul 12 ’15 at 5:31

  • try with dd bs=2048 count=$(( (132552703-2048)/204)) your other arg

    – Archemar
    Jul 12 ’15 at 5:31

try with dd bs=2048 count=$(( (132552703-2048)/204)) your other arg

– Archemar
Jul 12 ’15 at 5:31

try with dd bs=2048 count=$(( (132552703-2048)/204)) your other arg

– Archemar
Jul 12 ’15 at 5:31

3 Answers
3

active

oldest

votes

3

first of all, here’s how:


  1. First do almost as you did before, but no subtraction – and add one to the count.

    dd  count=132552704 </dev/sda >img
    
  2. Next print the partition table at a sed process which can screen out the ones which you’re removing.

    • sed will write a delete command to a second fdisk which has opened your img file for every partition from sda4 and on.

      fdisk -l img | sed -e'/sda4 /,$id' -e'g;$aw' | fdisk img
      
  3. There is no 3. You’re done.


secondly, here’s why:


  • A Partial Success…

    • I’m pretty sure your command almost worked, but I’m willing to bet that it worked better than you think.

    • I expect that when you say it copied all of sda you believe that because an fdisk -l of that image indicated all of the partitions were included within. Based on the dd command in your question, though, provided /dev/sda‘s sector size is the fairly standard 512 bytes (and therefore identical to dd‘s default blocksize) then you should have copied everything from byte 0 of /dev/sda only through to all but the last 2k sectors of /dev/sda3.

  • About Sectors…

    • You can see below where the fdisk output reports on Units. That is the size of each sector that fdisk reports on. A disk sector might be 4096-bytes – if it is a very recently manufactured disk and handles the Advanced Format sector-size – otherwise it is very rare to find a disk not partitioned on a standard logical 512-byte sector-size.

    • This is how fdisk‘s man page puts it:

    • -u, --units[=unit]

      • When listing partition tables, show sizes in sectors or in cylinders. The default is to show sizes in sectors. For backward compatibility, it is possible to use the option without the unit argument – then the default is used. Note that the optional unit argument cannot be separated from the -u option by a space, the correct form is for example -u=cylinders.
    • There’s more on this here.

  • And something about dd, too…

    • dd cannot silently lose data. In fact, if a short read occurs, dd is specified to be very vocal about it:

    • A partial input block is one for which read() returned less than the input block size. A partial output block is one that was written with fewer bytes than specified by the output block size…

    • …when there is at least one truncated block, the number of truncated blocks shall be written to standard error…

    • "%u truncated %sn", <number of truncated blocks>, "record[s]"

  • Block i/o…

    • But anyway, that actually can’t happen with block-device i/o. It’s what makes a block-device a block-device – there’s an extra layer (sometimes several) of buffered protection for block-devices as opposed to character devices. It is this distinction which enables POSIX to guarantee lseek() for files existing on block-devices – it’s a very basic principle of blocked i/o.
  • To sum up…

    • And so you have copied all of your device up to the point you specified, but the thing is, the first 2k sectors of /dev/sda will contain its entire partition table, and as such you would have copied said partition table to your image, and so an fdisk -l of your image would report for all partitions of /dev/sda, whether or not the data for those partitions actually resides within that image-file. You can, instead, of course, just cat the separate data partitions separately into separate image files if you like – but in that case you lose the partition table entirely. All you really have to do is delete the partitions which you did not copy, and make sure you copy all of those you do.

third, here’s how I know:


  • This will create an 4G ./img file full of NULs.

    </dev/zero >./img 
    dd ibs=8k obs=8kx1b count=1kx1b 
    

    524288+0 records in
    1024+0 records out
    4294967296 bytes (4.3 GB) copied, 3.53287 s, 1.2 GB/s
    
  • This will partition ./img to match your disk up to the first three partitions but on a 1/16th scale:

    (set "$((p=0))" 28266495     27 
          28268544  28473343  2\n7 
          28473344 132552703  3\n7
    while   [ "$#" -ge "$((p+=1))" ]
    do      printf "nnpn$pn%.0dn%dntn%bn" 
                   "$(($1/16))" "$(($2/16))" "$3"
            shift 3
    done;   echo w
    )| fdisk ./img >/dev/null
    
  • And so now we can look at it.

    fdisk -l ./img
    

    Disk ./img: 4 GiB, 4294967296 bytes, 8388608 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: dos
    Disk identifier: 0x5659b81c
    
    Device     Boot   Start     End Sectors   Size Id Type
    ./img1             2048 1766655 1764608 861.6M 27 Hidden NTFS WinRE
    ./img2          1766784 1779583   12800   6.3M  7 HPFS/NTFS/exFAT
    ./img3          1779584 8284543 6504960   3.1G  7 HPFS/NTFS/exFAT
    
  • I’ll also put some actual filesystems and files on the three partitions.

    sudo sh -c ' trap "$1" 0
        cd /tmp; mkdir -p mnt
        for p in "$(losetup --show -Pf "$0")p"*
        do    mkfs.vfat "$p"
              mount "$p" mnt
              echo  "my part# is ${p##*p}" 
                     >./mnt/"part${p##*p}"
              sync; umount mnt
        done' "$PWD/img" 'losetup -D'
    
  • Here are the byte offsets for where it all wound up…

    grep -Ebao '(my[^0-9]*|PART)[123]' <./img
    

    2826272:PART1
    2830336:my part# is 1
    904606240:PART2
    904624640:my part# is 2
    917656608:PART3
    917660672:my part# is 3
    

But did you notice that fdisk was perfectly happy to report on the partitions’ sizes before ever we formatted them with filesystems? This is because the partition table lies at the very head of the disk – it’s only a layout and nothing more. None of the partitions need actually exist to be reported. They’re only logically mapped out within the first 1M of ./img. Watch:

  • Let’s try getting only the first two partitions off of ./img

    <./img >./img2 dd count=1779583
    

    1779583+0 records in
    1779583+0 records out
    911146496 bytes (911 MB) copied, 1.84985 s, 493 MB/s
    
  • We’ll grep it again…

    grep -Ebao '(my[^0-9]*|PART)[123]' <./img2
    

    2826272:PART1
    2830336:my part# is 1
    904606240:PART2
    904624640:my part# is 2
    
  • And get an fdisk report…

    fdisk -l ./img2
    

    Disk ./img2: 869 MiB, 911146496 bytes, 1779583 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: dos
    Disk identifier: 0xcbcab4d8
    
    Device     Boot   Start     End Sectors   Size Id Type
    ./img2p1           2048 1766655 1764608 861.6M 27 Hidden NTFS WinRE
    ./img2p2        1766784 1779583   12800   6.3M  7 HPFS/NTFS/exFAT
    ./img2p3        1779584 8284543 6504960   3.1G  7 HPFS/NTFS/exFAT
    

Now that is curious. fdisk still seems to believe there’s a third partition extending as far out as 4G for a disk which it also seems to believe is only 869M in size!

  • Probably we should remove that third partition from the partition table.

    printf %s\n d 3 w |
    fdisk ./img2 >/dev/null
    
  • And now lets see if we can mount the partitions we copied and if our files remain in tact…

    sudo sh -c ' trap "$1" 0
        cd /tmp; mkdir -p mnt
        for p in "$(losetup --show -Pf "$0")p"*
        do    mount "$p" mnt
              grep . /dev/null ./mnt/*
              umount mnt
        done' "$PWD/img2" 'losetup -D'
    

    ./mnt/part1:my part# is 1
    ./mnt/part2:my part# is 2
    

Apparently it’s not impossible.

share|improve this answer

    0

    It isn’t possible because dd is only direct 1 input to 1 output –the restoration would be damage because you merged 3 partitions in one and this isn’t a backup and dd is only for identical copies.

    Your answer would be possible:

    dd if=/dev/sda1 of=~/hdadisk1.img; 
    dd if=/dev/sda2 of=~/hdadisk2.img
    dd if=/dev/sda3 of=~/hdadisk3.img 
    

    (In a script if you want) and finally, you can to create an image with the hdadisk{1,3,3}.img although is a better practice you save these images in a partition for backups.

    share|improve this answer

      0

      dd count=$((132552703-2048)) copies 132552703-2048 blocks of 512 bytes from the beginning of the input. The block size in fdisk is 1 kB = 1024 bytes. So you have three problems:

      • You specified a size that’s half what you wanted.
      • You didn’t indicate that you wanted to start the copy at an offset.
      • Your subtraction has a fencepost error: it misses the last block — the number of blocks is (end block offset) – (start block offset) + 1.

      So you can do that copy with

      dd bs=1k skip=2048 count=$((132552703-2048+1)) if=/dev/sda of=./newImage.image
      

      I think this will work — dd can silently lose data, but I think that 1kB blocks on a block device or regular file on Linux is fine. But it’s slow.

      The most straightforward way to copy a single partition would be to just copy it.

      cat /dev/sda1 >sda1.image
      cat /dev/sda2 >sda2.image
      cat /dev/sda3 >sda3.image
      

      It would be better to copy the partitions to separate files, because otherwise the partitions that aren’t at the beginning of the file will be hard to use. If you really want the three partitions in the same file, you can concatenate them:

      cat /dev/sda1 /dev/sda2 /dev/sda3 >newImage.image
      

      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’,
        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%2f215359%2fhow-can-i-copy-three-partitions-of-my-disk-with-a-specific-beginning-and-ending%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

        3

        first of all, here’s how:


        1. First do almost as you did before, but no subtraction – and add one to the count.

          dd  count=132552704 </dev/sda >img
          
        2. Next print the partition table at a sed process which can screen out the ones which you’re removing.

          • sed will write a delete command to a second fdisk which has opened your img file for every partition from sda4 and on.

            fdisk -l img | sed -e'/sda4 /,$id' -e'g;$aw' | fdisk img
            
        3. There is no 3. You’re done.


        secondly, here’s why:


        • A Partial Success…

          • I’m pretty sure your command almost worked, but I’m willing to bet that it worked better than you think.

          • I expect that when you say it copied all of sda you believe that because an fdisk -l of that image indicated all of the partitions were included within. Based on the dd command in your question, though, provided /dev/sda‘s sector size is the fairly standard 512 bytes (and therefore identical to dd‘s default blocksize) then you should have copied everything from byte 0 of /dev/sda only through to all but the last 2k sectors of /dev/sda3.

        • About Sectors…

          • You can see below where the fdisk output reports on Units. That is the size of each sector that fdisk reports on. A disk sector might be 4096-bytes – if it is a very recently manufactured disk and handles the Advanced Format sector-size – otherwise it is very rare to find a disk not partitioned on a standard logical 512-byte sector-size.

          • This is how fdisk‘s man page puts it:

          • -u, --units[=unit]

            • When listing partition tables, show sizes in sectors or in cylinders. The default is to show sizes in sectors. For backward compatibility, it is possible to use the option without the unit argument – then the default is used. Note that the optional unit argument cannot be separated from the -u option by a space, the correct form is for example -u=cylinders.
          • There’s more on this here.

        • And something about dd, too…

          • dd cannot silently lose data. In fact, if a short read occurs, dd is specified to be very vocal about it:

          • A partial input block is one for which read() returned less than the input block size. A partial output block is one that was written with fewer bytes than specified by the output block size…

          • …when there is at least one truncated block, the number of truncated blocks shall be written to standard error…

          • "%u truncated %sn", <number of truncated blocks>, "record[s]"

        • Block i/o…

          • But anyway, that actually can’t happen with block-device i/o. It’s what makes a block-device a block-device – there’s an extra layer (sometimes several) of buffered protection for block-devices as opposed to character devices. It is this distinction which enables POSIX to guarantee lseek() for files existing on block-devices – it’s a very basic principle of blocked i/o.
        • To sum up…

          • And so you have copied all of your device up to the point you specified, but the thing is, the first 2k sectors of /dev/sda will contain its entire partition table, and as such you would have copied said partition table to your image, and so an fdisk -l of your image would report for all partitions of /dev/sda, whether or not the data for those partitions actually resides within that image-file. You can, instead, of course, just cat the separate data partitions separately into separate image files if you like – but in that case you lose the partition table entirely. All you really have to do is delete the partitions which you did not copy, and make sure you copy all of those you do.

        third, here’s how I know:


        • This will create an 4G ./img file full of NULs.

          </dev/zero >./img 
          dd ibs=8k obs=8kx1b count=1kx1b 
          

          524288+0 records in
          1024+0 records out
          4294967296 bytes (4.3 GB) copied, 3.53287 s, 1.2 GB/s
          
        • This will partition ./img to match your disk up to the first three partitions but on a 1/16th scale:

          (set "$((p=0))" 28266495     27 
                28268544  28473343  2\n7 
                28473344 132552703  3\n7
          while   [ "$#" -ge "$((p+=1))" ]
          do      printf "nnpn$pn%.0dn%dntn%bn" 
                         "$(($1/16))" "$(($2/16))" "$3"
                  shift 3
          done;   echo w
          )| fdisk ./img >/dev/null
          
        • And so now we can look at it.

          fdisk -l ./img
          

          Disk ./img: 4 GiB, 4294967296 bytes, 8388608 sectors
          Units: sectors of 1 * 512 = 512 bytes
          Sector size (logical/physical): 512 bytes / 512 bytes
          I/O size (minimum/optimal): 512 bytes / 512 bytes
          Disklabel type: dos
          Disk identifier: 0x5659b81c
          
          Device     Boot   Start     End Sectors   Size Id Type
          ./img1             2048 1766655 1764608 861.6M 27 Hidden NTFS WinRE
          ./img2          1766784 1779583   12800   6.3M  7 HPFS/NTFS/exFAT
          ./img3          1779584 8284543 6504960   3.1G  7 HPFS/NTFS/exFAT
          
        • I’ll also put some actual filesystems and files on the three partitions.

          sudo sh -c ' trap "$1" 0
              cd /tmp; mkdir -p mnt
              for p in "$(losetup --show -Pf "$0")p"*
              do    mkfs.vfat "$p"
                    mount "$p" mnt
                    echo  "my part# is ${p##*p}" 
                           >./mnt/"part${p##*p}"
                    sync; umount mnt
              done' "$PWD/img" 'losetup -D'
          
        • Here are the byte offsets for where it all wound up…

          grep -Ebao '(my[^0-9]*|PART)[123]' <./img
          

          2826272:PART1
          2830336:my part# is 1
          904606240:PART2
          904624640:my part# is 2
          917656608:PART3
          917660672:my part# is 3
          

        But did you notice that fdisk was perfectly happy to report on the partitions’ sizes before ever we formatted them with filesystems? This is because the partition table lies at the very head of the disk – it’s only a layout and nothing more. None of the partitions need actually exist to be reported. They’re only logically mapped out within the first 1M of ./img. Watch:

        • Let’s try getting only the first two partitions off of ./img

          <./img >./img2 dd count=1779583
          

          1779583+0 records in
          1779583+0 records out
          911146496 bytes (911 MB) copied, 1.84985 s, 493 MB/s
          
        • We’ll grep it again…

          grep -Ebao '(my[^0-9]*|PART)[123]' <./img2
          

          2826272:PART1
          2830336:my part# is 1
          904606240:PART2
          904624640:my part# is 2
          
        • And get an fdisk report…

          fdisk -l ./img2
          

          Disk ./img2: 869 MiB, 911146496 bytes, 1779583 sectors
          Units: sectors of 1 * 512 = 512 bytes
          Sector size (logical/physical): 512 bytes / 512 bytes
          I/O size (minimum/optimal): 512 bytes / 512 bytes
          Disklabel type: dos
          Disk identifier: 0xcbcab4d8
          
          Device     Boot   Start     End Sectors   Size Id Type
          ./img2p1           2048 1766655 1764608 861.6M 27 Hidden NTFS WinRE
          ./img2p2        1766784 1779583   12800   6.3M  7 HPFS/NTFS/exFAT
          ./img2p3        1779584 8284543 6504960   3.1G  7 HPFS/NTFS/exFAT
          

        Now that is curious. fdisk still seems to believe there’s a third partition extending as far out as 4G for a disk which it also seems to believe is only 869M in size!

        • Probably we should remove that third partition from the partition table.

          printf %s\n d 3 w |
          fdisk ./img2 >/dev/null
          
        • And now lets see if we can mount the partitions we copied and if our files remain in tact…

          sudo sh -c ' trap "$1" 0
              cd /tmp; mkdir -p mnt
              for p in "$(losetup --show -Pf "$0")p"*
              do    mount "$p" mnt
                    grep . /dev/null ./mnt/*
                    umount mnt
              done' "$PWD/img2" 'losetup -D'
          

          ./mnt/part1:my part# is 1
          ./mnt/part2:my part# is 2
          

        Apparently it’s not impossible.

        share|improve this answer

          3

          first of all, here’s how:


          1. First do almost as you did before, but no subtraction – and add one to the count.

            dd  count=132552704 </dev/sda >img
            
          2. Next print the partition table at a sed process which can screen out the ones which you’re removing.

            • sed will write a delete command to a second fdisk which has opened your img file for every partition from sda4 and on.

              fdisk -l img | sed -e'/sda4 /,$id' -e'g;$aw' | fdisk img
              
          3. There is no 3. You’re done.


          secondly, here’s why:


          • A Partial Success…

            • I’m pretty sure your command almost worked, but I’m willing to bet that it worked better than you think.

            • I expect that when you say it copied all of sda you believe that because an fdisk -l of that image indicated all of the partitions were included within. Based on the dd command in your question, though, provided /dev/sda‘s sector size is the fairly standard 512 bytes (and therefore identical to dd‘s default blocksize) then you should have copied everything from byte 0 of /dev/sda only through to all but the last 2k sectors of /dev/sda3.

          • About Sectors…

            • You can see below where the fdisk output reports on Units. That is the size of each sector that fdisk reports on. A disk sector might be 4096-bytes – if it is a very recently manufactured disk and handles the Advanced Format sector-size – otherwise it is very rare to find a disk not partitioned on a standard logical 512-byte sector-size.

            • This is how fdisk‘s man page puts it:

            • -u, --units[=unit]

              • When listing partition tables, show sizes in sectors or in cylinders. The default is to show sizes in sectors. For backward compatibility, it is possible to use the option without the unit argument – then the default is used. Note that the optional unit argument cannot be separated from the -u option by a space, the correct form is for example -u=cylinders.
            • There’s more on this here.

          • And something about dd, too…

            • dd cannot silently lose data. In fact, if a short read occurs, dd is specified to be very vocal about it:

            • A partial input block is one for which read() returned less than the input block size. A partial output block is one that was written with fewer bytes than specified by the output block size…

            • …when there is at least one truncated block, the number of truncated blocks shall be written to standard error…

            • "%u truncated %sn", <number of truncated blocks>, "record[s]"

          • Block i/o…

            • But anyway, that actually can’t happen with block-device i/o. It’s what makes a block-device a block-device – there’s an extra layer (sometimes several) of buffered protection for block-devices as opposed to character devices. It is this distinction which enables POSIX to guarantee lseek() for files existing on block-devices – it’s a very basic principle of blocked i/o.
          • To sum up…

            • And so you have copied all of your device up to the point you specified, but the thing is, the first 2k sectors of /dev/sda will contain its entire partition table, and as such you would have copied said partition table to your image, and so an fdisk -l of your image would report for all partitions of /dev/sda, whether or not the data for those partitions actually resides within that image-file. You can, instead, of course, just cat the separate data partitions separately into separate image files if you like – but in that case you lose the partition table entirely. All you really have to do is delete the partitions which you did not copy, and make sure you copy all of those you do.

          third, here’s how I know:


          • This will create an 4G ./img file full of NULs.

            </dev/zero >./img 
            dd ibs=8k obs=8kx1b count=1kx1b 
            

            524288+0 records in
            1024+0 records out
            4294967296 bytes (4.3 GB) copied, 3.53287 s, 1.2 GB/s
            
          • This will partition ./img to match your disk up to the first three partitions but on a 1/16th scale:

            (set "$((p=0))" 28266495     27 
                  28268544  28473343  2\n7 
                  28473344 132552703  3\n7
            while   [ "$#" -ge "$((p+=1))" ]
            do      printf "nnpn$pn%.0dn%dntn%bn" 
                           "$(($1/16))" "$(($2/16))" "$3"
                    shift 3
            done;   echo w
            )| fdisk ./img >/dev/null
            
          • And so now we can look at it.

            fdisk -l ./img
            

            Disk ./img: 4 GiB, 4294967296 bytes, 8388608 sectors
            Units: sectors of 1 * 512 = 512 bytes
            Sector size (logical/physical): 512 bytes / 512 bytes
            I/O size (minimum/optimal): 512 bytes / 512 bytes
            Disklabel type: dos
            Disk identifier: 0x5659b81c
            
            Device     Boot   Start     End Sectors   Size Id Type
            ./img1             2048 1766655 1764608 861.6M 27 Hidden NTFS WinRE
            ./img2          1766784 1779583   12800   6.3M  7 HPFS/NTFS/exFAT
            ./img3          1779584 8284543 6504960   3.1G  7 HPFS/NTFS/exFAT
            
          • I’ll also put some actual filesystems and files on the three partitions.

            sudo sh -c ' trap "$1" 0
                cd /tmp; mkdir -p mnt
                for p in "$(losetup --show -Pf "$0")p"*
                do    mkfs.vfat "$p"
                      mount "$p" mnt
                      echo  "my part# is ${p##*p}" 
                             >./mnt/"part${p##*p}"
                      sync; umount mnt
                done' "$PWD/img" 'losetup -D'
            
          • Here are the byte offsets for where it all wound up…

            grep -Ebao '(my[^0-9]*|PART)[123]' <./img
            

            2826272:PART1
            2830336:my part# is 1
            904606240:PART2
            904624640:my part# is 2
            917656608:PART3
            917660672:my part# is 3
            

          But did you notice that fdisk was perfectly happy to report on the partitions’ sizes before ever we formatted them with filesystems? This is because the partition table lies at the very head of the disk – it’s only a layout and nothing more. None of the partitions need actually exist to be reported. They’re only logically mapped out within the first 1M of ./img. Watch:

          • Let’s try getting only the first two partitions off of ./img

            <./img >./img2 dd count=1779583
            

            1779583+0 records in
            1779583+0 records out
            911146496 bytes (911 MB) copied, 1.84985 s, 493 MB/s
            
          • We’ll grep it again…

            grep -Ebao '(my[^0-9]*|PART)[123]' <./img2
            

            2826272:PART1
            2830336:my part# is 1
            904606240:PART2
            904624640:my part# is 2
            
          • And get an fdisk report…

            fdisk -l ./img2
            

            Disk ./img2: 869 MiB, 911146496 bytes, 1779583 sectors
            Units: sectors of 1 * 512 = 512 bytes
            Sector size (logical/physical): 512 bytes / 512 bytes
            I/O size (minimum/optimal): 512 bytes / 512 bytes
            Disklabel type: dos
            Disk identifier: 0xcbcab4d8
            
            Device     Boot   Start     End Sectors   Size Id Type
            ./img2p1           2048 1766655 1764608 861.6M 27 Hidden NTFS WinRE
            ./img2p2        1766784 1779583   12800   6.3M  7 HPFS/NTFS/exFAT
            ./img2p3        1779584 8284543 6504960   3.1G  7 HPFS/NTFS/exFAT
            

          Now that is curious. fdisk still seems to believe there’s a third partition extending as far out as 4G for a disk which it also seems to believe is only 869M in size!

          • Probably we should remove that third partition from the partition table.

            printf %s\n d 3 w |
            fdisk ./img2 >/dev/null
            
          • And now lets see if we can mount the partitions we copied and if our files remain in tact…

            sudo sh -c ' trap "$1" 0
                cd /tmp; mkdir -p mnt
                for p in "$(losetup --show -Pf "$0")p"*
                do    mount "$p" mnt
                      grep . /dev/null ./mnt/*
                      umount mnt
                done' "$PWD/img2" 'losetup -D'
            

            ./mnt/part1:my part# is 1
            ./mnt/part2:my part# is 2
            

          Apparently it’s not impossible.

          share|improve this answer

            3

            3

            3

            first of all, here’s how:


            1. First do almost as you did before, but no subtraction – and add one to the count.

              dd  count=132552704 </dev/sda >img
              
            2. Next print the partition table at a sed process which can screen out the ones which you’re removing.

              • sed will write a delete command to a second fdisk which has opened your img file for every partition from sda4 and on.

                fdisk -l img | sed -e'/sda4 /,$id' -e'g;$aw' | fdisk img
                
            3. There is no 3. You’re done.


            secondly, here’s why:


            • A Partial Success…

              • I’m pretty sure your command almost worked, but I’m willing to bet that it worked better than you think.

              • I expect that when you say it copied all of sda you believe that because an fdisk -l of that image indicated all of the partitions were included within. Based on the dd command in your question, though, provided /dev/sda‘s sector size is the fairly standard 512 bytes (and therefore identical to dd‘s default blocksize) then you should have copied everything from byte 0 of /dev/sda only through to all but the last 2k sectors of /dev/sda3.

            • About Sectors…

              • You can see below where the fdisk output reports on Units. That is the size of each sector that fdisk reports on. A disk sector might be 4096-bytes – if it is a very recently manufactured disk and handles the Advanced Format sector-size – otherwise it is very rare to find a disk not partitioned on a standard logical 512-byte sector-size.

              • This is how fdisk‘s man page puts it:

              • -u, --units[=unit]

                • When listing partition tables, show sizes in sectors or in cylinders. The default is to show sizes in sectors. For backward compatibility, it is possible to use the option without the unit argument – then the default is used. Note that the optional unit argument cannot be separated from the -u option by a space, the correct form is for example -u=cylinders.
              • There’s more on this here.

            • And something about dd, too…

              • dd cannot silently lose data. In fact, if a short read occurs, dd is specified to be very vocal about it:

              • A partial input block is one for which read() returned less than the input block size. A partial output block is one that was written with fewer bytes than specified by the output block size…

              • …when there is at least one truncated block, the number of truncated blocks shall be written to standard error…

              • "%u truncated %sn", <number of truncated blocks>, "record[s]"

            • Block i/o…

              • But anyway, that actually can’t happen with block-device i/o. It’s what makes a block-device a block-device – there’s an extra layer (sometimes several) of buffered protection for block-devices as opposed to character devices. It is this distinction which enables POSIX to guarantee lseek() for files existing on block-devices – it’s a very basic principle of blocked i/o.
            • To sum up…

              • And so you have copied all of your device up to the point you specified, but the thing is, the first 2k sectors of /dev/sda will contain its entire partition table, and as such you would have copied said partition table to your image, and so an fdisk -l of your image would report for all partitions of /dev/sda, whether or not the data for those partitions actually resides within that image-file. You can, instead, of course, just cat the separate data partitions separately into separate image files if you like – but in that case you lose the partition table entirely. All you really have to do is delete the partitions which you did not copy, and make sure you copy all of those you do.

            third, here’s how I know:


            • This will create an 4G ./img file full of NULs.

              </dev/zero >./img 
              dd ibs=8k obs=8kx1b count=1kx1b 
              

              524288+0 records in
              1024+0 records out
              4294967296 bytes (4.3 GB) copied, 3.53287 s, 1.2 GB/s
              
            • This will partition ./img to match your disk up to the first three partitions but on a 1/16th scale:

              (set "$((p=0))" 28266495     27 
                    28268544  28473343  2\n7 
                    28473344 132552703  3\n7
              while   [ "$#" -ge "$((p+=1))" ]
              do      printf "nnpn$pn%.0dn%dntn%bn" 
                             "$(($1/16))" "$(($2/16))" "$3"
                      shift 3
              done;   echo w
              )| fdisk ./img >/dev/null
              
            • And so now we can look at it.

              fdisk -l ./img
              

              Disk ./img: 4 GiB, 4294967296 bytes, 8388608 sectors
              Units: sectors of 1 * 512 = 512 bytes
              Sector size (logical/physical): 512 bytes / 512 bytes
              I/O size (minimum/optimal): 512 bytes / 512 bytes
              Disklabel type: dos
              Disk identifier: 0x5659b81c
              
              Device     Boot   Start     End Sectors   Size Id Type
              ./img1             2048 1766655 1764608 861.6M 27 Hidden NTFS WinRE
              ./img2          1766784 1779583   12800   6.3M  7 HPFS/NTFS/exFAT
              ./img3          1779584 8284543 6504960   3.1G  7 HPFS/NTFS/exFAT
              
            • I’ll also put some actual filesystems and files on the three partitions.

              sudo sh -c ' trap "$1" 0
                  cd /tmp; mkdir -p mnt
                  for p in "$(losetup --show -Pf "$0")p"*
                  do    mkfs.vfat "$p"
                        mount "$p" mnt
                        echo  "my part# is ${p##*p}" 
                               >./mnt/"part${p##*p}"
                        sync; umount mnt
                  done' "$PWD/img" 'losetup -D'
              
            • Here are the byte offsets for where it all wound up…

              grep -Ebao '(my[^0-9]*|PART)[123]' <./img
              

              2826272:PART1
              2830336:my part# is 1
              904606240:PART2
              904624640:my part# is 2
              917656608:PART3
              917660672:my part# is 3
              

            But did you notice that fdisk was perfectly happy to report on the partitions’ sizes before ever we formatted them with filesystems? This is because the partition table lies at the very head of the disk – it’s only a layout and nothing more. None of the partitions need actually exist to be reported. They’re only logically mapped out within the first 1M of ./img. Watch:

            • Let’s try getting only the first two partitions off of ./img

              <./img >./img2 dd count=1779583
              

              1779583+0 records in
              1779583+0 records out
              911146496 bytes (911 MB) copied, 1.84985 s, 493 MB/s
              
            • We’ll grep it again…

              grep -Ebao '(my[^0-9]*|PART)[123]' <./img2
              

              2826272:PART1
              2830336:my part# is 1
              904606240:PART2
              904624640:my part# is 2
              
            • And get an fdisk report…

              fdisk -l ./img2
              

              Disk ./img2: 869 MiB, 911146496 bytes, 1779583 sectors
              Units: sectors of 1 * 512 = 512 bytes
              Sector size (logical/physical): 512 bytes / 512 bytes
              I/O size (minimum/optimal): 512 bytes / 512 bytes
              Disklabel type: dos
              Disk identifier: 0xcbcab4d8
              
              Device     Boot   Start     End Sectors   Size Id Type
              ./img2p1           2048 1766655 1764608 861.6M 27 Hidden NTFS WinRE
              ./img2p2        1766784 1779583   12800   6.3M  7 HPFS/NTFS/exFAT
              ./img2p3        1779584 8284543 6504960   3.1G  7 HPFS/NTFS/exFAT
              

            Now that is curious. fdisk still seems to believe there’s a third partition extending as far out as 4G for a disk which it also seems to believe is only 869M in size!

            • Probably we should remove that third partition from the partition table.

              printf %s\n d 3 w |
              fdisk ./img2 >/dev/null
              
            • And now lets see if we can mount the partitions we copied and if our files remain in tact…

              sudo sh -c ' trap "$1" 0
                  cd /tmp; mkdir -p mnt
                  for p in "$(losetup --show -Pf "$0")p"*
                  do    mount "$p" mnt
                        grep . /dev/null ./mnt/*
                        umount mnt
                  done' "$PWD/img2" 'losetup -D'
              

              ./mnt/part1:my part# is 1
              ./mnt/part2:my part# is 2
              

            Apparently it’s not impossible.

            share|improve this answer

            first of all, here’s how:


            1. First do almost as you did before, but no subtraction – and add one to the count.

              dd  count=132552704 </dev/sda >img
              
            2. Next print the partition table at a sed process which can screen out the ones which you’re removing.

              • sed will write a delete command to a second fdisk which has opened your img file for every partition from sda4 and on.

                fdisk -l img | sed -e'/sda4 /,$id' -e'g;$aw' | fdisk img
                
            3. There is no 3. You’re done.


            secondly, here’s why:


            • A Partial Success…

              • I’m pretty sure your command almost worked, but I’m willing to bet that it worked better than you think.

              • I expect that when you say it copied all of sda you believe that because an fdisk -l of that image indicated all of the partitions were included within. Based on the dd command in your question, though, provided /dev/sda‘s sector size is the fairly standard 512 bytes (and therefore identical to dd‘s default blocksize) then you should have copied everything from byte 0 of /dev/sda only through to all but the last 2k sectors of /dev/sda3.

            • About Sectors…

              • You can see below where the fdisk output reports on Units. That is the size of each sector that fdisk reports on. A disk sector might be 4096-bytes – if it is a very recently manufactured disk and handles the Advanced Format sector-size – otherwise it is very rare to find a disk not partitioned on a standard logical 512-byte sector-size.

              • This is how fdisk‘s man page puts it:

              • -u, --units[=unit]

                • When listing partition tables, show sizes in sectors or in cylinders. The default is to show sizes in sectors. For backward compatibility, it is possible to use the option without the unit argument – then the default is used. Note that the optional unit argument cannot be separated from the -u option by a space, the correct form is for example -u=cylinders.
              • There’s more on this here.

            • And something about dd, too…

              • dd cannot silently lose data. In fact, if a short read occurs, dd is specified to be very vocal about it:

              • A partial input block is one for which read() returned less than the input block size. A partial output block is one that was written with fewer bytes than specified by the output block size…

              • …when there is at least one truncated block, the number of truncated blocks shall be written to standard error…

              • "%u truncated %sn", <number of truncated blocks>, "record[s]"

            • Block i/o…

              • But anyway, that actually can’t happen with block-device i/o. It’s what makes a block-device a block-device – there’s an extra layer (sometimes several) of buffered protection for block-devices as opposed to character devices. It is this distinction which enables POSIX to guarantee lseek() for files existing on block-devices – it’s a very basic principle of blocked i/o.
            • To sum up…

              • And so you have copied all of your device up to the point you specified, but the thing is, the first 2k sectors of /dev/sda will contain its entire partition table, and as such you would have copied said partition table to your image, and so an fdisk -l of your image would report for all partitions of /dev/sda, whether or not the data for those partitions actually resides within that image-file. You can, instead, of course, just cat the separate data partitions separately into separate image files if you like – but in that case you lose the partition table entirely. All you really have to do is delete the partitions which you did not copy, and make sure you copy all of those you do.

            third, here’s how I know:


            • This will create an 4G ./img file full of NULs.

              </dev/zero >./img 
              dd ibs=8k obs=8kx1b count=1kx1b 
              

              524288+0 records in
              1024+0 records out
              4294967296 bytes (4.3 GB) copied, 3.53287 s, 1.2 GB/s
              
            • This will partition ./img to match your disk up to the first three partitions but on a 1/16th scale:

              (set "$((p=0))" 28266495     27 
                    28268544  28473343  2\n7 
                    28473344 132552703  3\n7
              while   [ "$#" -ge "$((p+=1))" ]
              do      printf "nnpn$pn%.0dn%dntn%bn" 
                             "$(($1/16))" "$(($2/16))" "$3"
                      shift 3
              done;   echo w
              )| fdisk ./img >/dev/null
              
            • And so now we can look at it.

              fdisk -l ./img
              

              Disk ./img: 4 GiB, 4294967296 bytes, 8388608 sectors
              Units: sectors of 1 * 512 = 512 bytes
              Sector size (logical/physical): 512 bytes / 512 bytes
              I/O size (minimum/optimal): 512 bytes / 512 bytes
              Disklabel type: dos
              Disk identifier: 0x5659b81c
              
              Device     Boot   Start     End Sectors   Size Id Type
              ./img1             2048 1766655 1764608 861.6M 27 Hidden NTFS WinRE
              ./img2          1766784 1779583   12800   6.3M  7 HPFS/NTFS/exFAT
              ./img3          1779584 8284543 6504960   3.1G  7 HPFS/NTFS/exFAT
              
            • I’ll also put some actual filesystems and files on the three partitions.

              sudo sh -c ' trap "$1" 0
                  cd /tmp; mkdir -p mnt
                  for p in "$(losetup --show -Pf "$0")p"*
                  do    mkfs.vfat "$p"
                        mount "$p" mnt
                        echo  "my part# is ${p##*p}" 
                               >./mnt/"part${p##*p}"
                        sync; umount mnt
                  done' "$PWD/img" 'losetup -D'
              
            • Here are the byte offsets for where it all wound up…

              grep -Ebao '(my[^0-9]*|PART)[123]' <./img
              

              2826272:PART1
              2830336:my part# is 1
              904606240:PART2
              904624640:my part# is 2
              917656608:PART3
              917660672:my part# is 3
              

            But did you notice that fdisk was perfectly happy to report on the partitions’ sizes before ever we formatted them with filesystems? This is because the partition table lies at the very head of the disk – it’s only a layout and nothing more. None of the partitions need actually exist to be reported. They’re only logically mapped out within the first 1M of ./img. Watch:

            • Let’s try getting only the first two partitions off of ./img

              <./img >./img2 dd count=1779583
              

              1779583+0 records in
              1779583+0 records out
              911146496 bytes (911 MB) copied, 1.84985 s, 493 MB/s
              
            • We’ll grep it again…

              grep -Ebao '(my[^0-9]*|PART)[123]' <./img2
              

              2826272:PART1
              2830336:my part# is 1
              904606240:PART2
              904624640:my part# is 2
              
            • And get an fdisk report…

              fdisk -l ./img2
              

              Disk ./img2: 869 MiB, 911146496 bytes, 1779583 sectors
              Units: sectors of 1 * 512 = 512 bytes
              Sector size (logical/physical): 512 bytes / 512 bytes
              I/O size (minimum/optimal): 512 bytes / 512 bytes
              Disklabel type: dos
              Disk identifier: 0xcbcab4d8
              
              Device     Boot   Start     End Sectors   Size Id Type
              ./img2p1           2048 1766655 1764608 861.6M 27 Hidden NTFS WinRE
              ./img2p2        1766784 1779583   12800   6.3M  7 HPFS/NTFS/exFAT
              ./img2p3        1779584 8284543 6504960   3.1G  7 HPFS/NTFS/exFAT
              

            Now that is curious. fdisk still seems to believe there’s a third partition extending as far out as 4G for a disk which it also seems to believe is only 869M in size!

            • Probably we should remove that third partition from the partition table.

              printf %s\n d 3 w |
              fdisk ./img2 >/dev/null
              
            • And now lets see if we can mount the partitions we copied and if our files remain in tact…

              sudo sh -c ' trap "$1" 0
                  cd /tmp; mkdir -p mnt
                  for p in "$(losetup --show -Pf "$0")p"*
                  do    mount "$p" mnt
                        grep . /dev/null ./mnt/*
                        umount mnt
                  done' "$PWD/img2" 'losetup -D'
              

              ./mnt/part1:my part# is 1
              ./mnt/part2:my part# is 2
              

            Apparently it’s not impossible.

            share|improve this answer

            share|improve this answer

            share|improve this answer

            edited Apr 13 ’17 at 12:36

            Community

            1

            1

            answered Jul 12 ’15 at 13:03

            mikeservmikeserv

            45.7k668159

            45.7k668159

                0

                It isn’t possible because dd is only direct 1 input to 1 output –the restoration would be damage because you merged 3 partitions in one and this isn’t a backup and dd is only for identical copies.

                Your answer would be possible:

                dd if=/dev/sda1 of=~/hdadisk1.img; 
                dd if=/dev/sda2 of=~/hdadisk2.img
                dd if=/dev/sda3 of=~/hdadisk3.img 
                

                (In a script if you want) and finally, you can to create an image with the hdadisk{1,3,3}.img although is a better practice you save these images in a partition for backups.

                share|improve this answer

                  0

                  It isn’t possible because dd is only direct 1 input to 1 output –the restoration would be damage because you merged 3 partitions in one and this isn’t a backup and dd is only for identical copies.

                  Your answer would be possible:

                  dd if=/dev/sda1 of=~/hdadisk1.img; 
                  dd if=/dev/sda2 of=~/hdadisk2.img
                  dd if=/dev/sda3 of=~/hdadisk3.img 
                  

                  (In a script if you want) and finally, you can to create an image with the hdadisk{1,3,3}.img although is a better practice you save these images in a partition for backups.

                  share|improve this answer

                    0

                    0

                    0

                    It isn’t possible because dd is only direct 1 input to 1 output –the restoration would be damage because you merged 3 partitions in one and this isn’t a backup and dd is only for identical copies.

                    Your answer would be possible:

                    dd if=/dev/sda1 of=~/hdadisk1.img; 
                    dd if=/dev/sda2 of=~/hdadisk2.img
                    dd if=/dev/sda3 of=~/hdadisk3.img 
                    

                    (In a script if you want) and finally, you can to create an image with the hdadisk{1,3,3}.img although is a better practice you save these images in a partition for backups.

                    share|improve this answer

                    It isn’t possible because dd is only direct 1 input to 1 output –the restoration would be damage because you merged 3 partitions in one and this isn’t a backup and dd is only for identical copies.

                    Your answer would be possible:

                    dd if=/dev/sda1 of=~/hdadisk1.img; 
                    dd if=/dev/sda2 of=~/hdadisk2.img
                    dd if=/dev/sda3 of=~/hdadisk3.img 
                    

                    (In a script if you want) and finally, you can to create an image with the hdadisk{1,3,3}.img although is a better practice you save these images in a partition for backups.

                    share|improve this answer

                    share|improve this answer

                    share|improve this answer

                    edited Jul 12 ’15 at 5:20

                    Archemar

                    20.1k93772

                    20.1k93772

                    answered Jul 12 ’15 at 4:01

                    Joe MantilJoe Mantil

                    786

                    786

                        0

                        dd count=$((132552703-2048)) copies 132552703-2048 blocks of 512 bytes from the beginning of the input. The block size in fdisk is 1 kB = 1024 bytes. So you have three problems:

                        • You specified a size that’s half what you wanted.
                        • You didn’t indicate that you wanted to start the copy at an offset.
                        • Your subtraction has a fencepost error: it misses the last block — the number of blocks is (end block offset) – (start block offset) + 1.

                        So you can do that copy with

                        dd bs=1k skip=2048 count=$((132552703-2048+1)) if=/dev/sda of=./newImage.image
                        

                        I think this will work — dd can silently lose data, but I think that 1kB blocks on a block device or regular file on Linux is fine. But it’s slow.

                        The most straightforward way to copy a single partition would be to just copy it.

                        cat /dev/sda1 >sda1.image
                        cat /dev/sda2 >sda2.image
                        cat /dev/sda3 >sda3.image
                        

                        It would be better to copy the partitions to separate files, because otherwise the partitions that aren’t at the beginning of the file will be hard to use. If you really want the three partitions in the same file, you can concatenate them:

                        cat /dev/sda1 /dev/sda2 /dev/sda3 >newImage.image
                        

                        share|improve this answer

                          0

                          dd count=$((132552703-2048)) copies 132552703-2048 blocks of 512 bytes from the beginning of the input. The block size in fdisk is 1 kB = 1024 bytes. So you have three problems:

                          • You specified a size that’s half what you wanted.
                          • You didn’t indicate that you wanted to start the copy at an offset.
                          • Your subtraction has a fencepost error: it misses the last block — the number of blocks is (end block offset) – (start block offset) + 1.

                          So you can do that copy with

                          dd bs=1k skip=2048 count=$((132552703-2048+1)) if=/dev/sda of=./newImage.image
                          

                          I think this will work — dd can silently lose data, but I think that 1kB blocks on a block device or regular file on Linux is fine. But it’s slow.

                          The most straightforward way to copy a single partition would be to just copy it.

                          cat /dev/sda1 >sda1.image
                          cat /dev/sda2 >sda2.image
                          cat /dev/sda3 >sda3.image
                          

                          It would be better to copy the partitions to separate files, because otherwise the partitions that aren’t at the beginning of the file will be hard to use. If you really want the three partitions in the same file, you can concatenate them:

                          cat /dev/sda1 /dev/sda2 /dev/sda3 >newImage.image
                          

                          share|improve this answer

                            0

                            0

                            0

                            dd count=$((132552703-2048)) copies 132552703-2048 blocks of 512 bytes from the beginning of the input. The block size in fdisk is 1 kB = 1024 bytes. So you have three problems:

                            • You specified a size that’s half what you wanted.
                            • You didn’t indicate that you wanted to start the copy at an offset.
                            • Your subtraction has a fencepost error: it misses the last block — the number of blocks is (end block offset) – (start block offset) + 1.

                            So you can do that copy with

                            dd bs=1k skip=2048 count=$((132552703-2048+1)) if=/dev/sda of=./newImage.image
                            

                            I think this will work — dd can silently lose data, but I think that 1kB blocks on a block device or regular file on Linux is fine. But it’s slow.

                            The most straightforward way to copy a single partition would be to just copy it.

                            cat /dev/sda1 >sda1.image
                            cat /dev/sda2 >sda2.image
                            cat /dev/sda3 >sda3.image
                            

                            It would be better to copy the partitions to separate files, because otherwise the partitions that aren’t at the beginning of the file will be hard to use. If you really want the three partitions in the same file, you can concatenate them:

                            cat /dev/sda1 /dev/sda2 /dev/sda3 >newImage.image
                            

                            share|improve this answer

                            dd count=$((132552703-2048)) copies 132552703-2048 blocks of 512 bytes from the beginning of the input. The block size in fdisk is 1 kB = 1024 bytes. So you have three problems:

                            • You specified a size that’s half what you wanted.
                            • You didn’t indicate that you wanted to start the copy at an offset.
                            • Your subtraction has a fencepost error: it misses the last block — the number of blocks is (end block offset) – (start block offset) + 1.

                            So you can do that copy with

                            dd bs=1k skip=2048 count=$((132552703-2048+1)) if=/dev/sda of=./newImage.image
                            

                            I think this will work — dd can silently lose data, but I think that 1kB blocks on a block device or regular file on Linux is fine. But it’s slow.

                            The most straightforward way to copy a single partition would be to just copy it.

                            cat /dev/sda1 >sda1.image
                            cat /dev/sda2 >sda2.image
                            cat /dev/sda3 >sda3.image
                            

                            It would be better to copy the partitions to separate files, because otherwise the partitions that aren’t at the beginning of the file will be hard to use. If you really want the three partitions in the same file, you can concatenate them:

                            cat /dev/sda1 /dev/sda2 /dev/sda3 >newImage.image
                            

                            share|improve this answer

                            share|improve this answer

                            share|improve this answer

                            edited Apr 13 ’17 at 12:36

                            Community

                            1

                            1

                            answered Jul 12 ’15 at 20:22

                            GillesGilles

                            537k12810871604

                            537k12810871604

                                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%2f215359%2fhow-can-i-copy-three-partitions-of-my-disk-with-a-specific-beginning-and-ending%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

                                Partitioning and formatting a 4k-emulated (512e) HDD

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

                                3

                                I just plugged into USB A 3.0 / C 3.1 my new external HDD to Debian Buster system.

                                The disk was sold as LaCie 2.5″ Porsche Design P’9227 2TB USB-C.

                                Here is the output of fdisk -l /dev/sdc:

                                Disk /dev/sdc: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
                                Disk model: P9227 Slim      
                                Units: sectors of 1 * 512 = 512 bytes
                                Sector size (logical/physical): 512 bytes / 4096 bytes
                                I/O size (minimum/optimal): 4096 bytes / 33553920 bytes
                                

                                I just read some articles about 4k-emulated drives (512e), this one should be the case.

                                I am confused as to how to format it with NTFS.

                                I tried to use my brain, and here is what I came with:

                                • Start sector of the partition should probably start on 4096 sector (?)

                                  So I created a partition with gdisk like this:

                                  Device     Start        End    Sectors  Size Type
                                  /dev/sdc1   4096 3907029134 3907025039  1.8T Microsoft basic data
                                  
                                • Sector size should probably be forced with the --sector-size option like I did (?) issuing:

                                  mkfs.ntfs --no-indexing --verbose --with-uuid --label EXTERNAL_2TB --quick --sector-size 4096 /dev/sdc1
                                  

                                EDIT1:

                                Windows 10 fully updated did not recognize the partition and asked me to format, I used my favorite tool for that, and back to Linux here is the output of fdisk -l /dev/sdc:

                                Device     Start        End    Sectors  Size Type
                                /dev/sdc1   2048 3907028991 3907026944  1,8T Microsoft basic data
                                

                                So why it must start at sector 2048, I don’t understand.


                                EDIT2:

                                I don’t understand what I am doing wrong in terms of compatibility with Windows. Every time I re-partition it / re-format it and boot Windows and plug the drive in, it just offers me to Format it itself.

                                I am quite positive I tried everything from inside gdisk + mkfs.ntfs.

                                I would like to know why I am unable to do the same as Windows does from my Linux CLI.


                                I will answer all questions tomorrow morning as well as comments.

                                I am now running:

                                pv --progress --timer --eta --rate --average-rate --bytes -s 1953314876k < /dev/zero > /media/vlastimil/LACIE_2TB/zero
                                

                                with an expected speed of 123 MiB/s.

                                share|improve this question

                                • 1

                                  The only weird thing here is the bogus “optimal io size”. Nothing wrong with start sector 2048 or 4096 (MiB alignment). As to why Windows doesn’t like it, who knows?

                                  – frostschutz
                                  Jan 27 at 19:37

                                • 2

                                  There is no need for the partition to start on sector 4096. The only requirement for optimal alignment is that the starting sector number is divisible by eight. The physical sectors are aligned to logical sectors N*8. 4096/512 = 8.

                                  – Johan Myréen
                                  Jan 27 at 20:34

                                • I fail to understand why the disk not working in Windows is a concern here, do not understand why you are finding it strange it starting at sector 2048 (it is pretty normal), and I think you are mixing up logical and physical sectors. However, you true problem is that you external adapter sees the disk in a different way than pluggin it in your Windows machine. There is another question that talks about that, but there are people here that are able to explain it better.

                                  – Rui F Ribeiro
                                  Jan 27 at 20:34

                                3

                                I just plugged into USB A 3.0 / C 3.1 my new external HDD to Debian Buster system.

                                The disk was sold as LaCie 2.5″ Porsche Design P’9227 2TB USB-C.

                                Here is the output of fdisk -l /dev/sdc:

                                Disk /dev/sdc: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
                                Disk model: P9227 Slim      
                                Units: sectors of 1 * 512 = 512 bytes
                                Sector size (logical/physical): 512 bytes / 4096 bytes
                                I/O size (minimum/optimal): 4096 bytes / 33553920 bytes
                                

                                I just read some articles about 4k-emulated drives (512e), this one should be the case.

                                I am confused as to how to format it with NTFS.

                                I tried to use my brain, and here is what I came with:

                                • Start sector of the partition should probably start on 4096 sector (?)

                                  So I created a partition with gdisk like this:

                                  Device     Start        End    Sectors  Size Type
                                  /dev/sdc1   4096 3907029134 3907025039  1.8T Microsoft basic data
                                  
                                • Sector size should probably be forced with the --sector-size option like I did (?) issuing:

                                  mkfs.ntfs --no-indexing --verbose --with-uuid --label EXTERNAL_2TB --quick --sector-size 4096 /dev/sdc1
                                  

                                EDIT1:

                                Windows 10 fully updated did not recognize the partition and asked me to format, I used my favorite tool for that, and back to Linux here is the output of fdisk -l /dev/sdc:

                                Device     Start        End    Sectors  Size Type
                                /dev/sdc1   2048 3907028991 3907026944  1,8T Microsoft basic data
                                

                                So why it must start at sector 2048, I don’t understand.


                                EDIT2:

                                I don’t understand what I am doing wrong in terms of compatibility with Windows. Every time I re-partition it / re-format it and boot Windows and plug the drive in, it just offers me to Format it itself.

                                I am quite positive I tried everything from inside gdisk + mkfs.ntfs.

                                I would like to know why I am unable to do the same as Windows does from my Linux CLI.


                                I will answer all questions tomorrow morning as well as comments.

                                I am now running:

                                pv --progress --timer --eta --rate --average-rate --bytes -s 1953314876k < /dev/zero > /media/vlastimil/LACIE_2TB/zero
                                

                                with an expected speed of 123 MiB/s.

                                share|improve this question

                                • 1

                                  The only weird thing here is the bogus “optimal io size”. Nothing wrong with start sector 2048 or 4096 (MiB alignment). As to why Windows doesn’t like it, who knows?

                                  – frostschutz
                                  Jan 27 at 19:37

                                • 2

                                  There is no need for the partition to start on sector 4096. The only requirement for optimal alignment is that the starting sector number is divisible by eight. The physical sectors are aligned to logical sectors N*8. 4096/512 = 8.

                                  – Johan Myréen
                                  Jan 27 at 20:34

                                • I fail to understand why the disk not working in Windows is a concern here, do not understand why you are finding it strange it starting at sector 2048 (it is pretty normal), and I think you are mixing up logical and physical sectors. However, you true problem is that you external adapter sees the disk in a different way than pluggin it in your Windows machine. There is another question that talks about that, but there are people here that are able to explain it better.

                                  – Rui F Ribeiro
                                  Jan 27 at 20:34

                                3

                                3

                                3

                                1

                                I just plugged into USB A 3.0 / C 3.1 my new external HDD to Debian Buster system.

                                The disk was sold as LaCie 2.5″ Porsche Design P’9227 2TB USB-C.

                                Here is the output of fdisk -l /dev/sdc:

                                Disk /dev/sdc: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
                                Disk model: P9227 Slim      
                                Units: sectors of 1 * 512 = 512 bytes
                                Sector size (logical/physical): 512 bytes / 4096 bytes
                                I/O size (minimum/optimal): 4096 bytes / 33553920 bytes
                                

                                I just read some articles about 4k-emulated drives (512e), this one should be the case.

                                I am confused as to how to format it with NTFS.

                                I tried to use my brain, and here is what I came with:

                                • Start sector of the partition should probably start on 4096 sector (?)

                                  So I created a partition with gdisk like this:

                                  Device     Start        End    Sectors  Size Type
                                  /dev/sdc1   4096 3907029134 3907025039  1.8T Microsoft basic data
                                  
                                • Sector size should probably be forced with the --sector-size option like I did (?) issuing:

                                  mkfs.ntfs --no-indexing --verbose --with-uuid --label EXTERNAL_2TB --quick --sector-size 4096 /dev/sdc1
                                  

                                EDIT1:

                                Windows 10 fully updated did not recognize the partition and asked me to format, I used my favorite tool for that, and back to Linux here is the output of fdisk -l /dev/sdc:

                                Device     Start        End    Sectors  Size Type
                                /dev/sdc1   2048 3907028991 3907026944  1,8T Microsoft basic data
                                

                                So why it must start at sector 2048, I don’t understand.


                                EDIT2:

                                I don’t understand what I am doing wrong in terms of compatibility with Windows. Every time I re-partition it / re-format it and boot Windows and plug the drive in, it just offers me to Format it itself.

                                I am quite positive I tried everything from inside gdisk + mkfs.ntfs.

                                I would like to know why I am unable to do the same as Windows does from my Linux CLI.


                                I will answer all questions tomorrow morning as well as comments.

                                I am now running:

                                pv --progress --timer --eta --rate --average-rate --bytes -s 1953314876k < /dev/zero > /media/vlastimil/LACIE_2TB/zero
                                

                                with an expected speed of 123 MiB/s.

                                share|improve this question

                                I just plugged into USB A 3.0 / C 3.1 my new external HDD to Debian Buster system.

                                The disk was sold as LaCie 2.5″ Porsche Design P’9227 2TB USB-C.

                                Here is the output of fdisk -l /dev/sdc:

                                Disk /dev/sdc: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
                                Disk model: P9227 Slim      
                                Units: sectors of 1 * 512 = 512 bytes
                                Sector size (logical/physical): 512 bytes / 4096 bytes
                                I/O size (minimum/optimal): 4096 bytes / 33553920 bytes
                                

                                I just read some articles about 4k-emulated drives (512e), this one should be the case.

                                I am confused as to how to format it with NTFS.

                                I tried to use my brain, and here is what I came with:

                                • Start sector of the partition should probably start on 4096 sector (?)

                                  So I created a partition with gdisk like this:

                                  Device     Start        End    Sectors  Size Type
                                  /dev/sdc1   4096 3907029134 3907025039  1.8T Microsoft basic data
                                  
                                • Sector size should probably be forced with the --sector-size option like I did (?) issuing:

                                  mkfs.ntfs --no-indexing --verbose --with-uuid --label EXTERNAL_2TB --quick --sector-size 4096 /dev/sdc1
                                  

                                EDIT1:

                                Windows 10 fully updated did not recognize the partition and asked me to format, I used my favorite tool for that, and back to Linux here is the output of fdisk -l /dev/sdc:

                                Device     Start        End    Sectors  Size Type
                                /dev/sdc1   2048 3907028991 3907026944  1,8T Microsoft basic data
                                

                                So why it must start at sector 2048, I don’t understand.


                                EDIT2:

                                I don’t understand what I am doing wrong in terms of compatibility with Windows. Every time I re-partition it / re-format it and boot Windows and plug the drive in, it just offers me to Format it itself.

                                I am quite positive I tried everything from inside gdisk + mkfs.ntfs.

                                I would like to know why I am unable to do the same as Windows does from my Linux CLI.


                                I will answer all questions tomorrow morning as well as comments.

                                I am now running:

                                pv --progress --timer --eta --rate --average-rate --bytes -s 1953314876k < /dev/zero > /media/vlastimil/LACIE_2TB/zero
                                

                                with an expected speed of 123 MiB/s.

                                partition hard-disk ntfs mkfs gdisk

                                share|improve this question

                                share|improve this question

                                share|improve this question

                                share|improve this question

                                edited Jan 27 at 20:34

                                Vlastimil

                                asked Jan 27 at 18:36

                                VlastimilVlastimil

                                8,0721464138

                                8,0721464138

                                • 1

                                  The only weird thing here is the bogus “optimal io size”. Nothing wrong with start sector 2048 or 4096 (MiB alignment). As to why Windows doesn’t like it, who knows?

                                  – frostschutz
                                  Jan 27 at 19:37

                                • 2

                                  There is no need for the partition to start on sector 4096. The only requirement for optimal alignment is that the starting sector number is divisible by eight. The physical sectors are aligned to logical sectors N*8. 4096/512 = 8.

                                  – Johan Myréen
                                  Jan 27 at 20:34

                                • I fail to understand why the disk not working in Windows is a concern here, do not understand why you are finding it strange it starting at sector 2048 (it is pretty normal), and I think you are mixing up logical and physical sectors. However, you true problem is that you external adapter sees the disk in a different way than pluggin it in your Windows machine. There is another question that talks about that, but there are people here that are able to explain it better.

                                  – Rui F Ribeiro
                                  Jan 27 at 20:34

                                • 1

                                  The only weird thing here is the bogus “optimal io size”. Nothing wrong with start sector 2048 or 4096 (MiB alignment). As to why Windows doesn’t like it, who knows?

                                  – frostschutz
                                  Jan 27 at 19:37

                                • 2

                                  There is no need for the partition to start on sector 4096. The only requirement for optimal alignment is that the starting sector number is divisible by eight. The physical sectors are aligned to logical sectors N*8. 4096/512 = 8.

                                  – Johan Myréen
                                  Jan 27 at 20:34

                                • I fail to understand why the disk not working in Windows is a concern here, do not understand why you are finding it strange it starting at sector 2048 (it is pretty normal), and I think you are mixing up logical and physical sectors. However, you true problem is that you external adapter sees the disk in a different way than pluggin it in your Windows machine. There is another question that talks about that, but there are people here that are able to explain it better.

                                  – Rui F Ribeiro
                                  Jan 27 at 20:34

                                1

                                1

                                The only weird thing here is the bogus “optimal io size”. Nothing wrong with start sector 2048 or 4096 (MiB alignment). As to why Windows doesn’t like it, who knows?

                                – frostschutz
                                Jan 27 at 19:37

                                The only weird thing here is the bogus “optimal io size”. Nothing wrong with start sector 2048 or 4096 (MiB alignment). As to why Windows doesn’t like it, who knows?

                                – frostschutz
                                Jan 27 at 19:37

                                2

                                2

                                There is no need for the partition to start on sector 4096. The only requirement for optimal alignment is that the starting sector number is divisible by eight. The physical sectors are aligned to logical sectors N*8. 4096/512 = 8.

                                – Johan Myréen
                                Jan 27 at 20:34

                                There is no need for the partition to start on sector 4096. The only requirement for optimal alignment is that the starting sector number is divisible by eight. The physical sectors are aligned to logical sectors N*8. 4096/512 = 8.

                                – Johan Myréen
                                Jan 27 at 20:34

                                I fail to understand why the disk not working in Windows is a concern here, do not understand why you are finding it strange it starting at sector 2048 (it is pretty normal), and I think you are mixing up logical and physical sectors. However, you true problem is that you external adapter sees the disk in a different way than pluggin it in your Windows machine. There is another question that talks about that, but there are people here that are able to explain it better.

                                – Rui F Ribeiro
                                Jan 27 at 20:34

                                I fail to understand why the disk not working in Windows is a concern here, do not understand why you are finding it strange it starting at sector 2048 (it is pretty normal), and I think you are mixing up logical and physical sectors. However, you true problem is that you external adapter sees the disk in a different way than pluggin it in your Windows machine. There is another question that talks about that, but there are people here that are able to explain it better.

                                – Rui F Ribeiro
                                Jan 27 at 20:34

                                1 Answer
                                1

                                active

                                oldest

                                votes

                                3

                                A physical sector size of 4096 means that the data on the drive is laid out in units of 4096 bytes, i.e. disk comprised of sequential “compartments” of 4096 bytes, that have to be written atomically. For compatibility reasons, most disks with 4096 byte sectors present themselves as having traditional 512 byte “logical sectors”, which means the addressing unit is a 512 byte block.

                                The practical implication of this emulation of a 512 sector drive with an underlying disk with 4096 byte sectors is a potential performance issue. When writing a single 512 byte sector to a 512e disk, the drive must read the whole 4096 byte sector containing the 512-byte sector, modify the sector in RAM (on the disk controller) by replacing the 512-byte sector with the new contents, and finally write the whole 4096 sector back to the disk. Things get worse if you are reading or writing a couple of consecutive 512 sectors that happen to cross a 4096 sector boundary.

                                File systems usually lay out their data structures well, i.e. they are aligned to multiples of at least 4096 bytes, so the bigger sector size normally does not present a problem. This all breaks down, however, if the partition containing the file system itself is not aligned properly. In the case of a 512e disk, the partitions should be aligned so that the first 512-byte logical sector number is a multiple of eight.

                                share|improve this answer

                                • Good thinking. This is a known issue, specially when aligning VMs because all the improvement gains add up and benefit the infra-structure as a whole. +1

                                  – Rui F Ribeiro
                                  Jan 28 at 17:49

                                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%2f497063%2fpartitioning-and-formatting-a-4k-emulated-512e-hdd%23new-answer’, ‘question_page’);
                                }
                                );

                                Post as a guest

                                Required, but never shown

                                1 Answer
                                1

                                active

                                oldest

                                votes

                                1 Answer
                                1

                                active

                                oldest

                                votes

                                active

                                oldest

                                votes

                                active

                                oldest

                                votes

                                3

                                A physical sector size of 4096 means that the data on the drive is laid out in units of 4096 bytes, i.e. disk comprised of sequential “compartments” of 4096 bytes, that have to be written atomically. For compatibility reasons, most disks with 4096 byte sectors present themselves as having traditional 512 byte “logical sectors”, which means the addressing unit is a 512 byte block.

                                The practical implication of this emulation of a 512 sector drive with an underlying disk with 4096 byte sectors is a potential performance issue. When writing a single 512 byte sector to a 512e disk, the drive must read the whole 4096 byte sector containing the 512-byte sector, modify the sector in RAM (on the disk controller) by replacing the 512-byte sector with the new contents, and finally write the whole 4096 sector back to the disk. Things get worse if you are reading or writing a couple of consecutive 512 sectors that happen to cross a 4096 sector boundary.

                                File systems usually lay out their data structures well, i.e. they are aligned to multiples of at least 4096 bytes, so the bigger sector size normally does not present a problem. This all breaks down, however, if the partition containing the file system itself is not aligned properly. In the case of a 512e disk, the partitions should be aligned so that the first 512-byte logical sector number is a multiple of eight.

                                share|improve this answer

                                • Good thinking. This is a known issue, specially when aligning VMs because all the improvement gains add up and benefit the infra-structure as a whole. +1

                                  – Rui F Ribeiro
                                  Jan 28 at 17:49

                                3

                                A physical sector size of 4096 means that the data on the drive is laid out in units of 4096 bytes, i.e. disk comprised of sequential “compartments” of 4096 bytes, that have to be written atomically. For compatibility reasons, most disks with 4096 byte sectors present themselves as having traditional 512 byte “logical sectors”, which means the addressing unit is a 512 byte block.

                                The practical implication of this emulation of a 512 sector drive with an underlying disk with 4096 byte sectors is a potential performance issue. When writing a single 512 byte sector to a 512e disk, the drive must read the whole 4096 byte sector containing the 512-byte sector, modify the sector in RAM (on the disk controller) by replacing the 512-byte sector with the new contents, and finally write the whole 4096 sector back to the disk. Things get worse if you are reading or writing a couple of consecutive 512 sectors that happen to cross a 4096 sector boundary.

                                File systems usually lay out their data structures well, i.e. they are aligned to multiples of at least 4096 bytes, so the bigger sector size normally does not present a problem. This all breaks down, however, if the partition containing the file system itself is not aligned properly. In the case of a 512e disk, the partitions should be aligned so that the first 512-byte logical sector number is a multiple of eight.

                                share|improve this answer

                                • Good thinking. This is a known issue, specially when aligning VMs because all the improvement gains add up and benefit the infra-structure as a whole. +1

                                  – Rui F Ribeiro
                                  Jan 28 at 17:49

                                3

                                3

                                3

                                A physical sector size of 4096 means that the data on the drive is laid out in units of 4096 bytes, i.e. disk comprised of sequential “compartments” of 4096 bytes, that have to be written atomically. For compatibility reasons, most disks with 4096 byte sectors present themselves as having traditional 512 byte “logical sectors”, which means the addressing unit is a 512 byte block.

                                The practical implication of this emulation of a 512 sector drive with an underlying disk with 4096 byte sectors is a potential performance issue. When writing a single 512 byte sector to a 512e disk, the drive must read the whole 4096 byte sector containing the 512-byte sector, modify the sector in RAM (on the disk controller) by replacing the 512-byte sector with the new contents, and finally write the whole 4096 sector back to the disk. Things get worse if you are reading or writing a couple of consecutive 512 sectors that happen to cross a 4096 sector boundary.

                                File systems usually lay out their data structures well, i.e. they are aligned to multiples of at least 4096 bytes, so the bigger sector size normally does not present a problem. This all breaks down, however, if the partition containing the file system itself is not aligned properly. In the case of a 512e disk, the partitions should be aligned so that the first 512-byte logical sector number is a multiple of eight.

                                share|improve this answer

                                A physical sector size of 4096 means that the data on the drive is laid out in units of 4096 bytes, i.e. disk comprised of sequential “compartments” of 4096 bytes, that have to be written atomically. For compatibility reasons, most disks with 4096 byte sectors present themselves as having traditional 512 byte “logical sectors”, which means the addressing unit is a 512 byte block.

                                The practical implication of this emulation of a 512 sector drive with an underlying disk with 4096 byte sectors is a potential performance issue. When writing a single 512 byte sector to a 512e disk, the drive must read the whole 4096 byte sector containing the 512-byte sector, modify the sector in RAM (on the disk controller) by replacing the 512-byte sector with the new contents, and finally write the whole 4096 sector back to the disk. Things get worse if you are reading or writing a couple of consecutive 512 sectors that happen to cross a 4096 sector boundary.

                                File systems usually lay out their data structures well, i.e. they are aligned to multiples of at least 4096 bytes, so the bigger sector size normally does not present a problem. This all breaks down, however, if the partition containing the file system itself is not aligned properly. In the case of a 512e disk, the partitions should be aligned so that the first 512-byte logical sector number is a multiple of eight.

                                share|improve this answer

                                share|improve this answer

                                share|improve this answer

                                answered Jan 28 at 7:15

                                Johan MyréenJohan Myréen

                                7,68911524

                                7,68911524

                                • Good thinking. This is a known issue, specially when aligning VMs because all the improvement gains add up and benefit the infra-structure as a whole. +1

                                  – Rui F Ribeiro
                                  Jan 28 at 17:49

                                • Good thinking. This is a known issue, specially when aligning VMs because all the improvement gains add up and benefit the infra-structure as a whole. +1

                                  – Rui F Ribeiro
                                  Jan 28 at 17:49

                                Good thinking. This is a known issue, specially when aligning VMs because all the improvement gains add up and benefit the infra-structure as a whole. +1

                                – Rui F Ribeiro
                                Jan 28 at 17:49

                                Good thinking. This is a known issue, specially when aligning VMs because all the improvement gains add up and benefit the infra-structure as a whole. +1

                                – Rui F Ribeiro
                                Jan 28 at 17:49

                                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%2f497063%2fpartitioning-and-formatting-a-4k-emulated-512e-hdd%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

                                How can I change the name of one partition called sdaX to sdaY?

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

                                2

                                When I use a pendrive with two partitions on a Windows system, it only recognizes the first partition that I’ve created in that pendrive.

                                I have a pendrive with two partitions: an ext4 and a ntfs (the one that should be recognized).

                                So, the problem is that when I use this pendrive on Windows it tries to read my ext4 partition since it’s the first one that I’ve created. I’m not sure if just changing the pendrive’s name partition from sda2 to sda1 on linux could solve my problem on windows, but that is the only solution that I can think right now.

                                share|improve this question

                                  2

                                  When I use a pendrive with two partitions on a Windows system, it only recognizes the first partition that I’ve created in that pendrive.

                                  I have a pendrive with two partitions: an ext4 and a ntfs (the one that should be recognized).

                                  So, the problem is that when I use this pendrive on Windows it tries to read my ext4 partition since it’s the first one that I’ve created. I’m not sure if just changing the pendrive’s name partition from sda2 to sda1 on linux could solve my problem on windows, but that is the only solution that I can think right now.

                                  share|improve this question

                                    2

                                    2

                                    2

                                    2

                                    When I use a pendrive with two partitions on a Windows system, it only recognizes the first partition that I’ve created in that pendrive.

                                    I have a pendrive with two partitions: an ext4 and a ntfs (the one that should be recognized).

                                    So, the problem is that when I use this pendrive on Windows it tries to read my ext4 partition since it’s the first one that I’ve created. I’m not sure if just changing the pendrive’s name partition from sda2 to sda1 on linux could solve my problem on windows, but that is the only solution that I can think right now.

                                    share|improve this question

                                    When I use a pendrive with two partitions on a Windows system, it only recognizes the first partition that I’ve created in that pendrive.

                                    I have a pendrive with two partitions: an ext4 and a ntfs (the one that should be recognized).

                                    So, the problem is that when I use this pendrive on Windows it tries to read my ext4 partition since it’s the first one that I’ve created. I’m not sure if just changing the pendrive’s name partition from sda2 to sda1 on linux could solve my problem on windows, but that is the only solution that I can think right now.

                                    partition windows usb-drive

                                    share|improve this question

                                    share|improve this question

                                    share|improve this question

                                    share|improve this question

                                    edited Jan 27 at 19:46

                                    Rafael Muynarsk

                                    asked Aug 18 ’15 at 8:59

                                    Rafael MuynarskRafael Muynarsk

                                    427616

                                    427616

                                        2 Answers
                                        2

                                        active

                                        oldest

                                        votes

                                        2

                                        You can’t swap sdaX for sdaY, which wouldn’t do anything in Windows anyway.
                                        Your problem is a Windows problem, not a Linux problem: use the disk manager thingy in Windows to set a letter drive to the NTFS partition.

                                        share|improve this answer

                                        • Check also the partiton table on the pendrive. If for example the partition type is wrong, Windows may ignore the NTFS partition.

                                          – jofel
                                          Aug 18 ’15 at 9:26

                                        2

                                        You could swap the first partition entry in the partition table with the second one using the dd tool.

                                        I advice though that you make a backup of your files (or filesystems) before trying this procedure!

                                        I also won’t claim a high degree of reliability afterwards because it is not common practice to have partition entries in descending order.

                                        Note for example that the fdisk tool will report an incorrect order of your partition entries after performing this procedure.

                                        However, I have tested the access to the NTFS-partition and it appears to work in Windows 7 as well as Windows 10. I have not tested any other Windows-version. Also Ubuntu 14.04 appears to recognize the ext4 partition again afterwards (and also the NTFS-partition).

                                        I have tested and succeeded in doing the following:

                                        First copy the first partition entry in your partition table like such (substituting /dev/sdc for the correct device):

                                        dd if=/dev/sdc of=./mbrpart1.dd skip=446 bs=1 count=16
                                        

                                        Then copy the second partition entry in your partition table like such (again substituting /dev/sdc for the correct device):

                                        dd if=/dev/sdc of=./mbrpart2.dd skip=462 bs=1 count=16
                                        

                                        After writing both partition entries to those two .dd-files one can swap partitions by writing mbrpart1.dd (ext4) to second partition entry and mbrpart2.dd (NTFS) to first partition entry.

                                        So write mbrpart1.dd (ext4 partition entry) to the second partition entry (substitute /dev/sdc for correct device):

                                        dd if=./mbrpart1.dd of=/dev/sdc seek=462 bs=1 count=16; sync
                                        

                                        And write mbrpart2.dd (NTFS partition entry) to the first partition entry (substitute /dev/sdc for correct device):

                                        dd if=./mbrpart2.dd of=/dev/sdc seek=446 bs=1 count=16; sync
                                        

                                        And then it should be done.

                                        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’,
                                          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%2f223902%2fhow-can-i-change-the-name-of-one-partition-called-sdax-to-sday%23new-answer’, ‘question_page’);
                                          }
                                          );

                                          Post as a guest

                                          Required, but never shown

                                          2 Answers
                                          2

                                          active

                                          oldest

                                          votes

                                          2 Answers
                                          2

                                          active

                                          oldest

                                          votes

                                          active

                                          oldest

                                          votes

                                          active

                                          oldest

                                          votes

                                          2

                                          You can’t swap sdaX for sdaY, which wouldn’t do anything in Windows anyway.
                                          Your problem is a Windows problem, not a Linux problem: use the disk manager thingy in Windows to set a letter drive to the NTFS partition.

                                          share|improve this answer

                                          • Check also the partiton table on the pendrive. If for example the partition type is wrong, Windows may ignore the NTFS partition.

                                            – jofel
                                            Aug 18 ’15 at 9:26

                                          2

                                          You can’t swap sdaX for sdaY, which wouldn’t do anything in Windows anyway.
                                          Your problem is a Windows problem, not a Linux problem: use the disk manager thingy in Windows to set a letter drive to the NTFS partition.

                                          share|improve this answer

                                          • Check also the partiton table on the pendrive. If for example the partition type is wrong, Windows may ignore the NTFS partition.

                                            – jofel
                                            Aug 18 ’15 at 9:26

                                          2

                                          2

                                          2

                                          You can’t swap sdaX for sdaY, which wouldn’t do anything in Windows anyway.
                                          Your problem is a Windows problem, not a Linux problem: use the disk manager thingy in Windows to set a letter drive to the NTFS partition.

                                          share|improve this answer

                                          You can’t swap sdaX for sdaY, which wouldn’t do anything in Windows anyway.
                                          Your problem is a Windows problem, not a Linux problem: use the disk manager thingy in Windows to set a letter drive to the NTFS partition.

                                          share|improve this answer

                                          share|improve this answer

                                          share|improve this answer

                                          answered Aug 18 ’15 at 9:12

                                          cylgaladcylgalad

                                          166116

                                          166116

                                          • Check also the partiton table on the pendrive. If for example the partition type is wrong, Windows may ignore the NTFS partition.

                                            – jofel
                                            Aug 18 ’15 at 9:26

                                          • Check also the partiton table on the pendrive. If for example the partition type is wrong, Windows may ignore the NTFS partition.

                                            – jofel
                                            Aug 18 ’15 at 9:26

                                          Check also the partiton table on the pendrive. If for example the partition type is wrong, Windows may ignore the NTFS partition.

                                          – jofel
                                          Aug 18 ’15 at 9:26

                                          Check also the partiton table on the pendrive. If for example the partition type is wrong, Windows may ignore the NTFS partition.

                                          – jofel
                                          Aug 18 ’15 at 9:26

                                          2

                                          You could swap the first partition entry in the partition table with the second one using the dd tool.

                                          I advice though that you make a backup of your files (or filesystems) before trying this procedure!

                                          I also won’t claim a high degree of reliability afterwards because it is not common practice to have partition entries in descending order.

                                          Note for example that the fdisk tool will report an incorrect order of your partition entries after performing this procedure.

                                          However, I have tested the access to the NTFS-partition and it appears to work in Windows 7 as well as Windows 10. I have not tested any other Windows-version. Also Ubuntu 14.04 appears to recognize the ext4 partition again afterwards (and also the NTFS-partition).

                                          I have tested and succeeded in doing the following:

                                          First copy the first partition entry in your partition table like such (substituting /dev/sdc for the correct device):

                                          dd if=/dev/sdc of=./mbrpart1.dd skip=446 bs=1 count=16
                                          

                                          Then copy the second partition entry in your partition table like such (again substituting /dev/sdc for the correct device):

                                          dd if=/dev/sdc of=./mbrpart2.dd skip=462 bs=1 count=16
                                          

                                          After writing both partition entries to those two .dd-files one can swap partitions by writing mbrpart1.dd (ext4) to second partition entry and mbrpart2.dd (NTFS) to first partition entry.

                                          So write mbrpart1.dd (ext4 partition entry) to the second partition entry (substitute /dev/sdc for correct device):

                                          dd if=./mbrpart1.dd of=/dev/sdc seek=462 bs=1 count=16; sync
                                          

                                          And write mbrpart2.dd (NTFS partition entry) to the first partition entry (substitute /dev/sdc for correct device):

                                          dd if=./mbrpart2.dd of=/dev/sdc seek=446 bs=1 count=16; sync
                                          

                                          And then it should be done.

                                          share|improve this answer

                                            2

                                            You could swap the first partition entry in the partition table with the second one using the dd tool.

                                            I advice though that you make a backup of your files (or filesystems) before trying this procedure!

                                            I also won’t claim a high degree of reliability afterwards because it is not common practice to have partition entries in descending order.

                                            Note for example that the fdisk tool will report an incorrect order of your partition entries after performing this procedure.

                                            However, I have tested the access to the NTFS-partition and it appears to work in Windows 7 as well as Windows 10. I have not tested any other Windows-version. Also Ubuntu 14.04 appears to recognize the ext4 partition again afterwards (and also the NTFS-partition).

                                            I have tested and succeeded in doing the following:

                                            First copy the first partition entry in your partition table like such (substituting /dev/sdc for the correct device):

                                            dd if=/dev/sdc of=./mbrpart1.dd skip=446 bs=1 count=16
                                            

                                            Then copy the second partition entry in your partition table like such (again substituting /dev/sdc for the correct device):

                                            dd if=/dev/sdc of=./mbrpart2.dd skip=462 bs=1 count=16
                                            

                                            After writing both partition entries to those two .dd-files one can swap partitions by writing mbrpart1.dd (ext4) to second partition entry and mbrpart2.dd (NTFS) to first partition entry.

                                            So write mbrpart1.dd (ext4 partition entry) to the second partition entry (substitute /dev/sdc for correct device):

                                            dd if=./mbrpart1.dd of=/dev/sdc seek=462 bs=1 count=16; sync
                                            

                                            And write mbrpart2.dd (NTFS partition entry) to the first partition entry (substitute /dev/sdc for correct device):

                                            dd if=./mbrpart2.dd of=/dev/sdc seek=446 bs=1 count=16; sync
                                            

                                            And then it should be done.

                                            share|improve this answer

                                              2

                                              2

                                              2

                                              You could swap the first partition entry in the partition table with the second one using the dd tool.

                                              I advice though that you make a backup of your files (or filesystems) before trying this procedure!

                                              I also won’t claim a high degree of reliability afterwards because it is not common practice to have partition entries in descending order.

                                              Note for example that the fdisk tool will report an incorrect order of your partition entries after performing this procedure.

                                              However, I have tested the access to the NTFS-partition and it appears to work in Windows 7 as well as Windows 10. I have not tested any other Windows-version. Also Ubuntu 14.04 appears to recognize the ext4 partition again afterwards (and also the NTFS-partition).

                                              I have tested and succeeded in doing the following:

                                              First copy the first partition entry in your partition table like such (substituting /dev/sdc for the correct device):

                                              dd if=/dev/sdc of=./mbrpart1.dd skip=446 bs=1 count=16
                                              

                                              Then copy the second partition entry in your partition table like such (again substituting /dev/sdc for the correct device):

                                              dd if=/dev/sdc of=./mbrpart2.dd skip=462 bs=1 count=16
                                              

                                              After writing both partition entries to those two .dd-files one can swap partitions by writing mbrpart1.dd (ext4) to second partition entry and mbrpart2.dd (NTFS) to first partition entry.

                                              So write mbrpart1.dd (ext4 partition entry) to the second partition entry (substitute /dev/sdc for correct device):

                                              dd if=./mbrpart1.dd of=/dev/sdc seek=462 bs=1 count=16; sync
                                              

                                              And write mbrpart2.dd (NTFS partition entry) to the first partition entry (substitute /dev/sdc for correct device):

                                              dd if=./mbrpart2.dd of=/dev/sdc seek=446 bs=1 count=16; sync
                                              

                                              And then it should be done.

                                              share|improve this answer

                                              You could swap the first partition entry in the partition table with the second one using the dd tool.

                                              I advice though that you make a backup of your files (or filesystems) before trying this procedure!

                                              I also won’t claim a high degree of reliability afterwards because it is not common practice to have partition entries in descending order.

                                              Note for example that the fdisk tool will report an incorrect order of your partition entries after performing this procedure.

                                              However, I have tested the access to the NTFS-partition and it appears to work in Windows 7 as well as Windows 10. I have not tested any other Windows-version. Also Ubuntu 14.04 appears to recognize the ext4 partition again afterwards (and also the NTFS-partition).

                                              I have tested and succeeded in doing the following:

                                              First copy the first partition entry in your partition table like such (substituting /dev/sdc for the correct device):

                                              dd if=/dev/sdc of=./mbrpart1.dd skip=446 bs=1 count=16
                                              

                                              Then copy the second partition entry in your partition table like such (again substituting /dev/sdc for the correct device):

                                              dd if=/dev/sdc of=./mbrpart2.dd skip=462 bs=1 count=16
                                              

                                              After writing both partition entries to those two .dd-files one can swap partitions by writing mbrpart1.dd (ext4) to second partition entry and mbrpart2.dd (NTFS) to first partition entry.

                                              So write mbrpart1.dd (ext4 partition entry) to the second partition entry (substitute /dev/sdc for correct device):

                                              dd if=./mbrpart1.dd of=/dev/sdc seek=462 bs=1 count=16; sync
                                              

                                              And write mbrpart2.dd (NTFS partition entry) to the first partition entry (substitute /dev/sdc for correct device):

                                              dd if=./mbrpart2.dd of=/dev/sdc seek=446 bs=1 count=16; sync
                                              

                                              And then it should be done.

                                              share|improve this answer

                                              share|improve this answer

                                              share|improve this answer

                                              edited Aug 18 ’15 at 17:26

                                              answered Aug 18 ’15 at 16:36

                                              WiegerWieger

                                              1714

                                              1714

                                                  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%2f223902%2fhow-can-i-change-the-name-of-one-partition-called-sdax-to-sday%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

                                                  How to clone a NTFS partition (WinXP) from a damaged disk to a new one?

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

                                                  9

                                                  I need to clone a NTFS partition from a damaged, near to die hard disk (SCSI, if this matters) to a new one (SATA).

                                                  I’ve installed the last version of Hiren’s Boot CD utilities on a USB stick, and tried with GParted, which told me that it can’t copy/paste the partition because it’s damaged and “flagged” by windows to run CHKDSK. I followed the Warning advice and tried to repair it using CHKDSK /f (it took 9 hours and exited with an error after “phase 3”) and a Linux program I can’t recall right now, without success.

                                                  I tried to clone using Clonezilla, and it failed as well, for the same reasons.
                                                  In the HBCD there’s dd_rescue, but it failed again because it can’t find “ntfs.something”.

                                                  In the end, all that I want is to clone that partition as it is, with his errors and everything. I can repair it on the new drive.

                                                  So, what should I do?

                                                  share|improve this question

                                                  • What was the error message returned by CHKDSK /f after “phase 3”?

                                                    – user26112
                                                    Jun 22 ’13 at 18:19

                                                  9

                                                  I need to clone a NTFS partition from a damaged, near to die hard disk (SCSI, if this matters) to a new one (SATA).

                                                  I’ve installed the last version of Hiren’s Boot CD utilities on a USB stick, and tried with GParted, which told me that it can’t copy/paste the partition because it’s damaged and “flagged” by windows to run CHKDSK. I followed the Warning advice and tried to repair it using CHKDSK /f (it took 9 hours and exited with an error after “phase 3”) and a Linux program I can’t recall right now, without success.

                                                  I tried to clone using Clonezilla, and it failed as well, for the same reasons.
                                                  In the HBCD there’s dd_rescue, but it failed again because it can’t find “ntfs.something”.

                                                  In the end, all that I want is to clone that partition as it is, with his errors and everything. I can repair it on the new drive.

                                                  So, what should I do?

                                                  share|improve this question

                                                  • What was the error message returned by CHKDSK /f after “phase 3”?

                                                    – user26112
                                                    Jun 22 ’13 at 18:19

                                                  9

                                                  9

                                                  9

                                                  3

                                                  I need to clone a NTFS partition from a damaged, near to die hard disk (SCSI, if this matters) to a new one (SATA).

                                                  I’ve installed the last version of Hiren’s Boot CD utilities on a USB stick, and tried with GParted, which told me that it can’t copy/paste the partition because it’s damaged and “flagged” by windows to run CHKDSK. I followed the Warning advice and tried to repair it using CHKDSK /f (it took 9 hours and exited with an error after “phase 3”) and a Linux program I can’t recall right now, without success.

                                                  I tried to clone using Clonezilla, and it failed as well, for the same reasons.
                                                  In the HBCD there’s dd_rescue, but it failed again because it can’t find “ntfs.something”.

                                                  In the end, all that I want is to clone that partition as it is, with his errors and everything. I can repair it on the new drive.

                                                  So, what should I do?

                                                  share|improve this question

                                                  I need to clone a NTFS partition from a damaged, near to die hard disk (SCSI, if this matters) to a new one (SATA).

                                                  I’ve installed the last version of Hiren’s Boot CD utilities on a USB stick, and tried with GParted, which told me that it can’t copy/paste the partition because it’s damaged and “flagged” by windows to run CHKDSK. I followed the Warning advice and tried to repair it using CHKDSK /f (it took 9 hours and exited with an error after “phase 3”) and a Linux program I can’t recall right now, without success.

                                                  I tried to clone using Clonezilla, and it failed as well, for the same reasons.
                                                  In the HBCD there’s dd_rescue, but it failed again because it can’t find “ntfs.something”.

                                                  In the end, all that I want is to clone that partition as it is, with his errors and everything. I can repair it on the new drive.

                                                  So, what should I do?

                                                  partition hard-disk data-recovery ntfs

                                                  share|improve this question

                                                  share|improve this question

                                                  share|improve this question

                                                  share|improve this question

                                                  edited Jan 27 at 0:19

                                                  Rui F Ribeiro

                                                  40.1k1479135

                                                  40.1k1479135

                                                  asked Jun 22 ’13 at 18:06

                                                  ParduzParduz

                                                  151113

                                                  151113

                                                  • What was the error message returned by CHKDSK /f after “phase 3”?

                                                    – user26112
                                                    Jun 22 ’13 at 18:19

                                                  • What was the error message returned by CHKDSK /f after “phase 3”?

                                                    – user26112
                                                    Jun 22 ’13 at 18:19

                                                  What was the error message returned by CHKDSK /f after “phase 3”?

                                                  – user26112
                                                  Jun 22 ’13 at 18:19

                                                  What was the error message returned by CHKDSK /f after “phase 3”?

                                                  – user26112
                                                  Jun 22 ’13 at 18:19

                                                  5 Answers
                                                  5

                                                  active

                                                  oldest

                                                  votes

                                                  4

                                                  You can of course try to repair the NTFS partition on the original drive, but I cannot recommend to do so, as the problems might be caused by hardware failure and repairing could make things worst.

                                                  Make a block for block copy with ddrescue to a file first. If there are any block that cannot be copied ddrescue will continue with the rest of the disc.

                                                  If ddrescue doesn’t find any bad blocks then you can try to use repair software on the file (mounted via loopback). If there are problems with the SCSI drive or you just want to be sure to be able to start over from scratch, make a copy of your file and try to repair the NTFS filesystem on the second copy. As copying a disk with errors can be time consuming process, you might have to interrupt the process (because you need the computer, to let the drive cool down, or to restart the firmware of the drive).

                                                  That is why in my experience ddrescue is far superior in problematic cases than is dd with conv=noerror. ddrescue keeps a log about what it has done and restarts based on that information, a feature unavailable to dd. ddrescue is also smarter in reading blocks starting from the end, if it encounters a problem area. It will arrive much quicker at an image copy state that you can use as the basis for a filesystem check (and you can continue to ddrescue the original copy). You can only do something like that with dd if you are willing to spent a lot of time calculating offsets by hand.

                                                  You can also copy the file to a NTFS partition of the right size, put the drive in a windows machine and use the native repair tools from there.

                                                  share|improve this answer

                                                  • 1

                                                    Very useful! Could you add an exact command-line example of ddrescue in action, similar to the dd example in the other answer?

                                                    – landroni
                                                    Jan 27 ’14 at 10:43

                                                  • 2

                                                    @landroni I could (basically ddrescue /dev/sdX driveimage logfile) but you really should spent the effort on reading ddrescue documentation. If your system is broken, there are a lot of reasons to read the manual before potentially making things worse.

                                                    – Anthon
                                                    Jan 27 ’14 at 12:29

                                                  • I am now looking at the man page, but some of the options are cryptic. What would be the most conservative ddrescue equivalent of dd if=/dev/olddisk of=/dev/newdisk bs=4k conv=noerror,sync? Keeping in mind that it would be run on a damaged (and dying) disk, and that “trying hard to rescue data in case of read errors” isn’t really an option. Thanks!

                                                    – landroni
                                                    Jan 27 ’14 at 16:44

                                                  • @landroni with the options given in my previous comment each sector in a block is only tried once. The only way I know of that you can improve on that is if you know which areas are OK for sure and use -i and -s to recover those.

                                                    – Anthon
                                                    Jan 27 ’14 at 17:06

                                                  • Well, last time I tried ddrescue /dev/sr0 driveimage.iso (on a scratched CD), the programme tried to read again a lot of bad sectors, a lot of times. I may be wrong, but I would be skittish about running ddrescue with no other limiting options on a dying disk.

                                                    – landroni
                                                    Jan 27 ’14 at 17:21

                                                  2

                                                  Had the same problem: Disk that is about to die,
                                                  with NTFS partition that I wanted to rescue first and fix after
                                                  (before the disk is totally gone).

                                                  Was able to resolve it with ntfsclone:

                                                  1. Connect the two disks – old and new
                                                  2. Boot with Live-Linux from USB
                                                    (can use Parted Magic for that as well)
                                                  3. Create a big-enough partition on the new disk
                                                    (use gparted for that)
                                                  4. Note the name of the partitions, as they are named in gparted
                                                    (/dev/sdaX, /dev/sdbX)
                                                  5. Open a terminal window and run the following command:
                                                    ntfsclone --force --ignore-fs-check --rescue --overwrite NEW-part OLD-part
                                                    (replace NEW-part and OLD-part with the names from step ‘4.’ – /dev/sd...)
                                                    ntfsclone will complain about you overlooking the inconsistencies
                                                    but should continue with the copy of the partition

                                                  — when done —

                                                  1. Turn-off the PC
                                                  2. Disconnect the faulty disk
                                                    (you want to use it as little as possible, now)
                                                  3. Boot the PC again – either to Windows or Linux,
                                                    and try to fix the partition on the new disk

                                                  EDIT:

                                                  — NOTE —
                                                  Faulty (unstable) power-supply can cause disk-controllers to go crazy,
                                                  and are much more likely to fail than disks, so it is best to check this as well.
                                                  You may experience a behavior that everything works fine for a few minutes
                                                  (or seconds) and then the systems starts going crazy, as soon as it warms-up, literally.

                                                  (fixing the power supply will not restore the lost data, of course, but prevent you from losing more of it)

                                                  share|improve this answer

                                                    1

                                                    I would attempt to repair the disk with either HDAT (freeware) or possibly Spinrite (Commercial). I’ve used both of these tools to recover disks that were failing and they have both worked well in the past.

                                                    Until the drive is in a usable state I don’t anticipate you getting too far in your recovery efforts. Once the disk has been cleared I’d use Clonezilla to replicate it as quickly as you can to an alternate HDD.

                                                    share|improve this answer

                                                      0

                                                      I feel this question should have a working example so this is how I used ddrescue

                                                      0) Installed an identical size (and brand) replacement drive under warranty and moved the old drive to a second slot

                                                      1) I used an ubuntu boot cd

                                                      I tried the simple option but it immediately produced a lot of errors and hung

                                                      dd if=/dev/sdb of=/dev/sda bs=512 conv=noerror,sync
                                                      root@ubuntu:~# dd if=/dev/sdb of=/dev/sda bs=512 conv=noerror,sync
                                                      dd: error reading ‘/dev/sdb’: Input/output error
                                                      57496+0 records in
                                                      57496+0 records out
                                                      29437952 bytes (29 MB) copied, 6.02927 s, 4.9 MB/s
                                                      dd: error reading ‘/dev/sdb’: Input/output error
                                                      57496+1 records in
                                                      57497+0 records out
                                                      29438464 bytes (29 MB) copied, 8.86693 s, 3.3 MB/s
                                                      dd: error reading ‘/dev/sdb’: Input/output error
                                                      57496+2 records in
                                                      57498+0 records out
                                                      29438976 bytes (29 MB) copied, 11.7068 s, 2.5 MB/s
                                                      dd: error reading ‘/dev/sdb’: Input/output error
                                                      57496+3 records in
                                                      57499+0 records out
                                                      

                                                      2) Read these articles:

                                                      • http://keystoneisit.blogspot.co.nz/2011/08/clone-failing-windows-hard-disk-with.html
                                                      • https://www.technibble.com/guide-using-ddrescue-recover-data/

                                                      Note the latter recommended using -d direct disc access, but I didn’t use it

                                                      3) Installed ddrescue

                                                      sudo apt-get install gddrescue
                                                      sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe"
                                                      sudo apt-get update
                                                      sudo apt-get install gddrescue
                                                      man ddrescue
                                                      

                                                      May also need (?)

                                                      sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse"
                                                      

                                                      4) Finally ran (if you are copying and pasting, stop, sda is my new drive… pay attention and do your homework)

                                                      ddrescue -v -r3 /dev/sdb /dev/sda ~/ddrescue.log
                                                      
                                                      • -v verbose
                                                      • -r 3 retries
                                                      • ~/xx log file which can be used to retry apparently. Note this is only stored in memory but could be copied to a usb drive

                                                      Output:

                                                      GNU ddrescue 1.17
                                                      About to copy 1000 GBytes from /dev/sdb to /dev/sda
                                                          Starting positions: infile = 0 B,  outfile = 0 B
                                                          Copy block size: 128 sectors       Initial skip size: 128 sectors
                                                      Sector size: 512 Bytes
                                                      
                                                      Press Ctrl-C to interrupt
                                                      rescued:    22555 MB,  errsize:    196 kB,  current rate:   91815 kB/s
                                                         ipos:    22555 MB,   errors:       5,    average rate:   68975 kB/s
                                                         opos:    22555 MB,    time since last successful read:       0 s
                                                      Copying non-tried blocks...
                                                      

                                                      5) Booted windows and reactivated … tbc

                                                      share|improve this answer

                                                        0

                                                        Good day!

                                                        The point is how much your source disk is damaged. If it is almostly ruined, the only way to clone data is to use professional hardware data recovery suites. Like Atola Insight

                                                        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’,
                                                          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%2f80370%2fhow-to-clone-a-ntfs-partition-winxp-from-a-damaged-disk-to-a-new-one%23new-answer’, ‘question_page’);
                                                          }
                                                          );

                                                          Post as a guest

                                                          Required, but never shown

                                                          5 Answers
                                                          5

                                                          active

                                                          oldest

                                                          votes

                                                          5 Answers
                                                          5

                                                          active

                                                          oldest

                                                          votes

                                                          active

                                                          oldest

                                                          votes

                                                          active

                                                          oldest

                                                          votes

                                                          4

                                                          You can of course try to repair the NTFS partition on the original drive, but I cannot recommend to do so, as the problems might be caused by hardware failure and repairing could make things worst.

                                                          Make a block for block copy with ddrescue to a file first. If there are any block that cannot be copied ddrescue will continue with the rest of the disc.

                                                          If ddrescue doesn’t find any bad blocks then you can try to use repair software on the file (mounted via loopback). If there are problems with the SCSI drive or you just want to be sure to be able to start over from scratch, make a copy of your file and try to repair the NTFS filesystem on the second copy. As copying a disk with errors can be time consuming process, you might have to interrupt the process (because you need the computer, to let the drive cool down, or to restart the firmware of the drive).

                                                          That is why in my experience ddrescue is far superior in problematic cases than is dd with conv=noerror. ddrescue keeps a log about what it has done and restarts based on that information, a feature unavailable to dd. ddrescue is also smarter in reading blocks starting from the end, if it encounters a problem area. It will arrive much quicker at an image copy state that you can use as the basis for a filesystem check (and you can continue to ddrescue the original copy). You can only do something like that with dd if you are willing to spent a lot of time calculating offsets by hand.

                                                          You can also copy the file to a NTFS partition of the right size, put the drive in a windows machine and use the native repair tools from there.

                                                          share|improve this answer

                                                          • 1

                                                            Very useful! Could you add an exact command-line example of ddrescue in action, similar to the dd example in the other answer?

                                                            – landroni
                                                            Jan 27 ’14 at 10:43

                                                          • 2

                                                            @landroni I could (basically ddrescue /dev/sdX driveimage logfile) but you really should spent the effort on reading ddrescue documentation. If your system is broken, there are a lot of reasons to read the manual before potentially making things worse.

                                                            – Anthon
                                                            Jan 27 ’14 at 12:29

                                                          • I am now looking at the man page, but some of the options are cryptic. What would be the most conservative ddrescue equivalent of dd if=/dev/olddisk of=/dev/newdisk bs=4k conv=noerror,sync? Keeping in mind that it would be run on a damaged (and dying) disk, and that “trying hard to rescue data in case of read errors” isn’t really an option. Thanks!

                                                            – landroni
                                                            Jan 27 ’14 at 16:44

                                                          • @landroni with the options given in my previous comment each sector in a block is only tried once. The only way I know of that you can improve on that is if you know which areas are OK for sure and use -i and -s to recover those.

                                                            – Anthon
                                                            Jan 27 ’14 at 17:06

                                                          • Well, last time I tried ddrescue /dev/sr0 driveimage.iso (on a scratched CD), the programme tried to read again a lot of bad sectors, a lot of times. I may be wrong, but I would be skittish about running ddrescue with no other limiting options on a dying disk.

                                                            – landroni
                                                            Jan 27 ’14 at 17:21

                                                          4

                                                          You can of course try to repair the NTFS partition on the original drive, but I cannot recommend to do so, as the problems might be caused by hardware failure and repairing could make things worst.

                                                          Make a block for block copy with ddrescue to a file first. If there are any block that cannot be copied ddrescue will continue with the rest of the disc.

                                                          If ddrescue doesn’t find any bad blocks then you can try to use repair software on the file (mounted via loopback). If there are problems with the SCSI drive or you just want to be sure to be able to start over from scratch, make a copy of your file and try to repair the NTFS filesystem on the second copy. As copying a disk with errors can be time consuming process, you might have to interrupt the process (because you need the computer, to let the drive cool down, or to restart the firmware of the drive).

                                                          That is why in my experience ddrescue is far superior in problematic cases than is dd with conv=noerror. ddrescue keeps a log about what it has done and restarts based on that information, a feature unavailable to dd. ddrescue is also smarter in reading blocks starting from the end, if it encounters a problem area. It will arrive much quicker at an image copy state that you can use as the basis for a filesystem check (and you can continue to ddrescue the original copy). You can only do something like that with dd if you are willing to spent a lot of time calculating offsets by hand.

                                                          You can also copy the file to a NTFS partition of the right size, put the drive in a windows machine and use the native repair tools from there.

                                                          share|improve this answer

                                                          • 1

                                                            Very useful! Could you add an exact command-line example of ddrescue in action, similar to the dd example in the other answer?

                                                            – landroni
                                                            Jan 27 ’14 at 10:43

                                                          • 2

                                                            @landroni I could (basically ddrescue /dev/sdX driveimage logfile) but you really should spent the effort on reading ddrescue documentation. If your system is broken, there are a lot of reasons to read the manual before potentially making things worse.

                                                            – Anthon
                                                            Jan 27 ’14 at 12:29

                                                          • I am now looking at the man page, but some of the options are cryptic. What would be the most conservative ddrescue equivalent of dd if=/dev/olddisk of=/dev/newdisk bs=4k conv=noerror,sync? Keeping in mind that it would be run on a damaged (and dying) disk, and that “trying hard to rescue data in case of read errors” isn’t really an option. Thanks!

                                                            – landroni
                                                            Jan 27 ’14 at 16:44

                                                          • @landroni with the options given in my previous comment each sector in a block is only tried once. The only way I know of that you can improve on that is if you know which areas are OK for sure and use -i and -s to recover those.

                                                            – Anthon
                                                            Jan 27 ’14 at 17:06

                                                          • Well, last time I tried ddrescue /dev/sr0 driveimage.iso (on a scratched CD), the programme tried to read again a lot of bad sectors, a lot of times. I may be wrong, but I would be skittish about running ddrescue with no other limiting options on a dying disk.

                                                            – landroni
                                                            Jan 27 ’14 at 17:21

                                                          4

                                                          4

                                                          4

                                                          You can of course try to repair the NTFS partition on the original drive, but I cannot recommend to do so, as the problems might be caused by hardware failure and repairing could make things worst.

                                                          Make a block for block copy with ddrescue to a file first. If there are any block that cannot be copied ddrescue will continue with the rest of the disc.

                                                          If ddrescue doesn’t find any bad blocks then you can try to use repair software on the file (mounted via loopback). If there are problems with the SCSI drive or you just want to be sure to be able to start over from scratch, make a copy of your file and try to repair the NTFS filesystem on the second copy. As copying a disk with errors can be time consuming process, you might have to interrupt the process (because you need the computer, to let the drive cool down, or to restart the firmware of the drive).

                                                          That is why in my experience ddrescue is far superior in problematic cases than is dd with conv=noerror. ddrescue keeps a log about what it has done and restarts based on that information, a feature unavailable to dd. ddrescue is also smarter in reading blocks starting from the end, if it encounters a problem area. It will arrive much quicker at an image copy state that you can use as the basis for a filesystem check (and you can continue to ddrescue the original copy). You can only do something like that with dd if you are willing to spent a lot of time calculating offsets by hand.

                                                          You can also copy the file to a NTFS partition of the right size, put the drive in a windows machine and use the native repair tools from there.

                                                          share|improve this answer

                                                          You can of course try to repair the NTFS partition on the original drive, but I cannot recommend to do so, as the problems might be caused by hardware failure and repairing could make things worst.

                                                          Make a block for block copy with ddrescue to a file first. If there are any block that cannot be copied ddrescue will continue with the rest of the disc.

                                                          If ddrescue doesn’t find any bad blocks then you can try to use repair software on the file (mounted via loopback). If there are problems with the SCSI drive or you just want to be sure to be able to start over from scratch, make a copy of your file and try to repair the NTFS filesystem on the second copy. As copying a disk with errors can be time consuming process, you might have to interrupt the process (because you need the computer, to let the drive cool down, or to restart the firmware of the drive).

                                                          That is why in my experience ddrescue is far superior in problematic cases than is dd with conv=noerror. ddrescue keeps a log about what it has done and restarts based on that information, a feature unavailable to dd. ddrescue is also smarter in reading blocks starting from the end, if it encounters a problem area. It will arrive much quicker at an image copy state that you can use as the basis for a filesystem check (and you can continue to ddrescue the original copy). You can only do something like that with dd if you are willing to spent a lot of time calculating offsets by hand.

                                                          You can also copy the file to a NTFS partition of the right size, put the drive in a windows machine and use the native repair tools from there.

                                                          share|improve this answer

                                                          share|improve this answer

                                                          share|improve this answer

                                                          edited Jun 25 ’13 at 3:42

                                                          answered Jun 22 ’13 at 18:58

                                                          AnthonAnthon

                                                          60.8k17103166

                                                          60.8k17103166

                                                          • 1

                                                            Very useful! Could you add an exact command-line example of ddrescue in action, similar to the dd example in the other answer?

                                                            – landroni
                                                            Jan 27 ’14 at 10:43

                                                          • 2

                                                            @landroni I could (basically ddrescue /dev/sdX driveimage logfile) but you really should spent the effort on reading ddrescue documentation. If your system is broken, there are a lot of reasons to read the manual before potentially making things worse.

                                                            – Anthon
                                                            Jan 27 ’14 at 12:29

                                                          • I am now looking at the man page, but some of the options are cryptic. What would be the most conservative ddrescue equivalent of dd if=/dev/olddisk of=/dev/newdisk bs=4k conv=noerror,sync? Keeping in mind that it would be run on a damaged (and dying) disk, and that “trying hard to rescue data in case of read errors” isn’t really an option. Thanks!

                                                            – landroni
                                                            Jan 27 ’14 at 16:44

                                                          • @landroni with the options given in my previous comment each sector in a block is only tried once. The only way I know of that you can improve on that is if you know which areas are OK for sure and use -i and -s to recover those.

                                                            – Anthon
                                                            Jan 27 ’14 at 17:06

                                                          • Well, last time I tried ddrescue /dev/sr0 driveimage.iso (on a scratched CD), the programme tried to read again a lot of bad sectors, a lot of times. I may be wrong, but I would be skittish about running ddrescue with no other limiting options on a dying disk.

                                                            – landroni
                                                            Jan 27 ’14 at 17:21

                                                          • 1

                                                            Very useful! Could you add an exact command-line example of ddrescue in action, similar to the dd example in the other answer?

                                                            – landroni
                                                            Jan 27 ’14 at 10:43

                                                          • 2

                                                            @landroni I could (basically ddrescue /dev/sdX driveimage logfile) but you really should spent the effort on reading ddrescue documentation. If your system is broken, there are a lot of reasons to read the manual before potentially making things worse.

                                                            – Anthon
                                                            Jan 27 ’14 at 12:29

                                                          • I am now looking at the man page, but some of the options are cryptic. What would be the most conservative ddrescue equivalent of dd if=/dev/olddisk of=/dev/newdisk bs=4k conv=noerror,sync? Keeping in mind that it would be run on a damaged (and dying) disk, and that “trying hard to rescue data in case of read errors” isn’t really an option. Thanks!

                                                            – landroni
                                                            Jan 27 ’14 at 16:44

                                                          • @landroni with the options given in my previous comment each sector in a block is only tried once. The only way I know of that you can improve on that is if you know which areas are OK for sure and use -i and -s to recover those.

                                                            – Anthon
                                                            Jan 27 ’14 at 17:06

                                                          • Well, last time I tried ddrescue /dev/sr0 driveimage.iso (on a scratched CD), the programme tried to read again a lot of bad sectors, a lot of times. I may be wrong, but I would be skittish about running ddrescue with no other limiting options on a dying disk.

                                                            – landroni
                                                            Jan 27 ’14 at 17:21

                                                          1

                                                          1

                                                          Very useful! Could you add an exact command-line example of ddrescue in action, similar to the dd example in the other answer?

                                                          – landroni
                                                          Jan 27 ’14 at 10:43

                                                          Very useful! Could you add an exact command-line example of ddrescue in action, similar to the dd example in the other answer?

                                                          – landroni
                                                          Jan 27 ’14 at 10:43

                                                          2

                                                          2

                                                          @landroni I could (basically ddrescue /dev/sdX driveimage logfile) but you really should spent the effort on reading ddrescue documentation. If your system is broken, there are a lot of reasons to read the manual before potentially making things worse.

                                                          – Anthon
                                                          Jan 27 ’14 at 12:29

                                                          @landroni I could (basically ddrescue /dev/sdX driveimage logfile) but you really should spent the effort on reading ddrescue documentation. If your system is broken, there are a lot of reasons to read the manual before potentially making things worse.

                                                          – Anthon
                                                          Jan 27 ’14 at 12:29

                                                          I am now looking at the man page, but some of the options are cryptic. What would be the most conservative ddrescue equivalent of dd if=/dev/olddisk of=/dev/newdisk bs=4k conv=noerror,sync? Keeping in mind that it would be run on a damaged (and dying) disk, and that “trying hard to rescue data in case of read errors” isn’t really an option. Thanks!

                                                          – landroni
                                                          Jan 27 ’14 at 16:44

                                                          I am now looking at the man page, but some of the options are cryptic. What would be the most conservative ddrescue equivalent of dd if=/dev/olddisk of=/dev/newdisk bs=4k conv=noerror,sync? Keeping in mind that it would be run on a damaged (and dying) disk, and that “trying hard to rescue data in case of read errors” isn’t really an option. Thanks!

                                                          – landroni
                                                          Jan 27 ’14 at 16:44

                                                          @landroni with the options given in my previous comment each sector in a block is only tried once. The only way I know of that you can improve on that is if you know which areas are OK for sure and use -i and -s to recover those.

                                                          – Anthon
                                                          Jan 27 ’14 at 17:06

                                                          @landroni with the options given in my previous comment each sector in a block is only tried once. The only way I know of that you can improve on that is if you know which areas are OK for sure and use -i and -s to recover those.

                                                          – Anthon
                                                          Jan 27 ’14 at 17:06

                                                          Well, last time I tried ddrescue /dev/sr0 driveimage.iso (on a scratched CD), the programme tried to read again a lot of bad sectors, a lot of times. I may be wrong, but I would be skittish about running ddrescue with no other limiting options on a dying disk.

                                                          – landroni
                                                          Jan 27 ’14 at 17:21

                                                          Well, last time I tried ddrescue /dev/sr0 driveimage.iso (on a scratched CD), the programme tried to read again a lot of bad sectors, a lot of times. I may be wrong, but I would be skittish about running ddrescue with no other limiting options on a dying disk.

                                                          – landroni
                                                          Jan 27 ’14 at 17:21

                                                          2

                                                          Had the same problem: Disk that is about to die,
                                                          with NTFS partition that I wanted to rescue first and fix after
                                                          (before the disk is totally gone).

                                                          Was able to resolve it with ntfsclone:

                                                          1. Connect the two disks – old and new
                                                          2. Boot with Live-Linux from USB
                                                            (can use Parted Magic for that as well)
                                                          3. Create a big-enough partition on the new disk
                                                            (use gparted for that)
                                                          4. Note the name of the partitions, as they are named in gparted
                                                            (/dev/sdaX, /dev/sdbX)
                                                          5. Open a terminal window and run the following command:
                                                            ntfsclone --force --ignore-fs-check --rescue --overwrite NEW-part OLD-part
                                                            (replace NEW-part and OLD-part with the names from step ‘4.’ – /dev/sd...)
                                                            ntfsclone will complain about you overlooking the inconsistencies
                                                            but should continue with the copy of the partition

                                                          — when done —

                                                          1. Turn-off the PC
                                                          2. Disconnect the faulty disk
                                                            (you want to use it as little as possible, now)
                                                          3. Boot the PC again – either to Windows or Linux,
                                                            and try to fix the partition on the new disk

                                                          EDIT:

                                                          — NOTE —
                                                          Faulty (unstable) power-supply can cause disk-controllers to go crazy,
                                                          and are much more likely to fail than disks, so it is best to check this as well.
                                                          You may experience a behavior that everything works fine for a few minutes
                                                          (or seconds) and then the systems starts going crazy, as soon as it warms-up, literally.

                                                          (fixing the power supply will not restore the lost data, of course, but prevent you from losing more of it)

                                                          share|improve this answer

                                                            2

                                                            Had the same problem: Disk that is about to die,
                                                            with NTFS partition that I wanted to rescue first and fix after
                                                            (before the disk is totally gone).

                                                            Was able to resolve it with ntfsclone:

                                                            1. Connect the two disks – old and new
                                                            2. Boot with Live-Linux from USB
                                                              (can use Parted Magic for that as well)
                                                            3. Create a big-enough partition on the new disk
                                                              (use gparted for that)
                                                            4. Note the name of the partitions, as they are named in gparted
                                                              (/dev/sdaX, /dev/sdbX)
                                                            5. Open a terminal window and run the following command:
                                                              ntfsclone --force --ignore-fs-check --rescue --overwrite NEW-part OLD-part
                                                              (replace NEW-part and OLD-part with the names from step ‘4.’ – /dev/sd...)
                                                              ntfsclone will complain about you overlooking the inconsistencies
                                                              but should continue with the copy of the partition

                                                            — when done —

                                                            1. Turn-off the PC
                                                            2. Disconnect the faulty disk
                                                              (you want to use it as little as possible, now)
                                                            3. Boot the PC again – either to Windows or Linux,
                                                              and try to fix the partition on the new disk

                                                            EDIT:

                                                            — NOTE —
                                                            Faulty (unstable) power-supply can cause disk-controllers to go crazy,
                                                            and are much more likely to fail than disks, so it is best to check this as well.
                                                            You may experience a behavior that everything works fine for a few minutes
                                                            (or seconds) and then the systems starts going crazy, as soon as it warms-up, literally.

                                                            (fixing the power supply will not restore the lost data, of course, but prevent you from losing more of it)

                                                            share|improve this answer

                                                              2

                                                              2

                                                              2

                                                              Had the same problem: Disk that is about to die,
                                                              with NTFS partition that I wanted to rescue first and fix after
                                                              (before the disk is totally gone).

                                                              Was able to resolve it with ntfsclone:

                                                              1. Connect the two disks – old and new
                                                              2. Boot with Live-Linux from USB
                                                                (can use Parted Magic for that as well)
                                                              3. Create a big-enough partition on the new disk
                                                                (use gparted for that)
                                                              4. Note the name of the partitions, as they are named in gparted
                                                                (/dev/sdaX, /dev/sdbX)
                                                              5. Open a terminal window and run the following command:
                                                                ntfsclone --force --ignore-fs-check --rescue --overwrite NEW-part OLD-part
                                                                (replace NEW-part and OLD-part with the names from step ‘4.’ – /dev/sd...)
                                                                ntfsclone will complain about you overlooking the inconsistencies
                                                                but should continue with the copy of the partition

                                                              — when done —

                                                              1. Turn-off the PC
                                                              2. Disconnect the faulty disk
                                                                (you want to use it as little as possible, now)
                                                              3. Boot the PC again – either to Windows or Linux,
                                                                and try to fix the partition on the new disk

                                                              EDIT:

                                                              — NOTE —
                                                              Faulty (unstable) power-supply can cause disk-controllers to go crazy,
                                                              and are much more likely to fail than disks, so it is best to check this as well.
                                                              You may experience a behavior that everything works fine for a few minutes
                                                              (or seconds) and then the systems starts going crazy, as soon as it warms-up, literally.

                                                              (fixing the power supply will not restore the lost data, of course, but prevent you from losing more of it)

                                                              share|improve this answer

                                                              Had the same problem: Disk that is about to die,
                                                              with NTFS partition that I wanted to rescue first and fix after
                                                              (before the disk is totally gone).

                                                              Was able to resolve it with ntfsclone:

                                                              1. Connect the two disks – old and new
                                                              2. Boot with Live-Linux from USB
                                                                (can use Parted Magic for that as well)
                                                              3. Create a big-enough partition on the new disk
                                                                (use gparted for that)
                                                              4. Note the name of the partitions, as they are named in gparted
                                                                (/dev/sdaX, /dev/sdbX)
                                                              5. Open a terminal window and run the following command:
                                                                ntfsclone --force --ignore-fs-check --rescue --overwrite NEW-part OLD-part
                                                                (replace NEW-part and OLD-part with the names from step ‘4.’ – /dev/sd...)
                                                                ntfsclone will complain about you overlooking the inconsistencies
                                                                but should continue with the copy of the partition

                                                              — when done —

                                                              1. Turn-off the PC
                                                              2. Disconnect the faulty disk
                                                                (you want to use it as little as possible, now)
                                                              3. Boot the PC again – either to Windows or Linux,
                                                                and try to fix the partition on the new disk

                                                              EDIT:

                                                              — NOTE —
                                                              Faulty (unstable) power-supply can cause disk-controllers to go crazy,
                                                              and are much more likely to fail than disks, so it is best to check this as well.
                                                              You may experience a behavior that everything works fine for a few minutes
                                                              (or seconds) and then the systems starts going crazy, as soon as it warms-up, literally.

                                                              (fixing the power supply will not restore the lost data, of course, but prevent you from losing more of it)

                                                              share|improve this answer

                                                              share|improve this answer

                                                              share|improve this answer

                                                              edited Dec 19 ’17 at 10:45

                                                              answered Jul 24 ’15 at 1:16

                                                              GonenGonen

                                                              1213

                                                              1213

                                                                  1

                                                                  I would attempt to repair the disk with either HDAT (freeware) or possibly Spinrite (Commercial). I’ve used both of these tools to recover disks that were failing and they have both worked well in the past.

                                                                  Until the drive is in a usable state I don’t anticipate you getting too far in your recovery efforts. Once the disk has been cleared I’d use Clonezilla to replicate it as quickly as you can to an alternate HDD.

                                                                  share|improve this answer

                                                                    1

                                                                    I would attempt to repair the disk with either HDAT (freeware) or possibly Spinrite (Commercial). I’ve used both of these tools to recover disks that were failing and they have both worked well in the past.

                                                                    Until the drive is in a usable state I don’t anticipate you getting too far in your recovery efforts. Once the disk has been cleared I’d use Clonezilla to replicate it as quickly as you can to an alternate HDD.

                                                                    share|improve this answer

                                                                      1

                                                                      1

                                                                      1

                                                                      I would attempt to repair the disk with either HDAT (freeware) or possibly Spinrite (Commercial). I’ve used both of these tools to recover disks that were failing and they have both worked well in the past.

                                                                      Until the drive is in a usable state I don’t anticipate you getting too far in your recovery efforts. Once the disk has been cleared I’d use Clonezilla to replicate it as quickly as you can to an alternate HDD.

                                                                      share|improve this answer

                                                                      I would attempt to repair the disk with either HDAT (freeware) or possibly Spinrite (Commercial). I’ve used both of these tools to recover disks that were failing and they have both worked well in the past.

                                                                      Until the drive is in a usable state I don’t anticipate you getting too far in your recovery efforts. Once the disk has been cleared I’d use Clonezilla to replicate it as quickly as you can to an alternate HDD.

                                                                      share|improve this answer

                                                                      share|improve this answer

                                                                      share|improve this answer

                                                                      edited Jul 9 ’13 at 20:18

                                                                      answered Jun 22 ’13 at 18:42

                                                                      slmslm

                                                                      251k67528685

                                                                      251k67528685

                                                                          0

                                                                          I feel this question should have a working example so this is how I used ddrescue

                                                                          0) Installed an identical size (and brand) replacement drive under warranty and moved the old drive to a second slot

                                                                          1) I used an ubuntu boot cd

                                                                          I tried the simple option but it immediately produced a lot of errors and hung

                                                                          dd if=/dev/sdb of=/dev/sda bs=512 conv=noerror,sync
                                                                          root@ubuntu:~# dd if=/dev/sdb of=/dev/sda bs=512 conv=noerror,sync
                                                                          dd: error reading ‘/dev/sdb’: Input/output error
                                                                          57496+0 records in
                                                                          57496+0 records out
                                                                          29437952 bytes (29 MB) copied, 6.02927 s, 4.9 MB/s
                                                                          dd: error reading ‘/dev/sdb’: Input/output error
                                                                          57496+1 records in
                                                                          57497+0 records out
                                                                          29438464 bytes (29 MB) copied, 8.86693 s, 3.3 MB/s
                                                                          dd: error reading ‘/dev/sdb’: Input/output error
                                                                          57496+2 records in
                                                                          57498+0 records out
                                                                          29438976 bytes (29 MB) copied, 11.7068 s, 2.5 MB/s
                                                                          dd: error reading ‘/dev/sdb’: Input/output error
                                                                          57496+3 records in
                                                                          57499+0 records out
                                                                          

                                                                          2) Read these articles:

                                                                          • http://keystoneisit.blogspot.co.nz/2011/08/clone-failing-windows-hard-disk-with.html
                                                                          • https://www.technibble.com/guide-using-ddrescue-recover-data/

                                                                          Note the latter recommended using -d direct disc access, but I didn’t use it

                                                                          3) Installed ddrescue

                                                                          sudo apt-get install gddrescue
                                                                          sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe"
                                                                          sudo apt-get update
                                                                          sudo apt-get install gddrescue
                                                                          man ddrescue
                                                                          

                                                                          May also need (?)

                                                                          sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse"
                                                                          

                                                                          4) Finally ran (if you are copying and pasting, stop, sda is my new drive… pay attention and do your homework)

                                                                          ddrescue -v -r3 /dev/sdb /dev/sda ~/ddrescue.log
                                                                          
                                                                          • -v verbose
                                                                          • -r 3 retries
                                                                          • ~/xx log file which can be used to retry apparently. Note this is only stored in memory but could be copied to a usb drive

                                                                          Output:

                                                                          GNU ddrescue 1.17
                                                                          About to copy 1000 GBytes from /dev/sdb to /dev/sda
                                                                              Starting positions: infile = 0 B,  outfile = 0 B
                                                                              Copy block size: 128 sectors       Initial skip size: 128 sectors
                                                                          Sector size: 512 Bytes
                                                                          
                                                                          Press Ctrl-C to interrupt
                                                                          rescued:    22555 MB,  errsize:    196 kB,  current rate:   91815 kB/s
                                                                             ipos:    22555 MB,   errors:       5,    average rate:   68975 kB/s
                                                                             opos:    22555 MB,    time since last successful read:       0 s
                                                                          Copying non-tried blocks...
                                                                          

                                                                          5) Booted windows and reactivated … tbc

                                                                          share|improve this answer

                                                                            0

                                                                            I feel this question should have a working example so this is how I used ddrescue

                                                                            0) Installed an identical size (and brand) replacement drive under warranty and moved the old drive to a second slot

                                                                            1) I used an ubuntu boot cd

                                                                            I tried the simple option but it immediately produced a lot of errors and hung

                                                                            dd if=/dev/sdb of=/dev/sda bs=512 conv=noerror,sync
                                                                            root@ubuntu:~# dd if=/dev/sdb of=/dev/sda bs=512 conv=noerror,sync
                                                                            dd: error reading ‘/dev/sdb’: Input/output error
                                                                            57496+0 records in
                                                                            57496+0 records out
                                                                            29437952 bytes (29 MB) copied, 6.02927 s, 4.9 MB/s
                                                                            dd: error reading ‘/dev/sdb’: Input/output error
                                                                            57496+1 records in
                                                                            57497+0 records out
                                                                            29438464 bytes (29 MB) copied, 8.86693 s, 3.3 MB/s
                                                                            dd: error reading ‘/dev/sdb’: Input/output error
                                                                            57496+2 records in
                                                                            57498+0 records out
                                                                            29438976 bytes (29 MB) copied, 11.7068 s, 2.5 MB/s
                                                                            dd: error reading ‘/dev/sdb’: Input/output error
                                                                            57496+3 records in
                                                                            57499+0 records out
                                                                            

                                                                            2) Read these articles:

                                                                            • http://keystoneisit.blogspot.co.nz/2011/08/clone-failing-windows-hard-disk-with.html
                                                                            • https://www.technibble.com/guide-using-ddrescue-recover-data/

                                                                            Note the latter recommended using -d direct disc access, but I didn’t use it

                                                                            3) Installed ddrescue

                                                                            sudo apt-get install gddrescue
                                                                            sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe"
                                                                            sudo apt-get update
                                                                            sudo apt-get install gddrescue
                                                                            man ddrescue
                                                                            

                                                                            May also need (?)

                                                                            sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse"
                                                                            

                                                                            4) Finally ran (if you are copying and pasting, stop, sda is my new drive… pay attention and do your homework)

                                                                            ddrescue -v -r3 /dev/sdb /dev/sda ~/ddrescue.log
                                                                            
                                                                            • -v verbose
                                                                            • -r 3 retries
                                                                            • ~/xx log file which can be used to retry apparently. Note this is only stored in memory but could be copied to a usb drive

                                                                            Output:

                                                                            GNU ddrescue 1.17
                                                                            About to copy 1000 GBytes from /dev/sdb to /dev/sda
                                                                                Starting positions: infile = 0 B,  outfile = 0 B
                                                                                Copy block size: 128 sectors       Initial skip size: 128 sectors
                                                                            Sector size: 512 Bytes
                                                                            
                                                                            Press Ctrl-C to interrupt
                                                                            rescued:    22555 MB,  errsize:    196 kB,  current rate:   91815 kB/s
                                                                               ipos:    22555 MB,   errors:       5,    average rate:   68975 kB/s
                                                                               opos:    22555 MB,    time since last successful read:       0 s
                                                                            Copying non-tried blocks...
                                                                            

                                                                            5) Booted windows and reactivated … tbc

                                                                            share|improve this answer

                                                                              0

                                                                              0

                                                                              0

                                                                              I feel this question should have a working example so this is how I used ddrescue

                                                                              0) Installed an identical size (and brand) replacement drive under warranty and moved the old drive to a second slot

                                                                              1) I used an ubuntu boot cd

                                                                              I tried the simple option but it immediately produced a lot of errors and hung

                                                                              dd if=/dev/sdb of=/dev/sda bs=512 conv=noerror,sync
                                                                              root@ubuntu:~# dd if=/dev/sdb of=/dev/sda bs=512 conv=noerror,sync
                                                                              dd: error reading ‘/dev/sdb’: Input/output error
                                                                              57496+0 records in
                                                                              57496+0 records out
                                                                              29437952 bytes (29 MB) copied, 6.02927 s, 4.9 MB/s
                                                                              dd: error reading ‘/dev/sdb’: Input/output error
                                                                              57496+1 records in
                                                                              57497+0 records out
                                                                              29438464 bytes (29 MB) copied, 8.86693 s, 3.3 MB/s
                                                                              dd: error reading ‘/dev/sdb’: Input/output error
                                                                              57496+2 records in
                                                                              57498+0 records out
                                                                              29438976 bytes (29 MB) copied, 11.7068 s, 2.5 MB/s
                                                                              dd: error reading ‘/dev/sdb’: Input/output error
                                                                              57496+3 records in
                                                                              57499+0 records out
                                                                              

                                                                              2) Read these articles:

                                                                              • http://keystoneisit.blogspot.co.nz/2011/08/clone-failing-windows-hard-disk-with.html
                                                                              • https://www.technibble.com/guide-using-ddrescue-recover-data/

                                                                              Note the latter recommended using -d direct disc access, but I didn’t use it

                                                                              3) Installed ddrescue

                                                                              sudo apt-get install gddrescue
                                                                              sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe"
                                                                              sudo apt-get update
                                                                              sudo apt-get install gddrescue
                                                                              man ddrescue
                                                                              

                                                                              May also need (?)

                                                                              sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse"
                                                                              

                                                                              4) Finally ran (if you are copying and pasting, stop, sda is my new drive… pay attention and do your homework)

                                                                              ddrescue -v -r3 /dev/sdb /dev/sda ~/ddrescue.log
                                                                              
                                                                              • -v verbose
                                                                              • -r 3 retries
                                                                              • ~/xx log file which can be used to retry apparently. Note this is only stored in memory but could be copied to a usb drive

                                                                              Output:

                                                                              GNU ddrescue 1.17
                                                                              About to copy 1000 GBytes from /dev/sdb to /dev/sda
                                                                                  Starting positions: infile = 0 B,  outfile = 0 B
                                                                                  Copy block size: 128 sectors       Initial skip size: 128 sectors
                                                                              Sector size: 512 Bytes
                                                                              
                                                                              Press Ctrl-C to interrupt
                                                                              rescued:    22555 MB,  errsize:    196 kB,  current rate:   91815 kB/s
                                                                                 ipos:    22555 MB,   errors:       5,    average rate:   68975 kB/s
                                                                                 opos:    22555 MB,    time since last successful read:       0 s
                                                                              Copying non-tried blocks...
                                                                              

                                                                              5) Booted windows and reactivated … tbc

                                                                              share|improve this answer

                                                                              I feel this question should have a working example so this is how I used ddrescue

                                                                              0) Installed an identical size (and brand) replacement drive under warranty and moved the old drive to a second slot

                                                                              1) I used an ubuntu boot cd

                                                                              I tried the simple option but it immediately produced a lot of errors and hung

                                                                              dd if=/dev/sdb of=/dev/sda bs=512 conv=noerror,sync
                                                                              root@ubuntu:~# dd if=/dev/sdb of=/dev/sda bs=512 conv=noerror,sync
                                                                              dd: error reading ‘/dev/sdb’: Input/output error
                                                                              57496+0 records in
                                                                              57496+0 records out
                                                                              29437952 bytes (29 MB) copied, 6.02927 s, 4.9 MB/s
                                                                              dd: error reading ‘/dev/sdb’: Input/output error
                                                                              57496+1 records in
                                                                              57497+0 records out
                                                                              29438464 bytes (29 MB) copied, 8.86693 s, 3.3 MB/s
                                                                              dd: error reading ‘/dev/sdb’: Input/output error
                                                                              57496+2 records in
                                                                              57498+0 records out
                                                                              29438976 bytes (29 MB) copied, 11.7068 s, 2.5 MB/s
                                                                              dd: error reading ‘/dev/sdb’: Input/output error
                                                                              57496+3 records in
                                                                              57499+0 records out
                                                                              

                                                                              2) Read these articles:

                                                                              • http://keystoneisit.blogspot.co.nz/2011/08/clone-failing-windows-hard-disk-with.html
                                                                              • https://www.technibble.com/guide-using-ddrescue-recover-data/

                                                                              Note the latter recommended using -d direct disc access, but I didn’t use it

                                                                              3) Installed ddrescue

                                                                              sudo apt-get install gddrescue
                                                                              sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe"
                                                                              sudo apt-get update
                                                                              sudo apt-get install gddrescue
                                                                              man ddrescue
                                                                              

                                                                              May also need (?)

                                                                              sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse"
                                                                              

                                                                              4) Finally ran (if you are copying and pasting, stop, sda is my new drive… pay attention and do your homework)

                                                                              ddrescue -v -r3 /dev/sdb /dev/sda ~/ddrescue.log
                                                                              
                                                                              • -v verbose
                                                                              • -r 3 retries
                                                                              • ~/xx log file which can be used to retry apparently. Note this is only stored in memory but could be copied to a usb drive

                                                                              Output:

                                                                              GNU ddrescue 1.17
                                                                              About to copy 1000 GBytes from /dev/sdb to /dev/sda
                                                                                  Starting positions: infile = 0 B,  outfile = 0 B
                                                                                  Copy block size: 128 sectors       Initial skip size: 128 sectors
                                                                              Sector size: 512 Bytes
                                                                              
                                                                              Press Ctrl-C to interrupt
                                                                              rescued:    22555 MB,  errsize:    196 kB,  current rate:   91815 kB/s
                                                                                 ipos:    22555 MB,   errors:       5,    average rate:   68975 kB/s
                                                                                 opos:    22555 MB,    time since last successful read:       0 s
                                                                              Copying non-tried blocks...
                                                                              

                                                                              5) Booted windows and reactivated … tbc

                                                                              share|improve this answer

                                                                              share|improve this answer

                                                                              share|improve this answer

                                                                              edited Mar 5 ’15 at 22:29


                                                                              community wiki

                                                                              2 revs
                                                                              KCD

                                                                                  0

                                                                                  Good day!

                                                                                  The point is how much your source disk is damaged. If it is almostly ruined, the only way to clone data is to use professional hardware data recovery suites. Like Atola Insight

                                                                                  share|improve this answer

                                                                                    0

                                                                                    Good day!

                                                                                    The point is how much your source disk is damaged. If it is almostly ruined, the only way to clone data is to use professional hardware data recovery suites. Like Atola Insight

                                                                                    share|improve this answer

                                                                                      0

                                                                                      0

                                                                                      0

                                                                                      Good day!

                                                                                      The point is how much your source disk is damaged. If it is almostly ruined, the only way to clone data is to use professional hardware data recovery suites. Like Atola Insight

                                                                                      share|improve this answer

                                                                                      Good day!

                                                                                      The point is how much your source disk is damaged. If it is almostly ruined, the only way to clone data is to use professional hardware data recovery suites. Like Atola Insight

                                                                                      share|improve this answer

                                                                                      share|improve this answer

                                                                                      share|improve this answer

                                                                                      answered Apr 2 ’16 at 0:06

                                                                                      George GaálGeorge Gaál

                                                                                      1067

                                                                                      1067

                                                                                          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%2f80370%2fhow-to-clone-a-ntfs-partition-winxp-from-a-damaged-disk-to-a-new-one%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

                                                                                          How to extend partition to all unallocated space in a VPS?

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

                                                                                          1

                                                                                          I rent a VPS that uses a SSD of 10GB (Debian 7) and I upgraded yesterday to their “second tier” plan that uses a 20GB disk. However, the “one-click-upgrade” process didn’t work as I expected and what they did was to move my data to a bigger drive without actually extending the partitions. So now I have 10GB of unallocated space.

                                                                                          I do run around 5 websites on this VPS with mail accounts and all that jazz and I’m very scared to mess up anything so I called their support and they offered to do the job for me for 80 EUR that I find unacceptable since I thought it was included when doing the upgrade. Their older offers from last year used to be just a one click job but the excuse is that “SSD’s are different, so it’s up to the user”.

                                                                                          Anyway, how can I actually do that without screwing things up and is it possible to do that on a “live” system?

                                                                                          I know a couple of commands so here it goes what I could find:

                                                                                          root@vpsxxxxxx:~# df -h
                                                                                          Filesystem      Size  Used Avail Use% Mounted on
                                                                                          rootfs          9.9G  7.6G  1.8G  81% /
                                                                                          udev             10M     0   10M   0% /dev
                                                                                          tmpfs           388M  200K  388M   1% /run
                                                                                          /dev/vda1       9.9G  7.6G  1.8G  81% /
                                                                                          tmpfs           5.0M     0  5.0M   0% /run/lock
                                                                                          tmpfs           775M     0  775M   0% /run/shm
                                                                                          /dev/vda1       9.9G  7.6G  1.8G  81% /var/www/clients/client2/web2/log
                                                                                          /dev/vda1       9.9G  7.6G  1.8G  81% /var/www/clients/client1/web3/log
                                                                                          /dev/vda1       9.9G  7.6G  1.8G  81% /var/www/clients/client3/web5/log
                                                                                          /dev/vda1       9.9G  7.6G  1.8G  81% /var/www/clients/client5/web7/log
                                                                                          /dev/vda1       9.9G  7.6G  1.8G  81% /var/www/clients/client4/web6/log
                                                                                          
                                                                                          root@vpsxxxxxx:~# fdisk -l
                                                                                          
                                                                                          Disk /dev/vda: 21.5 GB, 21474836480 bytes
                                                                                          4 heads, 32 sectors/track, 327680 cylinders, total 41943040 sectors
                                                                                          Units = sectors of 1 * 512 = 512 bytes
                                                                                          Sector size (logical/physical): 512 bytes / 512 bytes
                                                                                          I/O size (minimum/optimal): 512 bytes / 512 bytes
                                                                                          Disk identifier: 0x00000000
                                                                                          
                                                                                             Device Boot      Start         End      Blocks   Id  System
                                                                                          /dev/vda1   *        2048    41943039    20970496   83  Linux
                                                                                          
                                                                                          root@vpsxxxxxx:~# sfdisk -l
                                                                                          
                                                                                          Disk /dev/vda: 41610 cylinders, 16 heads, 63 sectors/track
                                                                                          Warning: The partition table looks like it was made
                                                                                            for C/H/S=*/4/32 (instead of 41610/16/63).
                                                                                          For this listing I'll assume that geometry.
                                                                                          Units = cylinders of 65536 bytes, blocks of 1024 bytes, counting from 0
                                                                                          
                                                                                             Device Boot Start     End   #cyls    #blocks   Id  System
                                                                                          /dev/vda1   *     16  327679  327664   20970496   83  Linux
                                                                                          /dev/vda2          0       -       0          0    0  Empty
                                                                                          /dev/vda3          0       -       0          0    0  Empty
                                                                                          /dev/vda4          0       -       0          0    0  Empty
                                                                                          

                                                                                          share|improve this question

                                                                                          • Have you bumped the sys admins that host your site. This kind of “upgrade” seems half-assed to me honestly. I would ask them “What gives?” and see if they will expand your partitions for you. EDIT, just read the 80 euro part. Sheesh, good hosting is hard to find sometimes…

                                                                                            – datUser
                                                                                            Aug 12 ’15 at 19:54

                                                                                          1

                                                                                          I rent a VPS that uses a SSD of 10GB (Debian 7) and I upgraded yesterday to their “second tier” plan that uses a 20GB disk. However, the “one-click-upgrade” process didn’t work as I expected and what they did was to move my data to a bigger drive without actually extending the partitions. So now I have 10GB of unallocated space.

                                                                                          I do run around 5 websites on this VPS with mail accounts and all that jazz and I’m very scared to mess up anything so I called their support and they offered to do the job for me for 80 EUR that I find unacceptable since I thought it was included when doing the upgrade. Their older offers from last year used to be just a one click job but the excuse is that “SSD’s are different, so it’s up to the user”.

                                                                                          Anyway, how can I actually do that without screwing things up and is it possible to do that on a “live” system?

                                                                                          I know a couple of commands so here it goes what I could find:

                                                                                          root@vpsxxxxxx:~# df -h
                                                                                          Filesystem      Size  Used Avail Use% Mounted on
                                                                                          rootfs          9.9G  7.6G  1.8G  81% /
                                                                                          udev             10M     0   10M   0% /dev
                                                                                          tmpfs           388M  200K  388M   1% /run
                                                                                          /dev/vda1       9.9G  7.6G  1.8G  81% /
                                                                                          tmpfs           5.0M     0  5.0M   0% /run/lock
                                                                                          tmpfs           775M     0  775M   0% /run/shm
                                                                                          /dev/vda1       9.9G  7.6G  1.8G  81% /var/www/clients/client2/web2/log
                                                                                          /dev/vda1       9.9G  7.6G  1.8G  81% /var/www/clients/client1/web3/log
                                                                                          /dev/vda1       9.9G  7.6G  1.8G  81% /var/www/clients/client3/web5/log
                                                                                          /dev/vda1       9.9G  7.6G  1.8G  81% /var/www/clients/client5/web7/log
                                                                                          /dev/vda1       9.9G  7.6G  1.8G  81% /var/www/clients/client4/web6/log
                                                                                          
                                                                                          root@vpsxxxxxx:~# fdisk -l
                                                                                          
                                                                                          Disk /dev/vda: 21.5 GB, 21474836480 bytes
                                                                                          4 heads, 32 sectors/track, 327680 cylinders, total 41943040 sectors
                                                                                          Units = sectors of 1 * 512 = 512 bytes
                                                                                          Sector size (logical/physical): 512 bytes / 512 bytes
                                                                                          I/O size (minimum/optimal): 512 bytes / 512 bytes
                                                                                          Disk identifier: 0x00000000
                                                                                          
                                                                                             Device Boot      Start         End      Blocks   Id  System
                                                                                          /dev/vda1   *        2048    41943039    20970496   83  Linux
                                                                                          
                                                                                          root@vpsxxxxxx:~# sfdisk -l
                                                                                          
                                                                                          Disk /dev/vda: 41610 cylinders, 16 heads, 63 sectors/track
                                                                                          Warning: The partition table looks like it was made
                                                                                            for C/H/S=*/4/32 (instead of 41610/16/63).
                                                                                          For this listing I'll assume that geometry.
                                                                                          Units = cylinders of 65536 bytes, blocks of 1024 bytes, counting from 0
                                                                                          
                                                                                             Device Boot Start     End   #cyls    #blocks   Id  System
                                                                                          /dev/vda1   *     16  327679  327664   20970496   83  Linux
                                                                                          /dev/vda2          0       -       0          0    0  Empty
                                                                                          /dev/vda3          0       -       0          0    0  Empty
                                                                                          /dev/vda4          0       -       0          0    0  Empty
                                                                                          

                                                                                          share|improve this question

                                                                                          • Have you bumped the sys admins that host your site. This kind of “upgrade” seems half-assed to me honestly. I would ask them “What gives?” and see if they will expand your partitions for you. EDIT, just read the 80 euro part. Sheesh, good hosting is hard to find sometimes…

                                                                                            – datUser
                                                                                            Aug 12 ’15 at 19:54

                                                                                          1

                                                                                          1

                                                                                          1

                                                                                          I rent a VPS that uses a SSD of 10GB (Debian 7) and I upgraded yesterday to their “second tier” plan that uses a 20GB disk. However, the “one-click-upgrade” process didn’t work as I expected and what they did was to move my data to a bigger drive without actually extending the partitions. So now I have 10GB of unallocated space.

                                                                                          I do run around 5 websites on this VPS with mail accounts and all that jazz and I’m very scared to mess up anything so I called their support and they offered to do the job for me for 80 EUR that I find unacceptable since I thought it was included when doing the upgrade. Their older offers from last year used to be just a one click job but the excuse is that “SSD’s are different, so it’s up to the user”.

                                                                                          Anyway, how can I actually do that without screwing things up and is it possible to do that on a “live” system?

                                                                                          I know a couple of commands so here it goes what I could find:

                                                                                          root@vpsxxxxxx:~# df -h
                                                                                          Filesystem      Size  Used Avail Use% Mounted on
                                                                                          rootfs          9.9G  7.6G  1.8G  81% /
                                                                                          udev             10M     0   10M   0% /dev
                                                                                          tmpfs           388M  200K  388M   1% /run
                                                                                          /dev/vda1       9.9G  7.6G  1.8G  81% /
                                                                                          tmpfs           5.0M     0  5.0M   0% /run/lock
                                                                                          tmpfs           775M     0  775M   0% /run/shm
                                                                                          /dev/vda1       9.9G  7.6G  1.8G  81% /var/www/clients/client2/web2/log
                                                                                          /dev/vda1       9.9G  7.6G  1.8G  81% /var/www/clients/client1/web3/log
                                                                                          /dev/vda1       9.9G  7.6G  1.8G  81% /var/www/clients/client3/web5/log
                                                                                          /dev/vda1       9.9G  7.6G  1.8G  81% /var/www/clients/client5/web7/log
                                                                                          /dev/vda1       9.9G  7.6G  1.8G  81% /var/www/clients/client4/web6/log
                                                                                          
                                                                                          root@vpsxxxxxx:~# fdisk -l
                                                                                          
                                                                                          Disk /dev/vda: 21.5 GB, 21474836480 bytes
                                                                                          4 heads, 32 sectors/track, 327680 cylinders, total 41943040 sectors
                                                                                          Units = sectors of 1 * 512 = 512 bytes
                                                                                          Sector size (logical/physical): 512 bytes / 512 bytes
                                                                                          I/O size (minimum/optimal): 512 bytes / 512 bytes
                                                                                          Disk identifier: 0x00000000
                                                                                          
                                                                                             Device Boot      Start         End      Blocks   Id  System
                                                                                          /dev/vda1   *        2048    41943039    20970496   83  Linux
                                                                                          
                                                                                          root@vpsxxxxxx:~# sfdisk -l
                                                                                          
                                                                                          Disk /dev/vda: 41610 cylinders, 16 heads, 63 sectors/track
                                                                                          Warning: The partition table looks like it was made
                                                                                            for C/H/S=*/4/32 (instead of 41610/16/63).
                                                                                          For this listing I'll assume that geometry.
                                                                                          Units = cylinders of 65536 bytes, blocks of 1024 bytes, counting from 0
                                                                                          
                                                                                             Device Boot Start     End   #cyls    #blocks   Id  System
                                                                                          /dev/vda1   *     16  327679  327664   20970496   83  Linux
                                                                                          /dev/vda2          0       -       0          0    0  Empty
                                                                                          /dev/vda3          0       -       0          0    0  Empty
                                                                                          /dev/vda4          0       -       0          0    0  Empty
                                                                                          

                                                                                          share|improve this question

                                                                                          I rent a VPS that uses a SSD of 10GB (Debian 7) and I upgraded yesterday to their “second tier” plan that uses a 20GB disk. However, the “one-click-upgrade” process didn’t work as I expected and what they did was to move my data to a bigger drive without actually extending the partitions. So now I have 10GB of unallocated space.

                                                                                          I do run around 5 websites on this VPS with mail accounts and all that jazz and I’m very scared to mess up anything so I called their support and they offered to do the job for me for 80 EUR that I find unacceptable since I thought it was included when doing the upgrade. Their older offers from last year used to be just a one click job but the excuse is that “SSD’s are different, so it’s up to the user”.

                                                                                          Anyway, how can I actually do that without screwing things up and is it possible to do that on a “live” system?

                                                                                          I know a couple of commands so here it goes what I could find:

                                                                                          root@vpsxxxxxx:~# df -h
                                                                                          Filesystem      Size  Used Avail Use% Mounted on
                                                                                          rootfs          9.9G  7.6G  1.8G  81% /
                                                                                          udev             10M     0   10M   0% /dev
                                                                                          tmpfs           388M  200K  388M   1% /run
                                                                                          /dev/vda1       9.9G  7.6G  1.8G  81% /
                                                                                          tmpfs           5.0M     0  5.0M   0% /run/lock
                                                                                          tmpfs           775M     0  775M   0% /run/shm
                                                                                          /dev/vda1       9.9G  7.6G  1.8G  81% /var/www/clients/client2/web2/log
                                                                                          /dev/vda1       9.9G  7.6G  1.8G  81% /var/www/clients/client1/web3/log
                                                                                          /dev/vda1       9.9G  7.6G  1.8G  81% /var/www/clients/client3/web5/log
                                                                                          /dev/vda1       9.9G  7.6G  1.8G  81% /var/www/clients/client5/web7/log
                                                                                          /dev/vda1       9.9G  7.6G  1.8G  81% /var/www/clients/client4/web6/log
                                                                                          
                                                                                          root@vpsxxxxxx:~# fdisk -l
                                                                                          
                                                                                          Disk /dev/vda: 21.5 GB, 21474836480 bytes
                                                                                          4 heads, 32 sectors/track, 327680 cylinders, total 41943040 sectors
                                                                                          Units = sectors of 1 * 512 = 512 bytes
                                                                                          Sector size (logical/physical): 512 bytes / 512 bytes
                                                                                          I/O size (minimum/optimal): 512 bytes / 512 bytes
                                                                                          Disk identifier: 0x00000000
                                                                                          
                                                                                             Device Boot      Start         End      Blocks   Id  System
                                                                                          /dev/vda1   *        2048    41943039    20970496   83  Linux
                                                                                          
                                                                                          root@vpsxxxxxx:~# sfdisk -l
                                                                                          
                                                                                          Disk /dev/vda: 41610 cylinders, 16 heads, 63 sectors/track
                                                                                          Warning: The partition table looks like it was made
                                                                                            for C/H/S=*/4/32 (instead of 41610/16/63).
                                                                                          For this listing I'll assume that geometry.
                                                                                          Units = cylinders of 65536 bytes, blocks of 1024 bytes, counting from 0
                                                                                          
                                                                                             Device Boot Start     End   #cyls    #blocks   Id  System
                                                                                          /dev/vda1   *     16  327679  327664   20970496   83  Linux
                                                                                          /dev/vda2          0       -       0          0    0  Empty
                                                                                          /dev/vda3          0       -       0          0    0  Empty
                                                                                          /dev/vda4          0       -       0          0    0  Empty
                                                                                          

                                                                                          debian filesystems partition vps

                                                                                          share|improve this question

                                                                                          share|improve this question

                                                                                          share|improve this question

                                                                                          share|improve this question

                                                                                          edited Jan 26 at 23:58

                                                                                          Rui F Ribeiro

                                                                                          40.1k1479135

                                                                                          40.1k1479135

                                                                                          asked Aug 12 ’15 at 19:51

                                                                                          ArkymedesArkymedes

                                                                                          813

                                                                                          813

                                                                                          • Have you bumped the sys admins that host your site. This kind of “upgrade” seems half-assed to me honestly. I would ask them “What gives?” and see if they will expand your partitions for you. EDIT, just read the 80 euro part. Sheesh, good hosting is hard to find sometimes…

                                                                                            – datUser
                                                                                            Aug 12 ’15 at 19:54

                                                                                          • Have you bumped the sys admins that host your site. This kind of “upgrade” seems half-assed to me honestly. I would ask them “What gives?” and see if they will expand your partitions for you. EDIT, just read the 80 euro part. Sheesh, good hosting is hard to find sometimes…

                                                                                            – datUser
                                                                                            Aug 12 ’15 at 19:54

                                                                                          Have you bumped the sys admins that host your site. This kind of “upgrade” seems half-assed to me honestly. I would ask them “What gives?” and see if they will expand your partitions for you. EDIT, just read the 80 euro part. Sheesh, good hosting is hard to find sometimes…

                                                                                          – datUser
                                                                                          Aug 12 ’15 at 19:54

                                                                                          Have you bumped the sys admins that host your site. This kind of “upgrade” seems half-assed to me honestly. I would ask them “What gives?” and see if they will expand your partitions for you. EDIT, just read the 80 euro part. Sheesh, good hosting is hard to find sometimes…

                                                                                          – datUser
                                                                                          Aug 12 ’15 at 19:54

                                                                                          1 Answer
                                                                                          1

                                                                                          active

                                                                                          oldest

                                                                                          votes

                                                                                          2

                                                                                          fdisk -l shows that your new partition already occupies all 20GB of space, so all you need to do is resize the filesystem itself. There are various ways of doing this depending on the filesystem you’re using; if you have fsadm installed, you can use that:

                                                                                          fsadm resize /dev/vda1
                                                                                          

                                                                                          (this will work for ext2/ext3/ext4 filesystems as well as ReiserFS and XFS).

                                                                                          Otherwise, assuming ext2/ext3/ext4:

                                                                                          resize2fs /dev/vda1
                                                                                          

                                                                                          It should be possible to do this with the filesystems mounted, without rebooting. The commands will tell you if something is wrong before doing anything risky.

                                                                                          share|improve this answer

                                                                                          • Ok, that was ridiculously easy: the “resize2fs /dev/vda1” worked like a charm and took half a second to perform. Thanks so much for this!

                                                                                            – Arkymedes
                                                                                            Aug 12 ’15 at 22:06

                                                                                          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%2f222860%2fhow-to-extend-partition-to-all-unallocated-space-in-a-vps%23new-answer’, ‘question_page’);
                                                                                          }
                                                                                          );

                                                                                          Post as a guest

                                                                                          Required, but never shown

                                                                                          1 Answer
                                                                                          1

                                                                                          active

                                                                                          oldest

                                                                                          votes

                                                                                          1 Answer
                                                                                          1

                                                                                          active

                                                                                          oldest

                                                                                          votes

                                                                                          active

                                                                                          oldest

                                                                                          votes

                                                                                          active

                                                                                          oldest

                                                                                          votes

                                                                                          2

                                                                                          fdisk -l shows that your new partition already occupies all 20GB of space, so all you need to do is resize the filesystem itself. There are various ways of doing this depending on the filesystem you’re using; if you have fsadm installed, you can use that:

                                                                                          fsadm resize /dev/vda1
                                                                                          

                                                                                          (this will work for ext2/ext3/ext4 filesystems as well as ReiserFS and XFS).

                                                                                          Otherwise, assuming ext2/ext3/ext4:

                                                                                          resize2fs /dev/vda1
                                                                                          

                                                                                          It should be possible to do this with the filesystems mounted, without rebooting. The commands will tell you if something is wrong before doing anything risky.

                                                                                          share|improve this answer

                                                                                          • Ok, that was ridiculously easy: the “resize2fs /dev/vda1” worked like a charm and took half a second to perform. Thanks so much for this!

                                                                                            – Arkymedes
                                                                                            Aug 12 ’15 at 22:06

                                                                                          2

                                                                                          fdisk -l shows that your new partition already occupies all 20GB of space, so all you need to do is resize the filesystem itself. There are various ways of doing this depending on the filesystem you’re using; if you have fsadm installed, you can use that:

                                                                                          fsadm resize /dev/vda1
                                                                                          

                                                                                          (this will work for ext2/ext3/ext4 filesystems as well as ReiserFS and XFS).

                                                                                          Otherwise, assuming ext2/ext3/ext4:

                                                                                          resize2fs /dev/vda1
                                                                                          

                                                                                          It should be possible to do this with the filesystems mounted, without rebooting. The commands will tell you if something is wrong before doing anything risky.

                                                                                          share|improve this answer

                                                                                          • Ok, that was ridiculously easy: the “resize2fs /dev/vda1” worked like a charm and took half a second to perform. Thanks so much for this!

                                                                                            – Arkymedes
                                                                                            Aug 12 ’15 at 22:06

                                                                                          2

                                                                                          2

                                                                                          2

                                                                                          fdisk -l shows that your new partition already occupies all 20GB of space, so all you need to do is resize the filesystem itself. There are various ways of doing this depending on the filesystem you’re using; if you have fsadm installed, you can use that:

                                                                                          fsadm resize /dev/vda1
                                                                                          

                                                                                          (this will work for ext2/ext3/ext4 filesystems as well as ReiserFS and XFS).

                                                                                          Otherwise, assuming ext2/ext3/ext4:

                                                                                          resize2fs /dev/vda1
                                                                                          

                                                                                          It should be possible to do this with the filesystems mounted, without rebooting. The commands will tell you if something is wrong before doing anything risky.

                                                                                          share|improve this answer

                                                                                          fdisk -l shows that your new partition already occupies all 20GB of space, so all you need to do is resize the filesystem itself. There are various ways of doing this depending on the filesystem you’re using; if you have fsadm installed, you can use that:

                                                                                          fsadm resize /dev/vda1
                                                                                          

                                                                                          (this will work for ext2/ext3/ext4 filesystems as well as ReiserFS and XFS).

                                                                                          Otherwise, assuming ext2/ext3/ext4:

                                                                                          resize2fs /dev/vda1
                                                                                          

                                                                                          It should be possible to do this with the filesystems mounted, without rebooting. The commands will tell you if something is wrong before doing anything risky.

                                                                                          share|improve this answer

                                                                                          share|improve this answer

                                                                                          share|improve this answer

                                                                                          answered Aug 12 ’15 at 20:36

                                                                                          Stephen KittStephen Kitt

                                                                                          172k24386464

                                                                                          172k24386464

                                                                                          • Ok, that was ridiculously easy: the “resize2fs /dev/vda1” worked like a charm and took half a second to perform. Thanks so much for this!

                                                                                            – Arkymedes
                                                                                            Aug 12 ’15 at 22:06

                                                                                          • Ok, that was ridiculously easy: the “resize2fs /dev/vda1” worked like a charm and took half a second to perform. Thanks so much for this!

                                                                                            – Arkymedes
                                                                                            Aug 12 ’15 at 22:06

                                                                                          Ok, that was ridiculously easy: the “resize2fs /dev/vda1” worked like a charm and took half a second to perform. Thanks so much for this!

                                                                                          – Arkymedes
                                                                                          Aug 12 ’15 at 22:06

                                                                                          Ok, that was ridiculously easy: the “resize2fs /dev/vda1” worked like a charm and took half a second to perform. Thanks so much for this!

                                                                                          – Arkymedes
                                                                                          Aug 12 ’15 at 22:06

                                                                                          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%2f222860%2fhow-to-extend-partition-to-all-unallocated-space-in-a-vps%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

                                                                                          Installing OpenSUSE – Cannot format partitions

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

                                                                                          1

                                                                                          I’ll make this fast. OpenSUSE is throwing up a whole bunch of errors when I try to install it. I am 90% sure that the partitions I set up are correct, but the installer doesn’t seem impressed by my efforts. The error messages I got can be found here:

                                                                                          The Before and After labels indicate the partition setup that I ATTEMPTED to create:
                                                                                          BeforeAfterfailure setting disk labelfailure setting disk labelfailure mounting sdb3failure mounting sdb1failure mounting sdb2failure formatting sdb3failure formatting sdb2failure formatting sdb1failure creating volume sdb3failure creating volume sdb2error occurred during initrd creation

                                                                                          The phrase “unrecognised disk label” keeps coming up. Did I skip a step? I thought that labels were optional?

                                                                                          Oddly, Gparted does not seem to agree with SUSE on the disk’s contents. This concerns me.

                                                                                          gparted sdbgparted sdapartition list

                                                                                          Additional info:

                                                                                          user@debian~$ sudo parted /dev/sdb unit s print 
                                                                                          Error: /dev/sdb: unrecognised disk label
                                                                                          Model: ATA KINGSTON SV300S3 (scsi)
                                                                                          Disk /dev/sdb: 234441648s
                                                                                          Sector size (logical/physical): 512B/512B
                                                                                          Partition Table: msdos
                                                                                          Disk Flags:
                                                                                          
                                                                                          Number Start End Size Type File system Flags
                                                                                          

                                                                                          share|improve this question

                                                                                          • so you have to disks sda and sdb but sdb is the one with troubles?… Did you check if the drive is ok… ¿badblocks?

                                                                                            – maniat1k
                                                                                            Apr 23 ’15 at 1:15

                                                                                          • Yes, sda is a 2TB HDD and sdb is a 120GB SDD. Both drives worked just fine last week. The SSD is less than a year old, so I can’t imagine it going bad already.

                                                                                            – anthony
                                                                                            Apr 23 ’15 at 2:11

                                                                                          • They both seem to be acting oddly though. sda seems to sprout a set of Linux partitions while sdb is left with nothing. Could the installer be trying to write the OS onto sda even though the partitions were set up on sdb?

                                                                                            – anthony
                                                                                            Apr 23 ’15 at 2:12

                                                                                          • No. That’s not it. Removing the HDD didn’t change the result at all. So now I have an SSD that refuses to be formatted.

                                                                                            – anthony
                                                                                            Apr 23 ’15 at 3:28

                                                                                          • Tried the same thing with Debian. Got similar results. “The ext4 file system partition creation in partition #2 of SCSI1 (0, 1, 0) (sda) failed”

                                                                                            – anthony
                                                                                            Apr 23 ’15 at 5:02

                                                                                          1

                                                                                          I’ll make this fast. OpenSUSE is throwing up a whole bunch of errors when I try to install it. I am 90% sure that the partitions I set up are correct, but the installer doesn’t seem impressed by my efforts. The error messages I got can be found here:

                                                                                          The Before and After labels indicate the partition setup that I ATTEMPTED to create:
                                                                                          BeforeAfterfailure setting disk labelfailure setting disk labelfailure mounting sdb3failure mounting sdb1failure mounting sdb2failure formatting sdb3failure formatting sdb2failure formatting sdb1failure creating volume sdb3failure creating volume sdb2error occurred during initrd creation

                                                                                          The phrase “unrecognised disk label” keeps coming up. Did I skip a step? I thought that labels were optional?

                                                                                          Oddly, Gparted does not seem to agree with SUSE on the disk’s contents. This concerns me.

                                                                                          gparted sdbgparted sdapartition list

                                                                                          Additional info:

                                                                                          user@debian~$ sudo parted /dev/sdb unit s print 
                                                                                          Error: /dev/sdb: unrecognised disk label
                                                                                          Model: ATA KINGSTON SV300S3 (scsi)
                                                                                          Disk /dev/sdb: 234441648s
                                                                                          Sector size (logical/physical): 512B/512B
                                                                                          Partition Table: msdos
                                                                                          Disk Flags:
                                                                                          
                                                                                          Number Start End Size Type File system Flags
                                                                                          

                                                                                          share|improve this question

                                                                                          • so you have to disks sda and sdb but sdb is the one with troubles?… Did you check if the drive is ok… ¿badblocks?

                                                                                            – maniat1k
                                                                                            Apr 23 ’15 at 1:15

                                                                                          • Yes, sda is a 2TB HDD and sdb is a 120GB SDD. Both drives worked just fine last week. The SSD is less than a year old, so I can’t imagine it going bad already.

                                                                                            – anthony
                                                                                            Apr 23 ’15 at 2:11

                                                                                          • They both seem to be acting oddly though. sda seems to sprout a set of Linux partitions while sdb is left with nothing. Could the installer be trying to write the OS onto sda even though the partitions were set up on sdb?

                                                                                            – anthony
                                                                                            Apr 23 ’15 at 2:12

                                                                                          • No. That’s not it. Removing the HDD didn’t change the result at all. So now I have an SSD that refuses to be formatted.

                                                                                            – anthony
                                                                                            Apr 23 ’15 at 3:28

                                                                                          • Tried the same thing with Debian. Got similar results. “The ext4 file system partition creation in partition #2 of SCSI1 (0, 1, 0) (sda) failed”

                                                                                            – anthony
                                                                                            Apr 23 ’15 at 5:02

                                                                                          1

                                                                                          1

                                                                                          1

                                                                                          I’ll make this fast. OpenSUSE is throwing up a whole bunch of errors when I try to install it. I am 90% sure that the partitions I set up are correct, but the installer doesn’t seem impressed by my efforts. The error messages I got can be found here:

                                                                                          The Before and After labels indicate the partition setup that I ATTEMPTED to create:
                                                                                          BeforeAfterfailure setting disk labelfailure setting disk labelfailure mounting sdb3failure mounting sdb1failure mounting sdb2failure formatting sdb3failure formatting sdb2failure formatting sdb1failure creating volume sdb3failure creating volume sdb2error occurred during initrd creation

                                                                                          The phrase “unrecognised disk label” keeps coming up. Did I skip a step? I thought that labels were optional?

                                                                                          Oddly, Gparted does not seem to agree with SUSE on the disk’s contents. This concerns me.

                                                                                          gparted sdbgparted sdapartition list

                                                                                          Additional info:

                                                                                          user@debian~$ sudo parted /dev/sdb unit s print 
                                                                                          Error: /dev/sdb: unrecognised disk label
                                                                                          Model: ATA KINGSTON SV300S3 (scsi)
                                                                                          Disk /dev/sdb: 234441648s
                                                                                          Sector size (logical/physical): 512B/512B
                                                                                          Partition Table: msdos
                                                                                          Disk Flags:
                                                                                          
                                                                                          Number Start End Size Type File system Flags
                                                                                          

                                                                                          share|improve this question

                                                                                          I’ll make this fast. OpenSUSE is throwing up a whole bunch of errors when I try to install it. I am 90% sure that the partitions I set up are correct, but the installer doesn’t seem impressed by my efforts. The error messages I got can be found here:

                                                                                          The Before and After labels indicate the partition setup that I ATTEMPTED to create:
                                                                                          BeforeAfterfailure setting disk labelfailure setting disk labelfailure mounting sdb3failure mounting sdb1failure mounting sdb2failure formatting sdb3failure formatting sdb2failure formatting sdb1failure creating volume sdb3failure creating volume sdb2error occurred during initrd creation

                                                                                          The phrase “unrecognised disk label” keeps coming up. Did I skip a step? I thought that labels were optional?

                                                                                          Oddly, Gparted does not seem to agree with SUSE on the disk’s contents. This concerns me.

                                                                                          gparted sdbgparted sdapartition list

                                                                                          Additional info:

                                                                                          user@debian~$ sudo parted /dev/sdb unit s print 
                                                                                          Error: /dev/sdb: unrecognised disk label
                                                                                          Model: ATA KINGSTON SV300S3 (scsi)
                                                                                          Disk /dev/sdb: 234441648s
                                                                                          Sector size (logical/physical): 512B/512B
                                                                                          Partition Table: msdos
                                                                                          Disk Flags:
                                                                                          
                                                                                          Number Start End Size Type File system Flags
                                                                                          

                                                                                          partition system-installation opensuse

                                                                                          share|improve this question

                                                                                          share|improve this question

                                                                                          share|improve this question

                                                                                          share|improve this question

                                                                                          edited Apr 25 ’15 at 4:11

                                                                                          anthony

                                                                                          asked Apr 22 ’15 at 6:41

                                                                                          anthonyanthony

                                                                                          6619

                                                                                          6619

                                                                                          • so you have to disks sda and sdb but sdb is the one with troubles?… Did you check if the drive is ok… ¿badblocks?

                                                                                            – maniat1k
                                                                                            Apr 23 ’15 at 1:15

                                                                                          • Yes, sda is a 2TB HDD and sdb is a 120GB SDD. Both drives worked just fine last week. The SSD is less than a year old, so I can’t imagine it going bad already.

                                                                                            – anthony
                                                                                            Apr 23 ’15 at 2:11

                                                                                          • They both seem to be acting oddly though. sda seems to sprout a set of Linux partitions while sdb is left with nothing. Could the installer be trying to write the OS onto sda even though the partitions were set up on sdb?

                                                                                            – anthony
                                                                                            Apr 23 ’15 at 2:12

                                                                                          • No. That’s not it. Removing the HDD didn’t change the result at all. So now I have an SSD that refuses to be formatted.

                                                                                            – anthony
                                                                                            Apr 23 ’15 at 3:28

                                                                                          • Tried the same thing with Debian. Got similar results. “The ext4 file system partition creation in partition #2 of SCSI1 (0, 1, 0) (sda) failed”

                                                                                            – anthony
                                                                                            Apr 23 ’15 at 5:02

                                                                                          • so you have to disks sda and sdb but sdb is the one with troubles?… Did you check if the drive is ok… ¿badblocks?

                                                                                            – maniat1k
                                                                                            Apr 23 ’15 at 1:15

                                                                                          • Yes, sda is a 2TB HDD and sdb is a 120GB SDD. Both drives worked just fine last week. The SSD is less than a year old, so I can’t imagine it going bad already.

                                                                                            – anthony
                                                                                            Apr 23 ’15 at 2:11

                                                                                          • They both seem to be acting oddly though. sda seems to sprout a set of Linux partitions while sdb is left with nothing. Could the installer be trying to write the OS onto sda even though the partitions were set up on sdb?

                                                                                            – anthony
                                                                                            Apr 23 ’15 at 2:12

                                                                                          • No. That’s not it. Removing the HDD didn’t change the result at all. So now I have an SSD that refuses to be formatted.

                                                                                            – anthony
                                                                                            Apr 23 ’15 at 3:28

                                                                                          • Tried the same thing with Debian. Got similar results. “The ext4 file system partition creation in partition #2 of SCSI1 (0, 1, 0) (sda) failed”

                                                                                            – anthony
                                                                                            Apr 23 ’15 at 5:02

                                                                                          so you have to disks sda and sdb but sdb is the one with troubles?… Did you check if the drive is ok… ¿badblocks?

                                                                                          – maniat1k
                                                                                          Apr 23 ’15 at 1:15

                                                                                          so you have to disks sda and sdb but sdb is the one with troubles?… Did you check if the drive is ok… ¿badblocks?

                                                                                          – maniat1k
                                                                                          Apr 23 ’15 at 1:15

                                                                                          Yes, sda is a 2TB HDD and sdb is a 120GB SDD. Both drives worked just fine last week. The SSD is less than a year old, so I can’t imagine it going bad already.

                                                                                          – anthony
                                                                                          Apr 23 ’15 at 2:11

                                                                                          Yes, sda is a 2TB HDD and sdb is a 120GB SDD. Both drives worked just fine last week. The SSD is less than a year old, so I can’t imagine it going bad already.

                                                                                          – anthony
                                                                                          Apr 23 ’15 at 2:11

                                                                                          They both seem to be acting oddly though. sda seems to sprout a set of Linux partitions while sdb is left with nothing. Could the installer be trying to write the OS onto sda even though the partitions were set up on sdb?

                                                                                          – anthony
                                                                                          Apr 23 ’15 at 2:12

                                                                                          They both seem to be acting oddly though. sda seems to sprout a set of Linux partitions while sdb is left with nothing. Could the installer be trying to write the OS onto sda even though the partitions were set up on sdb?

                                                                                          – anthony
                                                                                          Apr 23 ’15 at 2:12

                                                                                          No. That’s not it. Removing the HDD didn’t change the result at all. So now I have an SSD that refuses to be formatted.

                                                                                          – anthony
                                                                                          Apr 23 ’15 at 3:28

                                                                                          No. That’s not it. Removing the HDD didn’t change the result at all. So now I have an SSD that refuses to be formatted.

                                                                                          – anthony
                                                                                          Apr 23 ’15 at 3:28

                                                                                          Tried the same thing with Debian. Got similar results. “The ext4 file system partition creation in partition #2 of SCSI1 (0, 1, 0) (sda) failed”

                                                                                          – anthony
                                                                                          Apr 23 ’15 at 5:02

                                                                                          Tried the same thing with Debian. Got similar results. “The ext4 file system partition creation in partition #2 of SCSI1 (0, 1, 0) (sda) failed”

                                                                                          – anthony
                                                                                          Apr 23 ’15 at 5:02

                                                                                          1 Answer
                                                                                          1

                                                                                          active

                                                                                          oldest

                                                                                          votes

                                                                                          0

                                                                                          Is the partition unallocated? Because from the picture in the beginning,
                                                                                          where it says “Setting disk label of /dev/sdb to GPT” I think it’s trying to give the hard disk an partition-table “GPT”.

                                                                                          I’ll suggest that try allocating the partition.

                                                                                          You could try the solution found from this link: OpenSuse Support

                                                                                          1. Boot and run opensuse live.
                                                                                          2. Open up the Terminal.
                                                                                          3. Gain ROOT privileges.
                                                                                          4. List the disks with the “fdisk -l” command.
                                                                                          5. Then use cfdisk(8) and delete the space you want use for
                                                                                            installation.
                                                                                          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’,
                                                                                            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%2f197814%2finstalling-opensuse-cannot-format-partitions%23new-answer’, ‘question_page’);
                                                                                            }
                                                                                            );

                                                                                            Post as a guest

                                                                                            Required, but never shown

                                                                                            1 Answer
                                                                                            1

                                                                                            active

                                                                                            oldest

                                                                                            votes

                                                                                            1 Answer
                                                                                            1

                                                                                            active

                                                                                            oldest

                                                                                            votes

                                                                                            active

                                                                                            oldest

                                                                                            votes

                                                                                            active

                                                                                            oldest

                                                                                            votes

                                                                                            0

                                                                                            Is the partition unallocated? Because from the picture in the beginning,
                                                                                            where it says “Setting disk label of /dev/sdb to GPT” I think it’s trying to give the hard disk an partition-table “GPT”.

                                                                                            I’ll suggest that try allocating the partition.

                                                                                            You could try the solution found from this link: OpenSuse Support

                                                                                            1. Boot and run opensuse live.
                                                                                            2. Open up the Terminal.
                                                                                            3. Gain ROOT privileges.
                                                                                            4. List the disks with the “fdisk -l” command.
                                                                                            5. Then use cfdisk(8) and delete the space you want use for
                                                                                              installation.
                                                                                            share|improve this answer

                                                                                              0

                                                                                              Is the partition unallocated? Because from the picture in the beginning,
                                                                                              where it says “Setting disk label of /dev/sdb to GPT” I think it’s trying to give the hard disk an partition-table “GPT”.

                                                                                              I’ll suggest that try allocating the partition.

                                                                                              You could try the solution found from this link: OpenSuse Support

                                                                                              1. Boot and run opensuse live.
                                                                                              2. Open up the Terminal.
                                                                                              3. Gain ROOT privileges.
                                                                                              4. List the disks with the “fdisk -l” command.
                                                                                              5. Then use cfdisk(8) and delete the space you want use for
                                                                                                installation.
                                                                                              share|improve this answer

                                                                                                0

                                                                                                0

                                                                                                0

                                                                                                Is the partition unallocated? Because from the picture in the beginning,
                                                                                                where it says “Setting disk label of /dev/sdb to GPT” I think it’s trying to give the hard disk an partition-table “GPT”.

                                                                                                I’ll suggest that try allocating the partition.

                                                                                                You could try the solution found from this link: OpenSuse Support

                                                                                                1. Boot and run opensuse live.
                                                                                                2. Open up the Terminal.
                                                                                                3. Gain ROOT privileges.
                                                                                                4. List the disks with the “fdisk -l” command.
                                                                                                5. Then use cfdisk(8) and delete the space you want use for
                                                                                                  installation.
                                                                                                share|improve this answer

                                                                                                Is the partition unallocated? Because from the picture in the beginning,
                                                                                                where it says “Setting disk label of /dev/sdb to GPT” I think it’s trying to give the hard disk an partition-table “GPT”.

                                                                                                I’ll suggest that try allocating the partition.

                                                                                                You could try the solution found from this link: OpenSuse Support

                                                                                                1. Boot and run opensuse live.
                                                                                                2. Open up the Terminal.
                                                                                                3. Gain ROOT privileges.
                                                                                                4. List the disks with the “fdisk -l” command.
                                                                                                5. Then use cfdisk(8) and delete the space you want use for
                                                                                                  installation.
                                                                                                share|improve this answer

                                                                                                share|improve this answer

                                                                                                share|improve this answer

                                                                                                answered May 1 ’15 at 14:12

                                                                                                Arne JensenArne Jensen

                                                                                                82

                                                                                                82

                                                                                                    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%2f197814%2finstalling-opensuse-cannot-format-partitions%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

                                                                                                    How to check integrity to HDD with UDF format

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

                                                                                                    0

                                                                                                    I’m having problem with a USB external drive, which seem to be formatted with UDF and was being used for MAC and Windows (or at least that is what told).

                                                                                                    When I attached the HDD to my Linux system the next are the dmesg entries:

                                                                                                    [21784.312960] usb 2-1.2: new high-speed USB device number 5 using ehci-pci
                                                                                                    **[21784.406283] usb 2-1.2: New USB device found, idVendor=1058, idProduct=1023**
                                                                                                    [21784.406291] usb 2-1.2: New USB device strings: Mfr=1,Product=2,SerialNumber=3
                                                                                                    [21784.406296] usb 2-1.2: Product: Elements 1023
                                                                                                    **[21784.406299] usb 2-1.2: Manufacturer: Western Digital**
                                                                                                    [21784.406303] usb 2-1.2: SerialNumber: <The serial number>
                                                                                                    [21784.406815] scsi8 : usb-storage 2-1.2:1.0
                                                                                                    [21785.403470] scsi 8:0:0:0: Direct-Access     WD       Elements 1023    2005 PQ: 0 ANSI: 4
                                                                                                    [21785.404686] sd 8:0:0:0: Attached scsi generic sg2 type 0
                                                                                                    [21785.409491] sd 8:0:0:0: [sdb] 1953519616 512-byte logical blocks: (1.00 TB/931 GiB)
                                                                                                    [21785.410605] sd 8:0:0:0: [sdb] Test WP failed, assume Write Enabled
                                                                                                    [21785.411723] sd 8:0:0:0: [sdb] Asking for cache data failed
                                                                                                    [21785.411729] sd 8:0:0:0: [sdb] Assuming drive cache: write through
                                                                                                    [21785.413600] sd 8:0:0:0: [sdb] Test WP failed, assume Write Enabled
                                                                                                    [21785.414603] sd 8:0:0:0: [sdb] Asking for cache data failed
                                                                                                    [21785.414609] sd 8:0:0:0: [sdb] Assuming drive cache: write through
                                                                                                    **[21785.449997]  sdb: sdb1 < >**
                                                                                                    [21785.452466] sd 8:0:0:0: [sdb] Test WP failed, assume Write Enabled
                                                                                                    [21785.453503] sd 8:0:0:0: [sdb] Asking for cache data failed
                                                                                                    [21785.453515] sd 8:0:0:0: [sdb] Assuming drive cache: write through
                                                                                                    [21785.453524] sd 8:0:0:0: [sdb] Attached SCSI disk
                                                                                                    

                                                                                                    With that information the HDD seem to be OK. However I’m unable to identify the type of partition (some commands from Windows console show is UDF but I can’t confirm with Linux counterparts)

                                                                                                    Trying to get more information, the fdisk -l outputs:

                                                                                                    Disk /dev/sdb: 1000.2 GB, 1000202043392 bytes
                                                                                                    255 heads, 63 sectors/track, 121600 cylinders, total 1953519616 sectors
                                                                                                    Units = sectors of 1 * 512 = 512 bytes
                                                                                                    Sector size (logical/physical): 512 bytes / 512 bytes
                                                                                                    I/O size (minimum/optimal): 512 bytes / 512 bytes
                                                                                                    Disk identifier: 0x0bba88f0
                                                                                                    
                                                                                                       Device Boot      Start         End      Blocks   Id  System
                                                                                                    /dev/sdb1               0  1953519615   976759808    5  Extended
                                                                                                    fdisk: unable to read /dev/sdb1: Inappropriate ioctl for device
                                                                                                    

                                                                                                    As the partition doesn’t mount, tools like testdisk and fsck can’t work here (well testdisk and photorec just freeze trying to read the HDD). And due the size of the disk the badblocks command takes a lot of time (and is still running).

                                                                                                    I can’t find many material about the UDF format (and I don’t understand why a HDD use it when is ) and neither what to do when is unable to read any partition at all.

                                                                                                    Any suggestion?

                                                                                                    share|improve this question

                                                                                                    • Try file -s /dev/sdb which will look at the beginning of the disk and try to figure out the format.

                                                                                                      – Mark Plotnick
                                                                                                      Jan 17 ’14 at 13:13

                                                                                                    • I begin to think the original partition was FAT32 and maybe just maybe the MBR is what is lost.

                                                                                                      – RFuentess
                                                                                                      Jan 17 ’14 at 18:49

                                                                                                    0

                                                                                                    I’m having problem with a USB external drive, which seem to be formatted with UDF and was being used for MAC and Windows (or at least that is what told).

                                                                                                    When I attached the HDD to my Linux system the next are the dmesg entries:

                                                                                                    [21784.312960] usb 2-1.2: new high-speed USB device number 5 using ehci-pci
                                                                                                    **[21784.406283] usb 2-1.2: New USB device found, idVendor=1058, idProduct=1023**
                                                                                                    [21784.406291] usb 2-1.2: New USB device strings: Mfr=1,Product=2,SerialNumber=3
                                                                                                    [21784.406296] usb 2-1.2: Product: Elements 1023
                                                                                                    **[21784.406299] usb 2-1.2: Manufacturer: Western Digital**
                                                                                                    [21784.406303] usb 2-1.2: SerialNumber: <The serial number>
                                                                                                    [21784.406815] scsi8 : usb-storage 2-1.2:1.0
                                                                                                    [21785.403470] scsi 8:0:0:0: Direct-Access     WD       Elements 1023    2005 PQ: 0 ANSI: 4
                                                                                                    [21785.404686] sd 8:0:0:0: Attached scsi generic sg2 type 0
                                                                                                    [21785.409491] sd 8:0:0:0: [sdb] 1953519616 512-byte logical blocks: (1.00 TB/931 GiB)
                                                                                                    [21785.410605] sd 8:0:0:0: [sdb] Test WP failed, assume Write Enabled
                                                                                                    [21785.411723] sd 8:0:0:0: [sdb] Asking for cache data failed
                                                                                                    [21785.411729] sd 8:0:0:0: [sdb] Assuming drive cache: write through
                                                                                                    [21785.413600] sd 8:0:0:0: [sdb] Test WP failed, assume Write Enabled
                                                                                                    [21785.414603] sd 8:0:0:0: [sdb] Asking for cache data failed
                                                                                                    [21785.414609] sd 8:0:0:0: [sdb] Assuming drive cache: write through
                                                                                                    **[21785.449997]  sdb: sdb1 < >**
                                                                                                    [21785.452466] sd 8:0:0:0: [sdb] Test WP failed, assume Write Enabled
                                                                                                    [21785.453503] sd 8:0:0:0: [sdb] Asking for cache data failed
                                                                                                    [21785.453515] sd 8:0:0:0: [sdb] Assuming drive cache: write through
                                                                                                    [21785.453524] sd 8:0:0:0: [sdb] Attached SCSI disk
                                                                                                    

                                                                                                    With that information the HDD seem to be OK. However I’m unable to identify the type of partition (some commands from Windows console show is UDF but I can’t confirm with Linux counterparts)

                                                                                                    Trying to get more information, the fdisk -l outputs:

                                                                                                    Disk /dev/sdb: 1000.2 GB, 1000202043392 bytes
                                                                                                    255 heads, 63 sectors/track, 121600 cylinders, total 1953519616 sectors
                                                                                                    Units = sectors of 1 * 512 = 512 bytes
                                                                                                    Sector size (logical/physical): 512 bytes / 512 bytes
                                                                                                    I/O size (minimum/optimal): 512 bytes / 512 bytes
                                                                                                    Disk identifier: 0x0bba88f0
                                                                                                    
                                                                                                       Device Boot      Start         End      Blocks   Id  System
                                                                                                    /dev/sdb1               0  1953519615   976759808    5  Extended
                                                                                                    fdisk: unable to read /dev/sdb1: Inappropriate ioctl for device
                                                                                                    

                                                                                                    As the partition doesn’t mount, tools like testdisk and fsck can’t work here (well testdisk and photorec just freeze trying to read the HDD). And due the size of the disk the badblocks command takes a lot of time (and is still running).

                                                                                                    I can’t find many material about the UDF format (and I don’t understand why a HDD use it when is ) and neither what to do when is unable to read any partition at all.

                                                                                                    Any suggestion?

                                                                                                    share|improve this question

                                                                                                    • Try file -s /dev/sdb which will look at the beginning of the disk and try to figure out the format.

                                                                                                      – Mark Plotnick
                                                                                                      Jan 17 ’14 at 13:13

                                                                                                    • I begin to think the original partition was FAT32 and maybe just maybe the MBR is what is lost.

                                                                                                      – RFuentess
                                                                                                      Jan 17 ’14 at 18:49

                                                                                                    0

                                                                                                    0

                                                                                                    0

                                                                                                    0

                                                                                                    I’m having problem with a USB external drive, which seem to be formatted with UDF and was being used for MAC and Windows (or at least that is what told).

                                                                                                    When I attached the HDD to my Linux system the next are the dmesg entries:

                                                                                                    [21784.312960] usb 2-1.2: new high-speed USB device number 5 using ehci-pci
                                                                                                    **[21784.406283] usb 2-1.2: New USB device found, idVendor=1058, idProduct=1023**
                                                                                                    [21784.406291] usb 2-1.2: New USB device strings: Mfr=1,Product=2,SerialNumber=3
                                                                                                    [21784.406296] usb 2-1.2: Product: Elements 1023
                                                                                                    **[21784.406299] usb 2-1.2: Manufacturer: Western Digital**
                                                                                                    [21784.406303] usb 2-1.2: SerialNumber: <The serial number>
                                                                                                    [21784.406815] scsi8 : usb-storage 2-1.2:1.0
                                                                                                    [21785.403470] scsi 8:0:0:0: Direct-Access     WD       Elements 1023    2005 PQ: 0 ANSI: 4
                                                                                                    [21785.404686] sd 8:0:0:0: Attached scsi generic sg2 type 0
                                                                                                    [21785.409491] sd 8:0:0:0: [sdb] 1953519616 512-byte logical blocks: (1.00 TB/931 GiB)
                                                                                                    [21785.410605] sd 8:0:0:0: [sdb] Test WP failed, assume Write Enabled
                                                                                                    [21785.411723] sd 8:0:0:0: [sdb] Asking for cache data failed
                                                                                                    [21785.411729] sd 8:0:0:0: [sdb] Assuming drive cache: write through
                                                                                                    [21785.413600] sd 8:0:0:0: [sdb] Test WP failed, assume Write Enabled
                                                                                                    [21785.414603] sd 8:0:0:0: [sdb] Asking for cache data failed
                                                                                                    [21785.414609] sd 8:0:0:0: [sdb] Assuming drive cache: write through
                                                                                                    **[21785.449997]  sdb: sdb1 < >**
                                                                                                    [21785.452466] sd 8:0:0:0: [sdb] Test WP failed, assume Write Enabled
                                                                                                    [21785.453503] sd 8:0:0:0: [sdb] Asking for cache data failed
                                                                                                    [21785.453515] sd 8:0:0:0: [sdb] Assuming drive cache: write through
                                                                                                    [21785.453524] sd 8:0:0:0: [sdb] Attached SCSI disk
                                                                                                    

                                                                                                    With that information the HDD seem to be OK. However I’m unable to identify the type of partition (some commands from Windows console show is UDF but I can’t confirm with Linux counterparts)

                                                                                                    Trying to get more information, the fdisk -l outputs:

                                                                                                    Disk /dev/sdb: 1000.2 GB, 1000202043392 bytes
                                                                                                    255 heads, 63 sectors/track, 121600 cylinders, total 1953519616 sectors
                                                                                                    Units = sectors of 1 * 512 = 512 bytes
                                                                                                    Sector size (logical/physical): 512 bytes / 512 bytes
                                                                                                    I/O size (minimum/optimal): 512 bytes / 512 bytes
                                                                                                    Disk identifier: 0x0bba88f0
                                                                                                    
                                                                                                       Device Boot      Start         End      Blocks   Id  System
                                                                                                    /dev/sdb1               0  1953519615   976759808    5  Extended
                                                                                                    fdisk: unable to read /dev/sdb1: Inappropriate ioctl for device
                                                                                                    

                                                                                                    As the partition doesn’t mount, tools like testdisk and fsck can’t work here (well testdisk and photorec just freeze trying to read the HDD). And due the size of the disk the badblocks command takes a lot of time (and is still running).

                                                                                                    I can’t find many material about the UDF format (and I don’t understand why a HDD use it when is ) and neither what to do when is unable to read any partition at all.

                                                                                                    Any suggestion?

                                                                                                    share|improve this question

                                                                                                    I’m having problem with a USB external drive, which seem to be formatted with UDF and was being used for MAC and Windows (or at least that is what told).

                                                                                                    When I attached the HDD to my Linux system the next are the dmesg entries:

                                                                                                    [21784.312960] usb 2-1.2: new high-speed USB device number 5 using ehci-pci
                                                                                                    **[21784.406283] usb 2-1.2: New USB device found, idVendor=1058, idProduct=1023**
                                                                                                    [21784.406291] usb 2-1.2: New USB device strings: Mfr=1,Product=2,SerialNumber=3
                                                                                                    [21784.406296] usb 2-1.2: Product: Elements 1023
                                                                                                    **[21784.406299] usb 2-1.2: Manufacturer: Western Digital**
                                                                                                    [21784.406303] usb 2-1.2: SerialNumber: <The serial number>
                                                                                                    [21784.406815] scsi8 : usb-storage 2-1.2:1.0
                                                                                                    [21785.403470] scsi 8:0:0:0: Direct-Access     WD       Elements 1023    2005 PQ: 0 ANSI: 4
                                                                                                    [21785.404686] sd 8:0:0:0: Attached scsi generic sg2 type 0
                                                                                                    [21785.409491] sd 8:0:0:0: [sdb] 1953519616 512-byte logical blocks: (1.00 TB/931 GiB)
                                                                                                    [21785.410605] sd 8:0:0:0: [sdb] Test WP failed, assume Write Enabled
                                                                                                    [21785.411723] sd 8:0:0:0: [sdb] Asking for cache data failed
                                                                                                    [21785.411729] sd 8:0:0:0: [sdb] Assuming drive cache: write through
                                                                                                    [21785.413600] sd 8:0:0:0: [sdb] Test WP failed, assume Write Enabled
                                                                                                    [21785.414603] sd 8:0:0:0: [sdb] Asking for cache data failed
                                                                                                    [21785.414609] sd 8:0:0:0: [sdb] Assuming drive cache: write through
                                                                                                    **[21785.449997]  sdb: sdb1 < >**
                                                                                                    [21785.452466] sd 8:0:0:0: [sdb] Test WP failed, assume Write Enabled
                                                                                                    [21785.453503] sd 8:0:0:0: [sdb] Asking for cache data failed
                                                                                                    [21785.453515] sd 8:0:0:0: [sdb] Assuming drive cache: write through
                                                                                                    [21785.453524] sd 8:0:0:0: [sdb] Attached SCSI disk
                                                                                                    

                                                                                                    With that information the HDD seem to be OK. However I’m unable to identify the type of partition (some commands from Windows console show is UDF but I can’t confirm with Linux counterparts)

                                                                                                    Trying to get more information, the fdisk -l outputs:

                                                                                                    Disk /dev/sdb: 1000.2 GB, 1000202043392 bytes
                                                                                                    255 heads, 63 sectors/track, 121600 cylinders, total 1953519616 sectors
                                                                                                    Units = sectors of 1 * 512 = 512 bytes
                                                                                                    Sector size (logical/physical): 512 bytes / 512 bytes
                                                                                                    I/O size (minimum/optimal): 512 bytes / 512 bytes
                                                                                                    Disk identifier: 0x0bba88f0
                                                                                                    
                                                                                                       Device Boot      Start         End      Blocks   Id  System
                                                                                                    /dev/sdb1               0  1953519615   976759808    5  Extended
                                                                                                    fdisk: unable to read /dev/sdb1: Inappropriate ioctl for device
                                                                                                    

                                                                                                    As the partition doesn’t mount, tools like testdisk and fsck can’t work here (well testdisk and photorec just freeze trying to read the HDD). And due the size of the disk the badblocks command takes a lot of time (and is still running).

                                                                                                    I can’t find many material about the UDF format (and I don’t understand why a HDD use it when is ) and neither what to do when is unable to read any partition at all.

                                                                                                    Any suggestion?

                                                                                                    partition hard-disk fdisk badblocks udf

                                                                                                    share|improve this question

                                                                                                    share|improve this question

                                                                                                    share|improve this question

                                                                                                    share|improve this question

                                                                                                    edited Jan 20 ’16 at 14:38

                                                                                                    don_crissti

                                                                                                    50.9k15135163

                                                                                                    50.9k15135163

                                                                                                    asked Jan 17 ’14 at 6:03

                                                                                                    RFuentessRFuentess

                                                                                                    11

                                                                                                    11

                                                                                                    • Try file -s /dev/sdb which will look at the beginning of the disk and try to figure out the format.

                                                                                                      – Mark Plotnick
                                                                                                      Jan 17 ’14 at 13:13

                                                                                                    • I begin to think the original partition was FAT32 and maybe just maybe the MBR is what is lost.

                                                                                                      – RFuentess
                                                                                                      Jan 17 ’14 at 18:49

                                                                                                    • Try file -s /dev/sdb which will look at the beginning of the disk and try to figure out the format.

                                                                                                      – Mark Plotnick
                                                                                                      Jan 17 ’14 at 13:13

                                                                                                    • I begin to think the original partition was FAT32 and maybe just maybe the MBR is what is lost.

                                                                                                      – RFuentess
                                                                                                      Jan 17 ’14 at 18:49

                                                                                                    Try file -s /dev/sdb which will look at the beginning of the disk and try to figure out the format.

                                                                                                    – Mark Plotnick
                                                                                                    Jan 17 ’14 at 13:13

                                                                                                    Try file -s /dev/sdb which will look at the beginning of the disk and try to figure out the format.

                                                                                                    – Mark Plotnick
                                                                                                    Jan 17 ’14 at 13:13

                                                                                                    I begin to think the original partition was FAT32 and maybe just maybe the MBR is what is lost.

                                                                                                    – RFuentess
                                                                                                    Jan 17 ’14 at 18:49

                                                                                                    I begin to think the original partition was FAT32 and maybe just maybe the MBR is what is lost.

                                                                                                    – RFuentess
                                                                                                    Jan 17 ’14 at 18:49

                                                                                                    1 Answer
                                                                                                    1

                                                                                                    active

                                                                                                    oldest

                                                                                                    votes

                                                                                                    0

                                                                                                    I think Windows is mistaken in considering it an UDF disk. Windows is in my (fortunately limited) experience not the best judge of such things.

                                                                                                    You could just try and mount the disk in read only mode:

                                                                                                    sudo mkdir /tmp/udf
                                                                                                    mount -o ro /dev/sdb /tmp/udf
                                                                                                    

                                                                                                    trying /dev/sdb1 probably does not work. fdisk would also at least recognise a disc with parted partitioning information, but if the disc was partitioned on Windows/Mac there might be something it might not know about. You could use

                                                                                                    gparted -l
                                                                                                    

                                                                                                    and see if that brings you more.

                                                                                                    I would however start with hanging this of a Windows and Mac and first make sure things work there before wasting your time on a possible empty/wiped disc on Linux.

                                                                                                    share|improve this answer

                                                                                                    • Thanks @timo. Trying to mount only read mode throw “mount: you must specify the filesystem type”. Gparted give the next error “Invalid partition table – recursive partition on /dev/sdb”. Mac and Windows machine aren’t able to mount the disc, however my first tries to fix it were with Windows own tools (chkdsk, partdsk, etc.) but were getting a error about “only read mode” and the info about the UDF filesystem. By the way, I already tried to mount as exfat or Fat32 (Whcih are common to Windows/Mac) withouth success and badblocks didn’t detect errors on the disk.

                                                                                                      – RFuentess
                                                                                                      Jan 17 ’14 at 15:20

                                                                                                    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%2f109724%2fhow-to-check-integrity-to-hdd-with-udf-format%23new-answer’, ‘question_page’);
                                                                                                    }
                                                                                                    );

                                                                                                    Post as a guest

                                                                                                    Required, but never shown

                                                                                                    1 Answer
                                                                                                    1

                                                                                                    active

                                                                                                    oldest

                                                                                                    votes

                                                                                                    1 Answer
                                                                                                    1

                                                                                                    active

                                                                                                    oldest

                                                                                                    votes

                                                                                                    active

                                                                                                    oldest

                                                                                                    votes

                                                                                                    active

                                                                                                    oldest

                                                                                                    votes

                                                                                                    0

                                                                                                    I think Windows is mistaken in considering it an UDF disk. Windows is in my (fortunately limited) experience not the best judge of such things.

                                                                                                    You could just try and mount the disk in read only mode:

                                                                                                    sudo mkdir /tmp/udf
                                                                                                    mount -o ro /dev/sdb /tmp/udf
                                                                                                    

                                                                                                    trying /dev/sdb1 probably does not work. fdisk would also at least recognise a disc with parted partitioning information, but if the disc was partitioned on Windows/Mac there might be something it might not know about. You could use

                                                                                                    gparted -l
                                                                                                    

                                                                                                    and see if that brings you more.

                                                                                                    I would however start with hanging this of a Windows and Mac and first make sure things work there before wasting your time on a possible empty/wiped disc on Linux.

                                                                                                    share|improve this answer

                                                                                                    • Thanks @timo. Trying to mount only read mode throw “mount: you must specify the filesystem type”. Gparted give the next error “Invalid partition table – recursive partition on /dev/sdb”. Mac and Windows machine aren’t able to mount the disc, however my first tries to fix it were with Windows own tools (chkdsk, partdsk, etc.) but were getting a error about “only read mode” and the info about the UDF filesystem. By the way, I already tried to mount as exfat or Fat32 (Whcih are common to Windows/Mac) withouth success and badblocks didn’t detect errors on the disk.

                                                                                                      – RFuentess
                                                                                                      Jan 17 ’14 at 15:20

                                                                                                    0

                                                                                                    I think Windows is mistaken in considering it an UDF disk. Windows is in my (fortunately limited) experience not the best judge of such things.

                                                                                                    You could just try and mount the disk in read only mode:

                                                                                                    sudo mkdir /tmp/udf
                                                                                                    mount -o ro /dev/sdb /tmp/udf
                                                                                                    

                                                                                                    trying /dev/sdb1 probably does not work. fdisk would also at least recognise a disc with parted partitioning information, but if the disc was partitioned on Windows/Mac there might be something it might not know about. You could use

                                                                                                    gparted -l
                                                                                                    

                                                                                                    and see if that brings you more.

                                                                                                    I would however start with hanging this of a Windows and Mac and first make sure things work there before wasting your time on a possible empty/wiped disc on Linux.

                                                                                                    share|improve this answer

                                                                                                    • Thanks @timo. Trying to mount only read mode throw “mount: you must specify the filesystem type”. Gparted give the next error “Invalid partition table – recursive partition on /dev/sdb”. Mac and Windows machine aren’t able to mount the disc, however my first tries to fix it were with Windows own tools (chkdsk, partdsk, etc.) but were getting a error about “only read mode” and the info about the UDF filesystem. By the way, I already tried to mount as exfat or Fat32 (Whcih are common to Windows/Mac) withouth success and badblocks didn’t detect errors on the disk.

                                                                                                      – RFuentess
                                                                                                      Jan 17 ’14 at 15:20

                                                                                                    0

                                                                                                    0

                                                                                                    0

                                                                                                    I think Windows is mistaken in considering it an UDF disk. Windows is in my (fortunately limited) experience not the best judge of such things.

                                                                                                    You could just try and mount the disk in read only mode:

                                                                                                    sudo mkdir /tmp/udf
                                                                                                    mount -o ro /dev/sdb /tmp/udf
                                                                                                    

                                                                                                    trying /dev/sdb1 probably does not work. fdisk would also at least recognise a disc with parted partitioning information, but if the disc was partitioned on Windows/Mac there might be something it might not know about. You could use

                                                                                                    gparted -l
                                                                                                    

                                                                                                    and see if that brings you more.

                                                                                                    I would however start with hanging this of a Windows and Mac and first make sure things work there before wasting your time on a possible empty/wiped disc on Linux.

                                                                                                    share|improve this answer

                                                                                                    I think Windows is mistaken in considering it an UDF disk. Windows is in my (fortunately limited) experience not the best judge of such things.

                                                                                                    You could just try and mount the disk in read only mode:

                                                                                                    sudo mkdir /tmp/udf
                                                                                                    mount -o ro /dev/sdb /tmp/udf
                                                                                                    

                                                                                                    trying /dev/sdb1 probably does not work. fdisk would also at least recognise a disc with parted partitioning information, but if the disc was partitioned on Windows/Mac there might be something it might not know about. You could use

                                                                                                    gparted -l
                                                                                                    

                                                                                                    and see if that brings you more.

                                                                                                    I would however start with hanging this of a Windows and Mac and first make sure things work there before wasting your time on a possible empty/wiped disc on Linux.

                                                                                                    share|improve this answer

                                                                                                    share|improve this answer

                                                                                                    share|improve this answer

                                                                                                    answered Jan 17 ’14 at 6:51

                                                                                                    TimoTimo

                                                                                                    4,7501826

                                                                                                    4,7501826

                                                                                                    • Thanks @timo. Trying to mount only read mode throw “mount: you must specify the filesystem type”. Gparted give the next error “Invalid partition table – recursive partition on /dev/sdb”. Mac and Windows machine aren’t able to mount the disc, however my first tries to fix it were with Windows own tools (chkdsk, partdsk, etc.) but were getting a error about “only read mode” and the info about the UDF filesystem. By the way, I already tried to mount as exfat or Fat32 (Whcih are common to Windows/Mac) withouth success and badblocks didn’t detect errors on the disk.

                                                                                                      – RFuentess
                                                                                                      Jan 17 ’14 at 15:20

                                                                                                    • Thanks @timo. Trying to mount only read mode throw “mount: you must specify the filesystem type”. Gparted give the next error “Invalid partition table – recursive partition on /dev/sdb”. Mac and Windows machine aren’t able to mount the disc, however my first tries to fix it were with Windows own tools (chkdsk, partdsk, etc.) but were getting a error about “only read mode” and the info about the UDF filesystem. By the way, I already tried to mount as exfat or Fat32 (Whcih are common to Windows/Mac) withouth success and badblocks didn’t detect errors on the disk.

                                                                                                      – RFuentess
                                                                                                      Jan 17 ’14 at 15:20

                                                                                                    Thanks @timo. Trying to mount only read mode throw “mount: you must specify the filesystem type”. Gparted give the next error “Invalid partition table – recursive partition on /dev/sdb”. Mac and Windows machine aren’t able to mount the disc, however my first tries to fix it were with Windows own tools (chkdsk, partdsk, etc.) but were getting a error about “only read mode” and the info about the UDF filesystem. By the way, I already tried to mount as exfat or Fat32 (Whcih are common to Windows/Mac) withouth success and badblocks didn’t detect errors on the disk.

                                                                                                    – RFuentess
                                                                                                    Jan 17 ’14 at 15:20

                                                                                                    Thanks @timo. Trying to mount only read mode throw “mount: you must specify the filesystem type”. Gparted give the next error “Invalid partition table – recursive partition on /dev/sdb”. Mac and Windows machine aren’t able to mount the disc, however my first tries to fix it were with Windows own tools (chkdsk, partdsk, etc.) but were getting a error about “only read mode” and the info about the UDF filesystem. By the way, I already tried to mount as exfat or Fat32 (Whcih are common to Windows/Mac) withouth success and badblocks didn’t detect errors on the disk.

                                                                                                    – RFuentess
                                                                                                    Jan 17 ’14 at 15:20

                                                                                                    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%2f109724%2fhow-to-check-integrity-to-hdd-with-udf-format%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

                                                                                                    Problem with partitions while installing Manjaro from Live USB

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

                                                                                                    0

                                                                                                    I created a live USB using Rufus (with DD) using this version from the offical page:
                                                                                                    manjaro-xfce-18.0.2-stable-x86_64.iso

                                                                                                    I use a Lenovo Yoga 720. I disabled secure boot and fast boot in the bios.

                                                                                                    Everything worked fine, but when I wanted to install Manjaro using the gui, the program would not let me choose a hard drive, let alone a partition to install to.

                                                                                                    Does anyone know what my problem is?

                                                                                                    Can't select storage device

                                                                                                    share|improve this question

                                                                                                      0

                                                                                                      I created a live USB using Rufus (with DD) using this version from the offical page:
                                                                                                      manjaro-xfce-18.0.2-stable-x86_64.iso

                                                                                                      I use a Lenovo Yoga 720. I disabled secure boot and fast boot in the bios.

                                                                                                      Everything worked fine, but when I wanted to install Manjaro using the gui, the program would not let me choose a hard drive, let alone a partition to install to.

                                                                                                      Does anyone know what my problem is?

                                                                                                      Can't select storage device

                                                                                                      share|improve this question

                                                                                                        0

                                                                                                        0

                                                                                                        0

                                                                                                        I created a live USB using Rufus (with DD) using this version from the offical page:
                                                                                                        manjaro-xfce-18.0.2-stable-x86_64.iso

                                                                                                        I use a Lenovo Yoga 720. I disabled secure boot and fast boot in the bios.

                                                                                                        Everything worked fine, but when I wanted to install Manjaro using the gui, the program would not let me choose a hard drive, let alone a partition to install to.

                                                                                                        Does anyone know what my problem is?

                                                                                                        Can't select storage device

                                                                                                        share|improve this question

                                                                                                        I created a live USB using Rufus (with DD) using this version from the offical page:
                                                                                                        manjaro-xfce-18.0.2-stable-x86_64.iso

                                                                                                        I use a Lenovo Yoga 720. I disabled secure boot and fast boot in the bios.

                                                                                                        Everything worked fine, but when I wanted to install Manjaro using the gui, the program would not let me choose a hard drive, let alone a partition to install to.

                                                                                                        Does anyone know what my problem is?

                                                                                                        Can't select storage device

                                                                                                        partition system-installation manjaro

                                                                                                        share|improve this question

                                                                                                        share|improve this question

                                                                                                        share|improve this question

                                                                                                        share|improve this question

                                                                                                        edited Jan 26 at 21:18

                                                                                                        Rui F Ribeiro

                                                                                                        40.1k1479135

                                                                                                        40.1k1479135

                                                                                                        asked Jan 26 at 21:13

                                                                                                        Flo KFlo K

                                                                                                        112

                                                                                                        112

                                                                                                            0

                                                                                                            active

                                                                                                            oldest

                                                                                                            votes

                                                                                                            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%2f496933%2fproblem-with-partitions-while-installing-manjaro-from-live-usb%23new-answer’, ‘question_page’);
                                                                                                            }
                                                                                                            );

                                                                                                            Post as a guest

                                                                                                            Required, but never shown

                                                                                                            0

                                                                                                            active

                                                                                                            oldest

                                                                                                            votes

                                                                                                            0

                                                                                                            active

                                                                                                            oldest

                                                                                                            votes

                                                                                                            active

                                                                                                            oldest

                                                                                                            votes

                                                                                                            active

                                                                                                            oldest

                                                                                                            votes

                                                                                                            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%2f496933%2fproblem-with-partitions-while-installing-manjaro-from-live-usb%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

                                                                                                            Why can’t Windows read Linux filesystems? [closed]

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

                                                                                                            -2

                                                                                                            When playing with filesystems and partition, I realized that when I created a ext file system on my USB drive and plug it to Windows, I am forced to format it. On the other end, when building a FAT partition on Windows, and plugging it to my virtual machine, Linux is perfectly able to read and mount my FAT partition.

                                                                                                            1 – Why can’t Windows read Linux filesystems?

                                                                                                            2 – What’s the key difference that allows Linux to do it, yet Windows can’t?

                                                                                                            share|improve this question

                                                                                                            closed as too broad by Thomas Dickey, Rui F Ribeiro, Thomas, RalfFriedl, mosvy Jan 26 at 20:59

                                                                                                            Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

                                                                                                              -2

                                                                                                              When playing with filesystems and partition, I realized that when I created a ext file system on my USB drive and plug it to Windows, I am forced to format it. On the other end, when building a FAT partition on Windows, and plugging it to my virtual machine, Linux is perfectly able to read and mount my FAT partition.

                                                                                                              1 – Why can’t Windows read Linux filesystems?

                                                                                                              2 – What’s the key difference that allows Linux to do it, yet Windows can’t?

                                                                                                              share|improve this question

                                                                                                              closed as too broad by Thomas Dickey, Rui F Ribeiro, Thomas, RalfFriedl, mosvy Jan 26 at 20:59

                                                                                                              Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

                                                                                                                -2

                                                                                                                -2

                                                                                                                -2

                                                                                                                When playing with filesystems and partition, I realized that when I created a ext file system on my USB drive and plug it to Windows, I am forced to format it. On the other end, when building a FAT partition on Windows, and plugging it to my virtual machine, Linux is perfectly able to read and mount my FAT partition.

                                                                                                                1 – Why can’t Windows read Linux filesystems?

                                                                                                                2 – What’s the key difference that allows Linux to do it, yet Windows can’t?

                                                                                                                share|improve this question

                                                                                                                When playing with filesystems and partition, I realized that when I created a ext file system on my USB drive and plug it to Windows, I am forced to format it. On the other end, when building a FAT partition on Windows, and plugging it to my virtual machine, Linux is perfectly able to read and mount my FAT partition.

                                                                                                                1 – Why can’t Windows read Linux filesystems?

                                                                                                                2 – What’s the key difference that allows Linux to do it, yet Windows can’t?

                                                                                                                filesystems partition ext4 fat

                                                                                                                share|improve this question

                                                                                                                share|improve this question

                                                                                                                share|improve this question

                                                                                                                share|improve this question

                                                                                                                asked Jan 26 at 13:09

                                                                                                                TavarichTavarich

                                                                                                                173

                                                                                                                173

                                                                                                                closed as too broad by Thomas Dickey, Rui F Ribeiro, Thomas, RalfFriedl, mosvy Jan 26 at 20:59

                                                                                                                Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

                                                                                                                closed as too broad by Thomas Dickey, Rui F Ribeiro, Thomas, RalfFriedl, mosvy Jan 26 at 20:59

                                                                                                                Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

                                                                                                                    2 Answers
                                                                                                                    2

                                                                                                                    active

                                                                                                                    oldest

                                                                                                                    votes

                                                                                                                    5

                                                                                                                    Windows can’t read “Linux” file systems (such as Ext4 or XFS) by default because it doesn’t ship with drivers for them. You can install software such as Ext2fsd to gain read access to Ext2/3/4 file systems.

                                                                                                                    Linux can access FAT file systems because the kernel has a FAT file system driver, and most distributions enable it by default.

                                                                                                                    There are cases where Linux distributions won’t be able to access a Windows-formatted USB key by default: large keys are typically formatted using ExFAT, and the Linux kernel doesn’t support that. You would have to install a separate ExFAT driver in this situation.

                                                                                                                    There’s nothing inherent in Windows or Linux which limits their ability to support file systems; it’s really down to the availability of drivers. Linux supports Windows file systems because they are very popular; this then provides a common basis for file exchange, meaning that there is less need for Windows to support Linux file systems.

                                                                                                                    share|improve this answer

                                                                                                                      0

                                                                                                                      The above is correct.

                                                                                                                      However,

                                                                                                                      Microsoft is very strongly against opensource software, which directly includes linux. This can be confimed by any actions taken by Microsoft in the past, even the recent overtake of github by Microsoft was agreed by majority in the opensource community that it is an action by Microsoft to control and monitor its competition.

                                                                                                                      It would be easy to make Windows read EXT4 natively, but windows doesn’t want to support such a action and promote a file system made for linux. Even though I dont agree with it, it’s a note worthy business decision that makes sense. I quote the below.

                                                                                                                      Most of the ext file systems are written in code which is available in GNU/GPL. If MS uses them, they will have to release a part or full source code of Windows which links to the file system.

                                                                                                                      share|improve this answer

                                                                                                                      • MS has become much more open source friendly in the recent years

                                                                                                                        – phuclv
                                                                                                                        Jan 26 at 15:44

                                                                                                                      2 Answers
                                                                                                                      2

                                                                                                                      active

                                                                                                                      oldest

                                                                                                                      votes

                                                                                                                      2 Answers
                                                                                                                      2

                                                                                                                      active

                                                                                                                      oldest

                                                                                                                      votes

                                                                                                                      active

                                                                                                                      oldest

                                                                                                                      votes

                                                                                                                      active

                                                                                                                      oldest

                                                                                                                      votes

                                                                                                                      5

                                                                                                                      Windows can’t read “Linux” file systems (such as Ext4 or XFS) by default because it doesn’t ship with drivers for them. You can install software such as Ext2fsd to gain read access to Ext2/3/4 file systems.

                                                                                                                      Linux can access FAT file systems because the kernel has a FAT file system driver, and most distributions enable it by default.

                                                                                                                      There are cases where Linux distributions won’t be able to access a Windows-formatted USB key by default: large keys are typically formatted using ExFAT, and the Linux kernel doesn’t support that. You would have to install a separate ExFAT driver in this situation.

                                                                                                                      There’s nothing inherent in Windows or Linux which limits their ability to support file systems; it’s really down to the availability of drivers. Linux supports Windows file systems because they are very popular; this then provides a common basis for file exchange, meaning that there is less need for Windows to support Linux file systems.

                                                                                                                      share|improve this answer

                                                                                                                        5

                                                                                                                        Windows can’t read “Linux” file systems (such as Ext4 or XFS) by default because it doesn’t ship with drivers for them. You can install software such as Ext2fsd to gain read access to Ext2/3/4 file systems.

                                                                                                                        Linux can access FAT file systems because the kernel has a FAT file system driver, and most distributions enable it by default.

                                                                                                                        There are cases where Linux distributions won’t be able to access a Windows-formatted USB key by default: large keys are typically formatted using ExFAT, and the Linux kernel doesn’t support that. You would have to install a separate ExFAT driver in this situation.

                                                                                                                        There’s nothing inherent in Windows or Linux which limits their ability to support file systems; it’s really down to the availability of drivers. Linux supports Windows file systems because they are very popular; this then provides a common basis for file exchange, meaning that there is less need for Windows to support Linux file systems.

                                                                                                                        share|improve this answer

                                                                                                                          5

                                                                                                                          5

                                                                                                                          5

                                                                                                                          Windows can’t read “Linux” file systems (such as Ext4 or XFS) by default because it doesn’t ship with drivers for them. You can install software such as Ext2fsd to gain read access to Ext2/3/4 file systems.

                                                                                                                          Linux can access FAT file systems because the kernel has a FAT file system driver, and most distributions enable it by default.

                                                                                                                          There are cases where Linux distributions won’t be able to access a Windows-formatted USB key by default: large keys are typically formatted using ExFAT, and the Linux kernel doesn’t support that. You would have to install a separate ExFAT driver in this situation.

                                                                                                                          There’s nothing inherent in Windows or Linux which limits their ability to support file systems; it’s really down to the availability of drivers. Linux supports Windows file systems because they are very popular; this then provides a common basis for file exchange, meaning that there is less need for Windows to support Linux file systems.

                                                                                                                          share|improve this answer

                                                                                                                          Windows can’t read “Linux” file systems (such as Ext4 or XFS) by default because it doesn’t ship with drivers for them. You can install software such as Ext2fsd to gain read access to Ext2/3/4 file systems.

                                                                                                                          Linux can access FAT file systems because the kernel has a FAT file system driver, and most distributions enable it by default.

                                                                                                                          There are cases where Linux distributions won’t be able to access a Windows-formatted USB key by default: large keys are typically formatted using ExFAT, and the Linux kernel doesn’t support that. You would have to install a separate ExFAT driver in this situation.

                                                                                                                          There’s nothing inherent in Windows or Linux which limits their ability to support file systems; it’s really down to the availability of drivers. Linux supports Windows file systems because they are very popular; this then provides a common basis for file exchange, meaning that there is less need for Windows to support Linux file systems.

                                                                                                                          share|improve this answer

                                                                                                                          share|improve this answer

                                                                                                                          share|improve this answer

                                                                                                                          answered Jan 26 at 13:32

                                                                                                                          Stephen KittStephen Kitt

                                                                                                                          172k24386463

                                                                                                                          172k24386463

                                                                                                                              0

                                                                                                                              The above is correct.

                                                                                                                              However,

                                                                                                                              Microsoft is very strongly against opensource software, which directly includes linux. This can be confimed by any actions taken by Microsoft in the past, even the recent overtake of github by Microsoft was agreed by majority in the opensource community that it is an action by Microsoft to control and monitor its competition.

                                                                                                                              It would be easy to make Windows read EXT4 natively, but windows doesn’t want to support such a action and promote a file system made for linux. Even though I dont agree with it, it’s a note worthy business decision that makes sense. I quote the below.

                                                                                                                              Most of the ext file systems are written in code which is available in GNU/GPL. If MS uses them, they will have to release a part or full source code of Windows which links to the file system.

                                                                                                                              share|improve this answer

                                                                                                                              • MS has become much more open source friendly in the recent years

                                                                                                                                – phuclv
                                                                                                                                Jan 26 at 15:44

                                                                                                                              0

                                                                                                                              The above is correct.

                                                                                                                              However,

                                                                                                                              Microsoft is very strongly against opensource software, which directly includes linux. This can be confimed by any actions taken by Microsoft in the past, even the recent overtake of github by Microsoft was agreed by majority in the opensource community that it is an action by Microsoft to control and monitor its competition.

                                                                                                                              It would be easy to make Windows read EXT4 natively, but windows doesn’t want to support such a action and promote a file system made for linux. Even though I dont agree with it, it’s a note worthy business decision that makes sense. I quote the below.

                                                                                                                              Most of the ext file systems are written in code which is available in GNU/GPL. If MS uses them, they will have to release a part or full source code of Windows which links to the file system.

                                                                                                                              share|improve this answer

                                                                                                                              • MS has become much more open source friendly in the recent years

                                                                                                                                – phuclv
                                                                                                                                Jan 26 at 15:44

                                                                                                                              0

                                                                                                                              0

                                                                                                                              0

                                                                                                                              The above is correct.

                                                                                                                              However,

                                                                                                                              Microsoft is very strongly against opensource software, which directly includes linux. This can be confimed by any actions taken by Microsoft in the past, even the recent overtake of github by Microsoft was agreed by majority in the opensource community that it is an action by Microsoft to control and monitor its competition.

                                                                                                                              It would be easy to make Windows read EXT4 natively, but windows doesn’t want to support such a action and promote a file system made for linux. Even though I dont agree with it, it’s a note worthy business decision that makes sense. I quote the below.

                                                                                                                              Most of the ext file systems are written in code which is available in GNU/GPL. If MS uses them, they will have to release a part or full source code of Windows which links to the file system.

                                                                                                                              share|improve this answer

                                                                                                                              The above is correct.

                                                                                                                              However,

                                                                                                                              Microsoft is very strongly against opensource software, which directly includes linux. This can be confimed by any actions taken by Microsoft in the past, even the recent overtake of github by Microsoft was agreed by majority in the opensource community that it is an action by Microsoft to control and monitor its competition.

                                                                                                                              It would be easy to make Windows read EXT4 natively, but windows doesn’t want to support such a action and promote a file system made for linux. Even though I dont agree with it, it’s a note worthy business decision that makes sense. I quote the below.

                                                                                                                              Most of the ext file systems are written in code which is available in GNU/GPL. If MS uses them, they will have to release a part or full source code of Windows which links to the file system.

                                                                                                                              share|improve this answer

                                                                                                                              share|improve this answer

                                                                                                                              share|improve this answer

                                                                                                                              answered Jan 26 at 14:47

                                                                                                                              TrevorKSTrevorKS

                                                                                                                              1669

                                                                                                                              1669

                                                                                                                              • MS has become much more open source friendly in the recent years

                                                                                                                                – phuclv
                                                                                                                                Jan 26 at 15:44

                                                                                                                              • MS has become much more open source friendly in the recent years

                                                                                                                                – phuclv
                                                                                                                                Jan 26 at 15:44

                                                                                                                              MS has become much more open source friendly in the recent years

                                                                                                                              – phuclv
                                                                                                                              Jan 26 at 15:44

                                                                                                                              MS has become much more open source friendly in the recent years

                                                                                                                              – phuclv
                                                                                                                              Jan 26 at 15:44

                                                                                                                              Partitioning an external HD appropriately [duplicate]

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

                                                                                                                              0

                                                                                                                              This question already has an answer here:

                                                                                                                              • Why is Kali Linux so hard to set up? Why won’t people help me?

                                                                                                                                5 answers

                                                                                                                              I plan on booting Kali on an external hard drive. My question is partitioning. If you create the 2 partitions for Swap and Root, do i need to create a 3rd partition for storage. From my understanding, the root will take up the whole partition.

                                                                                                                              share|improve this question

                                                                                                                              marked as duplicate by Rui F Ribeiro, Romeo Ninov, garethTheRed, Emmanuel Rosa, Thomas Jan 26 at 10:03

                                                                                                                              This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

                                                                                                                              • A dedicated partition for swap is not needed. Either provide adequate RAM to awoid swapping entirely, or use a swap file in root.

                                                                                                                                – K7AAY
                                                                                                                                Jan 25 at 23:04

                                                                                                                              0

                                                                                                                              This question already has an answer here:

                                                                                                                              • Why is Kali Linux so hard to set up? Why won’t people help me?

                                                                                                                                5 answers

                                                                                                                              I plan on booting Kali on an external hard drive. My question is partitioning. If you create the 2 partitions for Swap and Root, do i need to create a 3rd partition for storage. From my understanding, the root will take up the whole partition.

                                                                                                                              share|improve this question

                                                                                                                              marked as duplicate by Rui F Ribeiro, Romeo Ninov, garethTheRed, Emmanuel Rosa, Thomas Jan 26 at 10:03

                                                                                                                              This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

                                                                                                                              • A dedicated partition for swap is not needed. Either provide adequate RAM to awoid swapping entirely, or use a swap file in root.

                                                                                                                                – K7AAY
                                                                                                                                Jan 25 at 23:04

                                                                                                                              0

                                                                                                                              0

                                                                                                                              0

                                                                                                                              This question already has an answer here:

                                                                                                                              • Why is Kali Linux so hard to set up? Why won’t people help me?

                                                                                                                                5 answers

                                                                                                                              I plan on booting Kali on an external hard drive. My question is partitioning. If you create the 2 partitions for Swap and Root, do i need to create a 3rd partition for storage. From my understanding, the root will take up the whole partition.

                                                                                                                              share|improve this question

                                                                                                                              This question already has an answer here:

                                                                                                                              • Why is Kali Linux so hard to set up? Why won’t people help me?

                                                                                                                                5 answers

                                                                                                                              I plan on booting Kali on an external hard drive. My question is partitioning. If you create the 2 partitions for Swap and Root, do i need to create a 3rd partition for storage. From my understanding, the root will take up the whole partition.

                                                                                                                              This question already has an answer here:

                                                                                                                              • Why is Kali Linux so hard to set up? Why won’t people help me?

                                                                                                                                5 answers

                                                                                                                              partition disk

                                                                                                                              share|improve this question

                                                                                                                              share|improve this question

                                                                                                                              share|improve this question

                                                                                                                              share|improve this question

                                                                                                                              edited Jan 25 at 20:43

                                                                                                                              Rui F Ribeiro

                                                                                                                              40.1k1479136

                                                                                                                              40.1k1479136

                                                                                                                              asked Jan 25 at 20:38

                                                                                                                              Patrick FleckensteinPatrick Fleckenstein

                                                                                                                              1

                                                                                                                              1

                                                                                                                              marked as duplicate by Rui F Ribeiro, Romeo Ninov, garethTheRed, Emmanuel Rosa, Thomas Jan 26 at 10:03

                                                                                                                              This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

                                                                                                                              marked as duplicate by Rui F Ribeiro, Romeo Ninov, garethTheRed, Emmanuel Rosa, Thomas Jan 26 at 10:03

                                                                                                                              This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

                                                                                                                              • A dedicated partition for swap is not needed. Either provide adequate RAM to awoid swapping entirely, or use a swap file in root.

                                                                                                                                – K7AAY
                                                                                                                                Jan 25 at 23:04

                                                                                                                              • A dedicated partition for swap is not needed. Either provide adequate RAM to awoid swapping entirely, or use a swap file in root.

                                                                                                                                – K7AAY
                                                                                                                                Jan 25 at 23:04

                                                                                                                              A dedicated partition for swap is not needed. Either provide adequate RAM to awoid swapping entirely, or use a swap file in root.

                                                                                                                              – K7AAY
                                                                                                                              Jan 25 at 23:04

                                                                                                                              A dedicated partition for swap is not needed. Either provide adequate RAM to awoid swapping entirely, or use a swap file in root.

                                                                                                                              – K7AAY
                                                                                                                              Jan 25 at 23:04

                                                                                                                              1 Answer
                                                                                                                              1

                                                                                                                              active

                                                                                                                              oldest

                                                                                                                              votes

                                                                                                                              0

                                                                                                                              My habit is to create a swap, a couple of smallish roots, say 10Gb or 20Gb each, and the rest of the disc as a big partition for /home. This way I can install in the first root partition as normal. In time I might want another OS but preserve the data on /home so I simply install the new OS on the second root partition. If something goes wrong with the new install, I revert to the first partition.

                                                                                                                              Having /home as an independent partition is good old fashioned best practice!

                                                                                                                              share|improve this answer

                                                                                                                              • Kali, like other modern Debian derived distros, does not require a swap partition, and does perfectly fine with their a swap file, or just extra RAM in lieu of swapping.

                                                                                                                                – K7AAY
                                                                                                                                Jan 25 at 23:00

                                                                                                                              1 Answer
                                                                                                                              1

                                                                                                                              active

                                                                                                                              oldest

                                                                                                                              votes

                                                                                                                              1 Answer
                                                                                                                              1

                                                                                                                              active

                                                                                                                              oldest

                                                                                                                              votes

                                                                                                                              active

                                                                                                                              oldest

                                                                                                                              votes

                                                                                                                              active

                                                                                                                              oldest

                                                                                                                              votes

                                                                                                                              0

                                                                                                                              My habit is to create a swap, a couple of smallish roots, say 10Gb or 20Gb each, and the rest of the disc as a big partition for /home. This way I can install in the first root partition as normal. In time I might want another OS but preserve the data on /home so I simply install the new OS on the second root partition. If something goes wrong with the new install, I revert to the first partition.

                                                                                                                              Having /home as an independent partition is good old fashioned best practice!

                                                                                                                              share|improve this answer

                                                                                                                              • Kali, like other modern Debian derived distros, does not require a swap partition, and does perfectly fine with their a swap file, or just extra RAM in lieu of swapping.

                                                                                                                                – K7AAY
                                                                                                                                Jan 25 at 23:00

                                                                                                                              0

                                                                                                                              My habit is to create a swap, a couple of smallish roots, say 10Gb or 20Gb each, and the rest of the disc as a big partition for /home. This way I can install in the first root partition as normal. In time I might want another OS but preserve the data on /home so I simply install the new OS on the second root partition. If something goes wrong with the new install, I revert to the first partition.

                                                                                                                              Having /home as an independent partition is good old fashioned best practice!

                                                                                                                              share|improve this answer

                                                                                                                              • Kali, like other modern Debian derived distros, does not require a swap partition, and does perfectly fine with their a swap file, or just extra RAM in lieu of swapping.

                                                                                                                                – K7AAY
                                                                                                                                Jan 25 at 23:00

                                                                                                                              0

                                                                                                                              0

                                                                                                                              0

                                                                                                                              My habit is to create a swap, a couple of smallish roots, say 10Gb or 20Gb each, and the rest of the disc as a big partition for /home. This way I can install in the first root partition as normal. In time I might want another OS but preserve the data on /home so I simply install the new OS on the second root partition. If something goes wrong with the new install, I revert to the first partition.

                                                                                                                              Having /home as an independent partition is good old fashioned best practice!

                                                                                                                              share|improve this answer

                                                                                                                              My habit is to create a swap, a couple of smallish roots, say 10Gb or 20Gb each, and the rest of the disc as a big partition for /home. This way I can install in the first root partition as normal. In time I might want another OS but preserve the data on /home so I simply install the new OS on the second root partition. If something goes wrong with the new install, I revert to the first partition.

                                                                                                                              Having /home as an independent partition is good old fashioned best practice!

                                                                                                                              share|improve this answer

                                                                                                                              share|improve this answer

                                                                                                                              share|improve this answer

                                                                                                                              answered Jan 25 at 22:27

                                                                                                                              wefwef

                                                                                                                              30414

                                                                                                                              30414

                                                                                                                              • Kali, like other modern Debian derived distros, does not require a swap partition, and does perfectly fine with their a swap file, or just extra RAM in lieu of swapping.

                                                                                                                                – K7AAY
                                                                                                                                Jan 25 at 23:00

                                                                                                                              • Kali, like other modern Debian derived distros, does not require a swap partition, and does perfectly fine with their a swap file, or just extra RAM in lieu of swapping.

                                                                                                                                – K7AAY
                                                                                                                                Jan 25 at 23:00

                                                                                                                              Kali, like other modern Debian derived distros, does not require a swap partition, and does perfectly fine with their a swap file, or just extra RAM in lieu of swapping.

                                                                                                                              – K7AAY
                                                                                                                              Jan 25 at 23:00

                                                                                                                              Kali, like other modern Debian derived distros, does not require a swap partition, and does perfectly fine with their a swap file, or just extra RAM in lieu of swapping.

                                                                                                                              – K7AAY
                                                                                                                              Jan 25 at 23:00