4

I am fairly new to ubuntu, so please don bite my head off if I ask a stupid question.

Anyway, I tried formatting one of my hard drives using the gnome disks tool, and that returned an error.

Error creating file system: Command-line `mkntfs -f -F -L "New Volume" "/dev/sdb"' exited with non-zero exit status 1:
stdout: `Cluster size has been automatically set to 4096 bytes.
Creating NTFS volume structures.
'
stderr: `/dev/sdb is entire device, not just one partition.
mkntfs forced anyway.
Error writing to /dev/sdb: Input/output error
Error writing non-resident attribute value.
add_attr_sd failed: Input/output error
Couldn't create root directory: Input/output error
Failed to fsync device /dev/sdb: Input/output error
Warning: Could not close /dev/sdb: Input/output error
' (udisks-error-quark, 0)

I have no idea what this error means, and how I should format my hard drive (IF I am still able to). Does this mean that my hard drive is fried and that I can just throw it out, or can I still save it?

EDIT:

Using sudo fdisk -l returns the following output:

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 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: 0x00084eb8

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      499711      248832   83  Linux
/dev/sda2          501758   312580095   156039169    5  Extended
/dev/sda5          501760   312580095   156039168   8e  Linux LVM

Disk /dev/sdc: 82.0 GB, 81964302336 bytes
255 heads, 63 sectors/track, 9964 cylinders, total 160086528 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: 0xd30c01f2

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1            2048   160083967    80040960    7  HPFS/NTFS/exFAT

Disk /dev/mapper/ubuntu-root: 237.4 GB, 237447938048 bytes
255 heads, 63 sectors/track, 28868 cylinders, total 463765504 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

Disk /dev/mapper/ubuntu-root doesn't contain a valid partition table

Disk /dev/mapper/ubuntu-swap_1: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders, total 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
Disk identifier: 0x00000000

Disk /dev/mapper/ubuntu-swap_1 doesn't contain a valid partition table

But this does not contain the hard drive I am trying to format, as it seems. The other two devices that show up (/dev/sda and /dev/sdc) are the ones I have combined into one logical view. The third one, or I should say the second one (/dev/sdb) never shows up in this list, but only shows up in the gnome disks utility. Formatting it from the command line, as well as formatting it from the utillity returns the same result.

EDIT 2:

Using sudo parted -l returned the following:

    Model: ATA MAXTOR STM316021 (scsi)
Disk /dev/sda: 160GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End    Size   Type      File system  Flags
 1      1049kB  256MB  255MB  primary   ext2         boot
 2      257MB   160GB  160GB  extended
 5      257MB   160GB  160GB  logical                lvm


Error: /dev/sdb: unrecognised disk label                                  

Model: ATA Maxtor 6Y080L0 (scsi)
Disk /dev/sdc: 82.0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  82.0GB  82.0GB  primary


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/ubuntu-root: 237GB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End    Size   File system  Flags
 1      0.00B  237GB  237GB  ext4


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/ubuntu-swap_1: 4295MB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End     Size    File system     Flags
 1      0.00B  4295MB  4295MB  linux-swap(v1)

As shows, my /dev/sdb device is unrecognized (Error: /dev/sdb: unrecognised disk label). This should bring me a bit closer to the solution, if only I knew what to do with this.

EDIT 3:

After some further research, it turns out that my hard drive doesn have a partition table, and I can't create one on the device, because my computer detects it as if it were a zero-length partition.

I'll have to cut my losses and just accept the fact that it's dead. Thanks anyway for being helpful.

2 Answers 2

6

Before you can make a file system you have to create a partition.

  • sudo fdisk /dev/sdX
    Where "X" is the drive letter (like sda or sdb depending on the drive).

  • n => Create new Partition (Then create what you need)

  • t => Specify type (NTFS is 07 I think, but you can take a look at the list with L)

  • w => Write the changes to disk and exit

Now you can make your file system with sudo mkfs.ntfs /dev/sdX1where "x" is the drive letter from above. Add the configuration paramaters you need.

15
  • 1
    Assuming that I would need to use fdisk /dev/sdb instead of fdisk /dev/sdbX (because that returned fdisk: unable to open /dev/sdbX), I received another error: fdisk: unable to read /dev/sdb: Input/output error. Mar 28, 2013 at 9:23
  • 1
    Also a noob, but from the reading I've been doing about some boot issues I've had this information may help: Ubuntu names its drives with letters, i.e. /dev/sda is one /dev/sdb is another. It also numbers the partitions on the drives, i.e. /dev/sda1 and /dev/sda2 means that drive 'a' has a partition labeled as 1 (sda1) and another partition labeled as 2 (sda2). fdisk /dev/sdb1 or fdisk /dev/sdb2 and so on.
    – Arammil
    Mar 28, 2013 at 9:35
  • Sorry, I edited the post. In your case use sudo fdisk /dev/sdb. After this process you will have a partition /dev/sdb1. sdb is the device an 1 is the partition as Arammil said. Mar 28, 2013 at 9:43
  • 1
    using sudo fdisk /dev/sdb gives me fdisk: unable to read /dev/sdb: Input/output error. I keep bumping into that error with everything I try. Mar 28, 2013 at 9:45
  • 1
    Thanks for your help. I'll go on researching for a bit, but if it turns out to be a waste of time, I'll yank it out of my computer and feed it to the toilet. Mar 28, 2013 at 10:28
1

I was having trouble with a bootable usb drive that I had installed YUMI on. It would only mount as read-only. I decided to trash all the data on the usb drive and start over. If you have data that you want to keep from your usb drive, BACK IT UP first.

First I tried using the Ubuntu "Disks" gui utility that is available with Ubuntu 12.10. I was getting the same error when trying to format the usb drive, "udisks-error-quark, 0". Turns out the usb drive needs to be repartitioned, not just reformatted. I was able to successfully resolve the issue (using gui only) by doing the following:

Install gparted from the Ubuntu Software Center & run. gparted first showed me the partitions on my hard drive, /dev/sda. To show my usb drive, in the menu, I went to

Gparted -> devices -> /dev/sdc (could be /dev/sdb or another depending on how many devices you have plugged in, if you have multiple hard drives, or other usb drives or an iphone mounted the last letter will be different. You need to be sure that you know what the device name is of the usb drive that you want to partition or you'll erase something unintentionally)

when I did that, it showed my usb drive's partition, in my case being 3.73 GB and having only 1 partition, versus my hard drive being device /dev/sda with 74.53 GB and having 3 partitions labelled "ext4", "extended", and "linux-swap".

After I had my usb drive selected, I right-clicked in the partition area of Gparted and selected "delete" and the partition area turned grey and was marked "unallocated". I right-clicked again in the grey area and selected "New". I allowed the default maximum size and changed the default filesystem type from "ext2" to "fat32" and I entered a label name for the new partition on my usb drive.

(You could also use an ntfs filesystem. To decide which filesystem to use on your usb drive, google ntfs fat32 usb drive. Read some forum posts that come up in the results. There are advantages and disadvantes to each, whether it is playing nice with windows or a mac, or loading large media files.)

Then I verified one more time that I had my usb drive selected to perform the partition operation and not my hard drive or some other device! The device selector on the top right hand side of the gparted window showed /dev/sdc. Yours may be different.

Then I clicked the green check mark at the top of the gparted window that will "Apply All Operations"

If everything goes well, you'll get a popup saying that all operations were performed successfully. If you get a message about the device being used by another program, then "eject" the drive by right clicking on it's icon in the unity task bar and selecting "eject". Then remove and reinsert the usb drive. On gparted menu go to Gparted -> Refresh Devices and you should be able to select the usb drive again. You may have to tell it that you want to create a new partition again with the options you inputted before. Then try clicking the green check mark button again to partition.

Once it has been partitioned, try using your file manager to copy a file to it and see if it works. Should be fine! No need to use the Disk tool to format.

1
  • This is a very long answer. What commands specifically did you execute? Nov 21, 2016 at 1:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .