newly created partition disappears on USB hard drive


7 posts
by nicknml » Sat Dec 29, 2012 3:59 pm
Using fdisk I create a partition, and then enter "w" to write the table to disk and exit. Upon examining the disk with fdisk, the partition is gone. If I print the partition table before exiting, I can see the newly created partition.

I also get this message:
Code: Select all
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)


This is the enclosure that I'm using:

http://www.amazon.com/Vantec-NexStar-2-5-Inch-External-Enclosure/dp/B002JQNXZC/ref=sr_1_1?ie=UTF8&qid=1356796732&sr=8-1&keywords=2.5+hard+drive+enclosure
User avatar
Posts: 192
Joined: Thu Mar 15, 2012 8:44 pm
by nicknml » Sat Dec 29, 2012 4:18 pm
I plugged the drive into my CentOS box, and it was able to successfully partition it.
User avatar
Posts: 192
Joined: Thu Mar 15, 2012 8:44 pm
by nicknml » Sat Dec 29, 2012 4:46 pm
New problem: now having problems mounting the partition on reboot. I tried to manually mount it after a reboot (it mounted fine before) and got:

Code: Select all
 must specify the filesystem type


And if I specify the filesystem type I get:

Code: Select all
mount: wrong fs type, bad option, bad superblock on /dev/sda1,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so
User avatar
Posts: 192
Joined: Thu Mar 15, 2012 8:44 pm
by 4thdwarflord » Sat Dec 29, 2012 8:20 pm
if you have another computer you can do this on its probably easiest to do that. the pi is more useful for programming or robotics
Posts: 140
Joined: Mon Dec 03, 2012 4:26 pm
Location: Deep in the mines of Moria
by efflandt » Sat Dec 29, 2012 8:40 pm
If you create a partition on a drive, the operating system may not know that you have done that. Not sure if you just need to do sync or something else (reboot would work). But if you created the partition with fdisk, that only adds the partition to the partition table. You also need to format that partition with a filesystem before you can put any files on it. The choice of filesystem depends whether you want to be able to access that partition from Windows or not. The most common Linux filesystem is ext4. See: man mkfs (type that in terminal and hit Enter)

It would be easiest to use gparted in Linux, or from gparted live CD on a PC. Or if you want an FAT32 or ntfs partition easily accessible by Windows it would be easiest to format that in Windows. Note that FAT32 is limited to just under 4 GB max file size.
Posts: 359
Joined: Mon Dec 03, 2012 2:47 am
Location: Elgin, IL USA
by nicknml » Sat Dec 29, 2012 9:11 pm
efflandt wrote:If you create a partition on a drive, the operating system may not know that you have done that. Not sure if you just need to do sync or something else (reboot would work). But if you created the partition with fdisk, that only adds the partition to the partition table. You also need to format that partition with a filesystem before you can put any files on it. The choice of filesystem depends whether you want to be able to access that partition from Windows or not. The most common Linux filesystem is ext4. See: man mkfs (type that in terminal and hit Enter)

It would be easiest to use gparted in Linux, or from gparted live CD on a PC. Or if you want an FAT32 or ntfs partition easily accessible by Windows it would be easiest to format that in Windows. Note that FAT32 is limited to just under 4 GB max file size.



I did create an ext4 filesystem on that partition. Update: I should have looked into the negative reviews about the hard drive enclosure, apparently everybody else that tried to use the enclosure with Linux had problems.
User avatar
Posts: 192
Joined: Thu Mar 15, 2012 8:44 pm
by pythag » Sat Jan 05, 2013 10:37 am
Can you run lsusb with the drive plugged in? I had this problem with a fairly cheap enclosure using the following chipset:

14cd:6116 Super Top M6116 SATA Bridge

...which was caused by a bug in the Cypress driver (not Pi specific). Full details posted in another thread.
Posts: 5
Joined: Sat Jan 05, 2013 10:25 am