3

What I'm trying to do

I'm trying to use GParted on Ubuntu Desktop 14.04 LTS to clone a partition from one device to a newer device (three devices are in play total if you include the one I'm working from). I'm fine using the terminal but haven't gotten the commands correct. The newer device has more space than this one partition I'm going to clone over, and I created an msdos partition table, so all I need to do is create a new partition as ntfs.

The Issue

GParted (the version in the repo: 0.18.0) isn't recognizing the ssd as a block device. not a block device

I attempted sudo mkntfs -Q -v -L -F "win7" /dev/sdb1 which is what uis said plus -F for force, but it spit back Cannot understand the number of sectors '/dev/sdb1'. I'm not very comfortable doing disk partitioning commands in the CLI without expert help, and I wasn't sure forcing it was right anyway.

Info / Research

Other questions

This question talks about all major methods of formatting a drive. That seems like a lead, but after reading through the documentation, the main thing I came upon was that I might be able to use -F to force the writing to the non-block device, but I'm not sure that would go as expected because from what I understand, the new SSD is actually a block device.

disk layout:

  • /dev/sda: This is of little importance for the question except that it's my mainstay SSD drive where I'm doing all this from.
  • /dev/sdb: New SSD; empty with msdos partition table. This is where I want the new ntfs partition spanning the whole drive so that I can later use sudo ntfsclone -f --rescue --overwrite /dev/sdb1 /dev/sdc1 to clone my old ntfs partition to this new one. Of potential note, this is temporarily plugged into the SATA cable that my DVD drive used. I'm pretty sure that just means it's a slower speed but is the same thing, but I could be mistaken. When I'm done, I'm switching SATA ports, but I'm comfortable with that part, with BIOs, and with GRUB refreshing, so I don't anticipate further issues at that point. Also, the other partitions aren't being backed up, so they don't need to be considered.
  • /dev/sdc: This is my older disc-based hard drive. It isn't very fast, and the ntfs partition is pretty full. I need to make a bigger one on a faster drive and then decommission this.

fdisk output:

dan@dan-box:~$ sudo fdisk -l

Disk /dev/sda: 256.1 GB, 256060514304 bytes
255 heads, 63 sectors/track, 31130 cylinders, total 500118192 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: 0x0007d2fd

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048   483571711   241784832   83  Linux
/dev/sda2       483573758   500117503     8271873    5  Extended
/dev/sda5       483573760   500117503     8271872   82  Linux swap / Solaris

Disk /dev/sdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 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: 0x000d9497

   Device Boot      Start         End      Blocks   Id  System

Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 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: 0x000b8aef

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *        2048   184322047    92160000    7  HPFS/NTFS/exFAT
/dev/sdc2       184322048   245762047    30720000   83  Linux
/dev/sdc3       245764094  1953523711   853879809    5  Extended
/dev/sdc5       245764096   261386239     7811072   82  Linux swap / Solaris
/dev/sdc6       261388288  1953523711   846067712   83  Linux

ls -l /dev/sdb?

brw-rw---- 1 root disk 8, 17 Sep 28 07:15 /dev/sdb1

apt-cache policy ntfs-3g

dan@dan-box:~$ sudo apt-cache policy ntfs-3g
[sudo] password for dan: 
ntfs-3g:
  Installed: 1:2013.1.13AR.1-2ubuntu2
  Candidate: 1:2013.1.13AR.1-2ubuntu2
  Version table:
 *** 1:2013.1.13AR.1-2ubuntu2 0
        500 http://us.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status

Solution

The accepted answer below was my solution: I formatted as EXT4. It fixed something the NTFS driver was failing to fix, so when I deleted the EXT4 partition, I was able to format as NTFS.

Bonus Material

On a sad note, I'm on my clone step now and after about 25 minutes, I already have about 50 unreadable sectors. I'll probably boot into Windows on the old drive, make a recovery DVD, boot into the new SSD, run checks and repairs, etc, and THEN the happy fun begins. I'll be writing an open source Python app to resolve filenames from my mess of sad sectors! :)

  • Hmm, file descriptor is alright, major and minor (8,17) are fine...What's the version of ntfs-3g: apt-cache policy ntfs-3g ? Did you try formatting with a different file system, e.g ext4 just for fun? – Nephente Sep 28 '15 at 14:12
2

The error is weird. Of course it is a block device. Maybe just a little hiccup.

It always sounds like a joke, but seriously; Did you try turning it off and on again?

Check the output of ls -l /dev/sdb?. It should begin with a b for block device.

I can tell you though, why the command line invocation fails.

The correct syntax of mkntfs (from the man page) is:

mkntfs [options] device [number-of-sectors]

Compare with your invocation

mkntfs -Q -v -L -F "win7" /dev/sdb1

which gives /dev/sdb1 as number-of-sectors.

The order of parameters matters!

Since I guess win7 ought to be the partition label, you need to turn around -L -F

mkntfs -Q -v -F -L "win7" /dev/sdb1

Although I'm not sure about forcing it, if there's problem with the device file.

By the way: Clonezilla is a very accomplished tool for disk imaging, restoring and cloning. It can do all you want to do automatically for you.

  • Thanks for the help so far. I ran ls and added the result at the bottom of my question. It is indeed a block device. I forgot that 'b' character would show there for block devices. Hmm... I also did a number of cold boots (probably 3) during tries / re-tries. I will wait for additional suggestions before trying the -F after work today since that doesn't seem to be the real problem. – Palu Macil Sep 28 '15 at 13:00
  • Thanks again for everything! Making an EXT4 cleaned up the drive to where the NTFS driver was able to format afterwards. Weird but good... sadly I have a TON of unreadable sectors, so the results could be a little iffy. – Palu Macil Sep 29 '15 at 3:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.