problems creating partitions USB external hard disk

If none of the more specific forums is the right place to ask

problems creating partitions USB external hard disk

Postby robbo007 » 2019-11-30 11:52

Hi all,
I'm have some problems create a ext4 file system on my 70gb external usb hard disk. I keep getting I/O error each time I write the new partition to the disk. I've tried the hard disk on my MAC and I can create any other file system and format it no problems. Its only the EXT3 or EXT4 that I can do on the Debian server.

Error writing file system info: Remote I/O error

Regards,
Rob
User avatar
robbo007
 
Posts: 87
Joined: 2009-05-18 11:24
Location: Valencia, Spain

Re: problems creating partitions USB external hard disk

Postby arochester » 2019-11-30 12:17

How are you trying to do this?
arochester
 
Posts: 1577
Joined: 2010-12-07 19:55

Re: problems creating partitions USB external hard disk

Postby robbo007 » 2019-11-30 16:06

I'm using fdisk, first of all I delete the VFAT partition which I created when the disk was connected to my MAC. Then I create a new primary partition. Then I try and write that new partition and that when I get a I/O error.

I think they to mkfs.ext4 /dev/sda1 and It seems to create it but then when I try and mount it I get loads of errors and it says to fsck it. I fsck it and resolve many errors then ir i/o errors out.

Code: Select all
Disk /dev/sda: 74.5 GiB, 80026361856 bytes, 156301488 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
root@sosaria:/# fdisk /dev/sda

Welcome to fdisk (util-linux 2.31.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xffd8c986.

Command (m for help): p
Disk /dev/sda: 74.5 GiB, 80026361856 bytes, 156301488 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: 0xffd8c986

Command (m for help): m

Help:

  DOS (MBR)
   a   toggle a bootable flag
   b   edit nested BSD disklabel
   c   toggle the dos compatibility flag

  Generic
   d   delete a partition
   F   list free unpartitioned space
   l   list known partition types
   n   add a new partition
   p   print the partition table
   t   change a partition type
   v   verify the partition table
   i   print information about a partition

  Misc
   m   print this menu
   u   change display/entry units
   x   extra functionality (experts only)

  Script
   I   load disk layout from sfdisk script file
   O   dump disk layout to sfdisk script file

  Save & Exit
   w   write table to disk and exit
   q   quit without saving changes

  Create a new label
   g   create a new empty GPT partition table
   G   create a new empty SGI (IRIX) partition table
   o   create a new empty DOS partition table
   s   create a new empty Sun partition table


Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-156301487, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-156301487, default 156301487):

Created a new partition 1 of type 'Linux' and of size 74.5 GiB.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
/dev/sda: close device failed: Remote I/O error
User avatar
robbo007
 
Posts: 87
Joined: 2009-05-18 11:24
Location: Valencia, Spain

Re: problems creating partitions USB external hard disk

Postby peter_irich » 2019-11-30 18:08

After creating new partition it is needed run as root partprobe or reboot before mke2fs running.
Last edited by peter_irich on 2019-11-30 19:31, edited 1 time in total.
peter_irich
 
Posts: 1260
Joined: 2009-09-10 20:15
Location: Saint-Petersburg, Russian Federation

Re: problems creating partitions USB external hard disk

Postby robbo007 » 2019-11-30 19:28

ok, I'll test it later on tonight.

As another test I plugged in a 3.5" external usb drive with separate power adaptor and it works fine. This could be due to no enough power for the 2.5" usb drive?
User avatar
robbo007
 
Posts: 87
Joined: 2009-05-18 11:24
Location: Valencia, Spain

Re: problems creating partitions USB external hard disk

Postby peter_irich » 2019-11-30 19:34

It depends also from what usb port you are using. Port embedded in mother board is more powered than external.
peter_irich
 
Posts: 1260
Joined: 2009-09-10 20:15
Location: Saint-Petersburg, Russian Federation

Re: problems creating partitions USB external hard disk

Postby nadebula1984 » 2019-12-01 16:06

It seems that there is no partition table on the disk. ext file systems can't be created on a block device without partition table. Try to use command o to re-create one (or g if you prefer GPT) and subsequently create ext file systems. Or else use Gparted to create ext file systems. It would suggest that you (re-)create a partition table before you can create file systems.

By contrast, FAT file systems (including exFAT) can be created on a block device without partition table. I once prepared two USB disks, both formatted as (ex)FAT. One has partition (table) on it and the other hasn't. It seems that many people cannot tell the difference between them.
nadebula1984
 
Posts: 12
Joined: 2018-06-03 11:46

Re: problems creating partitions USB external hard disk

Postby p.H » 2019-12-01 20:04

nadebula1984 wrote:ext file systems can't be created on a block device without partition table.

Wrong.
p.H
 
Posts: 1185
Joined: 2017-09-17 07:12

Re: problems creating partitions USB external hard disk

Postby robbo007 » 2019-12-02 08:09

His guys. In the end I'm using the 3.5" drive. Worked perfectly. Formatted and created the partition the same way was I way trying in fdisk and works without problems.

Cheers,
User avatar
robbo007
 
Posts: 87
Joined: 2009-05-18 11:24
Location: Valencia, Spain

Re: problems creating partitions USB external hard disk

Postby reinob » 2019-12-02 08:55

robbo007 wrote:His guys. In the end I'm using the 3.5" drive. Worked perfectly. Formatted and created the partition the same way was I way trying in fdisk and works without problems.


Next time you have a similar error have a look at the recent "dmesg" output (run as root). "dmesg -T" will prefix each line with a human-readable timestamp.

This way you can see what problem the kernel has with your disk, which may be more helpful than "remote I/O error".
reinob
 
Posts: 754
Joined: 2014-06-30 11:42


Return to General Questions

Who is online

Users browsing this forum: No registered users and 12 guests

fashionable