harmenzon
Posts: 10
Joined: Wed Nov 07, 2012 9:39 am

Setup external HD with ext4

Wed Nov 07, 2012 9:50 am

Hi All,

Apologies for this basic question, but i could not find the answer on the net.

I had successfully setup a sabnzbd, sickbeard and couchpotato server with an external usb pen-drive.
The pen-drive was formatted as VFAT.
But now I am trying to replace the small pen-drive with an 1TB external hard drive. Because I intend to download large movies, I formatted the drive as ext4.

The problem now is that I can not get to mount the external hard drive.

The old command for the pen-drive was:
sudo mount -t vfat -o uid=pi,gid=pi /dev/sda1 /var/multimedia/

Now I try:
sudo mount -t ext4 -o uid=pi,gid=pi /dev/sda5 /var/multimedia/

Resullting in the following error:
mount: wrong fs type, bad option, bad superblock on /dev/sda5,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

Any ideas?
Or even any link to get knowledge on how to setup an ext4 formated external hard drive on a raspberry pi?
Thanks!

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26716
Joined: Sat Jul 30, 2011 7:41 pm

Re: Setup external HD with ext4

Wed Nov 07, 2012 9:53 am

First, are you sure sda5 is the external HD?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

harmenzon
Posts: 10
Joined: Wed Nov 07, 2012 9:39 am

Re: Setup external HD with ext4

Wed Nov 07, 2012 9:56 am

blkid
/dev/mmcblk0p1: SEC_TYPE="msdos" UUID="9DCF-4197" TYPE="vfat"
/dev/mmcblk0p2: UUID="f10ba0bd-17e0-4800-b0af-19bb2ed45acd" TYPE="ext4"
/dev/sda5: UUID="f85f92e9-bcbc-cd01-905f-92e9bcbccd01" TYPE="ext4"

I rather change this to sda1 though, but don't know how to do this either...

User avatar
RaTTuS
Posts: 10563
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Setup external HD with ext4

Wed Nov 07, 2012 9:58 am

sudo fdisk -l
how is the HD powered
has it been formatted
then you should be able to
mount /dev/sda1 /var/multimedia
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

harmenzon
Posts: 10
Joined: Wed Nov 07, 2012 9:39 am

Re: Setup external HD with ext4

Wed Nov 07, 2012 10:10 am

how is the HD powered - it is powered with an external power adapter.
has it been formatted - using MiniTool Partition Wizard (Windows 7)

maybe it is better to reformat using commands?
Can anyone give me the format instruction for ext4 using command line?
Thanks.

harmenzon
Posts: 10
Joined: Wed Nov 07, 2012 9:39 am

Re: Setup external HD with ext4

Wed Nov 07, 2012 10:12 am

Disk /dev/mmcblk0: 3965 MB, 3965190144 bytes
4 heads, 16 sectors/track, 121008 cylinders, total 7744512 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: 0x000dbfc6

Device Boot Start End Blocks Id System
/dev/mmcblk0p1 8192 122879 57344 c W95 FAT32 (LBA)
/dev/mmcblk0p2 122880 7744511 3810816 83 Linux

Disk /dev/sda: 808.9 GB, 808888614912 bytes
255 heads, 63 sectors/track, 98341 cylinders, total 1579860576 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: 0x44349f34

Device Boot Start End Blocks Id System
/dev/sda1 1985 1579847679 789922847+ f W95 Ext'd (LBA)
/dev/sda5 2048 1579847679 789922816 83 Linux

User avatar
RaTTuS
Posts: 10563
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Setup external HD with ext4

Wed Nov 07, 2012 10:26 am

sudo fdisk -l
this will show you all the partitions and drives
sudo mkfs.ext4 /dev/partitionname will make the partition as ext4
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

harmenzon
Posts: 10
Joined: Wed Nov 07, 2012 9:39 am

Re: Setup external HD with ext4

Wed Nov 07, 2012 10:31 am

should sda1 and sda5 not be merged together first?

harmenzon
Posts: 10
Joined: Wed Nov 07, 2012 9:39 am

Re: Setup external HD with ext4

Wed Nov 07, 2012 10:34 am

Disk /dev/mmcblk0: 3965 MB, 3965190144 bytes
4 heads, 16 sectors/track, 121008 cylinders, total 7744512 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: 0x000dbfc6

Device Boot Start End Blocks Id System
/dev/mmcblk0p1 8192 122879 57344 c W95 FAT32 (LBA)
/dev/mmcblk0p2 122880 7744511 3810816 83 Linux

Disk /dev/sda: 808.9 GB, 808888614912 bytes
255 heads, 63 sectors/track, 98341 cylinders, total 1579860576 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

sudo mkfs.ext4 /dev/sda1
mke2fs 1.42.5 (29-Jul-2012)
mkfs.ext4: inode_size (128) * inodes_count (0) too big for a
filesystem with 0 blocks, specify higher inode_ratio (-i)
or lower inode count (-N).

thanks for your help!

User avatar
RaTTuS
Posts: 10563
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Setup external HD with ext4

Wed Nov 07, 2012 10:44 am

you need to make partitions
sudo fdisk /dev/sda
then [from memory]
n [for new]
p [primary]
1 [1st partion]
enter [start]
enter [end]
w [write and exit]
then
mkfs.ext4 /dev/sda1
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

harmenzon
Posts: 10
Joined: Wed Nov 07, 2012 9:39 am

Re: Setup external HD with ext4

Wed Nov 07, 2012 10:56 am

Thanks a lot! That worked!

Mount works with:
mount /dev/sda1 /var/multimedia

But not with:
sudo mount -o uid=pi,gid=pi /dev/sda1 /var/multimedia/

Hopefully the -o uid=pi,gid=pi part is not that important......

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: Setup external HD with ext4

Wed Nov 07, 2012 11:47 am

mount usually supplies sensible defaults. I always use plain old

mount <what> <where>

and it generally works.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

Return to “Troubleshooting”