1

I have been attempting to convert my drives filesystem over to EXT4, purely because it will always be plugged into the Raspberry Pi thus it is just much better to go through ext4.

I am having a problem, however - regardless of what I do, blkid always reports the drive as a "ntfs" drive, which is not what I want.

I have been through fdisk, deleted the only partition on the drive, created a new linux partition (which works), wrote the changes to disk and reboot - however, upon reboot and mount the drive is constantly working (i.e the disk is spinning and head is moving) regardless of the fact that nothing is actually happening

There is obviously something wrong here, the drive has an LED that indicates the drive is busy and that is constantly flickering now I have tried to set up an ext4 filesystem, once I format back to ntfs or fat, it is fine.

Any help would be appreciated!

edit:

Should probably state I have a Raspberry Pi Model B and a Samsung M3 portable HDD. HDD is plugged into a powered USB Hub.

edit2:

The process I have been taking:

  • Start by checking blkid, make sure the device has been recognized and check the filesystem (at this point, it has always been ntfs)
  • Type sudo fdisk /dev/sda, delete any existing partitions
  • Create a brand new, primary partition, onto the HDD. Make it span the full drive.
  • Write the changes to the harddrive, reboot the Pi
  • Next, I run sudo mkfs.ext4 /dev/sda1 to format the new partition with ext4
  • Once again, I reboot.
  • Finally, I mount the partition using sudo mount /dev/sda1 /media/usbhdd

And this where I am now, the External Harddrive is constantly working (identified by the LED blinking, and the drive itself vibrating)

After all of this, here are the results:

/proc/partitions

major minor  #blocks  name

179        0    7565312 mmcblk0
179        1      57344 mmcblk0p1
179        2    7503872 mmcblk0p2
  8        0  976762584 sda
  8        1  976761560 sda1

sudo fdisk /dev/sda partition print

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
81 heads, 63 sectors/track, 382818 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: 0x2acf4408

Device Boot      Start         End      Blocks   Id  System
/dev/sda1         2048  1953525167   976761560   83  Linux

It might also be worth noting that, at this point, blkid does not display the drive at all.

  • I'm not seeing where in your list of steps you formatted the new partition as some variation of ext. You might want to try the drive on a desktop linux, even if it's a live CD/USB boot. – Chris Stratton Feb 23 '15 at 21:22
  • @ChrisStratton, Popped the Harddrive in, checked blkid - found it was ntfs. Typed in fdisk, selected the correct drive, deleted the partition on the drive, added a new Linux partition, wrote the changes. Then, I ran "mkfs -t ext4" followed by the location of the disk, to format into ext4. Finally, I mounted the drive and this is where I am at. blkid reports ntfs, upon reboot, it still reports ntfs – Jake Ball Feb 23 '15 at 21:48
  • If you really, really, really want to start from scratch you can unmount it and dd a couple of megabytes of /dev/zero over the start of the major block device, wiping out the partition table and everything - but be really careful you are doing that to the correct target device! You should be able to verify that you have done it with hexdump, and still see your zeros after a connection cycle. – Chris Stratton Feb 23 '15 at 21:56
  • @ChrisStratton Started doing that for the whole device about an hour ago (without realizing) and it is still going. Not sure how long it is going to take, I'll keep you informed. – Jake Ball Feb 23 '15 at 22:05
  • 1
    You don't need to wipe the whole thing, just the partition table. I'd expect a pi to take a long time to wipe a modern hard drive, especially if you didn't set a large blocksize. – Chris Stratton Feb 23 '15 at 22:07
1

This is getting out of hand in comments. sudo fdisk -l /dev/sdb should show something like:-

sudo fdisk -l /dev/sdb

Disk /dev/sdb: 60.0 GB, 60011642880 bytes
255 heads, 63 sectors/track, 7296 cylinders, total 117210240 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: 0xd84ce8f8

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048     2099199     1048576    b  W95 FAT32
/dev/sdb2         2099200    44044287    20972544    5  Extended
/dev/sdb5         2101248    44044287    20971520   83  Linux

Your comment "sudo fdisk /dev/sda to add a primary partition onto /dev/sda1" does not make sense. /dev/sda1 is a primary partition.

Run sudo mkfs.ext4 /dev/sda1

  • What I have tried to say is, when I added the primary partition, which is /dev/sda1, it was added AFTER I used the command sudo fdisk /dev/sda. I tried to edit my comment to make that more clear however unfortunately I was over the 5 minute time. I have run the command, sudo mkfs.ext4 /dev/sda, it asks if I am sure I want to format the whole device, I type yes - it finishes its business and I reboot the Pi, blkid does not report the drive. dmesg states "unknown partition table". – Jake Ball Feb 23 '15 at 23:58
  • 1
    If you format the entire drive as a filesystem, then no, you won't have a partition table. Normally, you would format your partition /dev/sda1 (or whatever it is), not the entire device. If you have formatted the whole thing, consider starting over with fdisk to make a new partition table and partition, reboot (unusual, but just to be sure, given your difficulties), then make a filesystem in the first partition, not the entire device. – Chris Stratton Feb 24 '15 at 0:11
  • Hi guys, I left this overnight and had another bash just now. sudo blkid now returns the drive, and also reports ext4 as the filesystem (hooray!). I now have the problem where the Harddrive is constantly flickering and in use after mounting (with sudo mount /dev/sda1 /media/usbhdd as I was just testing before editing fstab), which I can tell both by the LED and the drive itself vibrating. Is there any reason for this? It feels to me as if this will drastically degrade the lifetime of my drive, so I would like to fix it. – Jake Ball Feb 24 '15 at 20:28
  • This should be another question Depends on the mount settings The best was is to modify /etc/fstab and make sure noatime is used. proc /proc proc defaults 0 0 UUID=xxxxx-yyyy /mnt/PiData ext4 defaults,noatime,noauto 0 0 NOTE It is more usual to mount in /mnt rather than /media (either will work) – Milliways Feb 24 '15 at 23:03
  • You only need to use noatime on SSDs; HDD with spinning-disk-platters can take a write operation to a file's metadata each time that file on the disk is written AND READ, though there is a tiny bit of extra time / cpu cycles needed to do. – SlySven Dec 22 '15 at 2:58

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.