Tiny Core Linux

Tiny Core Base => Raspberry Pi => Topic started by: jgrulich on February 09, 2016, 03:26:29 PM

Title: Strange 2TB HDD behavior
Post by: jgrulich on February 09, 2016, 03:26:29 PM
I've connected my new NAS 2000GB HDD to the piCore 7.0 and found strange behavior.
I've made two partitions on it, one is 500GB and the second is 1,5TB. Both of them are ext4.
The first one works normally when mounted. HDD activity LED flashes only when some action occurs.
But when I mount the second one, there is some continuous system communication with it.
In top it is listed as "usb-storage" and consumes something about 0.5% of CPU usage.
The HDD activity LED flashes continuously and HDD never goes into the sleep mode.
My question is if there is some system limitation about the HDD capacity, or it's caused by something else.
Title: Re: Strange 2TB HDD behavior
Post by: Greg Erskine on February 09, 2016, 03:38:58 PM
hi jgrulich,

I'd be interested in output from "fdisk -ul" and "blkid".

regards
Greg
Title: Re: Strange 2TB HDD behavior
Post by: jgrulich on February 09, 2016, 04:12:02 PM
Hi Greg,

The log is attached.

Regards,
Jan
Title: Re: Strange 2TB HDD behavior
Post by: Juanito on February 10, 2016, 12:21:40 AM
I thought the limit for an mbr formatted hd was 2tb per partition, but it might be worth formatting the hd with gpt to see if that changes things?
Title: Re: Strange 2TB HDD behavior
Post by: jgrulich on February 10, 2016, 07:17:37 AM
I've tried to reduce the size with resize2fs down to 470GB and it works, than I've increased it to 980GB and it doesn't work again.
The limit is somewhere between, but need to recognize the reason.
Title: Re: Strange 2TB HDD behavior
Post by: jgrulich on February 10, 2016, 09:35:22 AM
Seems that it's related to the ext4 filesystem. I've used ntfs and everything works fine.

Béla,
is there full version of the ext4 support in the piCore, or is it some light version with some limitations?
Title: Re: Strange 2TB HDD behavior
Post by: bmarkus on February 10, 2016, 10:25:33 AM
Seems that it's related to the ext4 filesystem. I've used ntfs and everything works fine.

Béla,
is there full version of the ext4 support in the piCore, or is it some light version with some limitations?

There are no limitations, but you can check the kernel .config file.
Title: Re: Strange 2TB HDD behavior
Post by: jgrulich on February 10, 2016, 11:05:06 AM
Than why ext4 is not working? Ntfs is working, but it's read only system.
I need it for NFS use and it's not therefor solution.
Title: Re: Strange 2TB HDD behavior
Post by: patrikg on February 10, 2016, 03:14:36 PM
Have you tried to format with another block size ?
Title: Re: Strange 2TB HDD behavior
Post by: patrikg on February 10, 2016, 03:38:10 PM
Can't edit my previous post so I add my comment to this instead.
Why not post the output of dumpe2fs to see the difference between the working one and the one that fails.

 
dumpe2fs -h /dev/sda1
Title: Re: Strange 2TB HDD behavior
Post by: bmarkus on February 11, 2016, 02:43:27 AM
Did you  check it with fsck?

What is happening when you are formatting it? Is it successful or there are error messages?

Are there messages in dmesg related to the partition?
Title: Re: Strange 2TB HDD behavior
Post by: jgrulich on February 11, 2016, 04:59:24 AM
Can't edit my previous post so I add my comment to this instead.
Why not post the output of dumpe2fs to see the difference between the working one and the one that fails.

 
dumpe2fs -h /dev/sda1

The result is attached, don't see any difference.


Title: Re: Strange 2TB HDD behavior
Post by: jgrulich on February 11, 2016, 05:07:45 AM
Did you  check it with fsck?

What is happening when you are formatting it? Is it successful or there are error messages?

Are there messages in dmesg related to the partition?

There is no error during formatting and the fsck is fine too.

Code: (bash) [Select]
tc@RaspiBox:~$ fsck /dev/sda1
fsck 1.42.11 (09-Jul-2014)
e2fsck 1.42.13 (17-May-2015)
/dev/sda1: clean, 11/100409344 files, 6352347/401624992 blocks

tc@RaspiBox:~$ fsck /dev/sda2
fsck 1.42.11 (09-Jul-2014)
e2fsck 1.42.13 (17-May-2015)
/dev/sda2: clean, 11/21692416 files, 1411271/86753008 blocks

and this is mentioned in the dmesg:

Code: (bash) [Select]
[    3.372727] usb 1-1.3.3: new high-speed USB device number 6 using dwc_otg
[    3.514954] usb 1-1.3.3: New USB device found, idVendor=174c, idProduct=55aa
[    3.514998] usb 1-1.3.3: New USB device strings: Mfr=2, Product=3, SerialNumber=1
[    3.515018] usb 1-1.3.3: Product: AS2115
[    3.515037] usb 1-1.3.3: Manufacturer: ASMedia
[    3.515055] usb 1-1.3.3: SerialNumber: 20140324000806
[    3.522081] usb-storage 1-1.3.3:1.0: USB Mass Storage device detected
[    3.533119] usb-storage 1-1.3.3:1.0: Quirks match for vid 174c pid 55aa: 400000
[    3.533915] scsi host0: usb-storage 1-1.3.3:1.0
[    4.533984] scsi 0:0:0:0: Direct-Access     ASMedia  AS2115           0    PQ: 0 ANSI: 6
[    4.535862] sd 0:0:0:0: [sda] 3907029168 512-byte logical blocks: (2.00 TB/1.81 TiB)
[    4.535905] sd 0:0:0:0: [sda] 4096-byte physical blocks
[    4.537705] sd 0:0:0:0: [sda] Write Protect is off
[    4.537756] sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00
[    4.538672] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    8.478350]  sda: sda1 sda2
[    8.485765] sd 0:0:0:0: [sda] Attached SCSI disk
Title: Re: Strange 2TB HDD behavior
Post by: bmarkus on February 11, 2016, 09:44:48 AM
So partitions looks OK and error free, but mount fails. Which mount are you using? See

Code: [Select]
which mount
command output.

In piCore 7.0 default mount is the utillinux mount

Code: [Select]
/bin/mount
BusyBox applet also available as

Code: [Select]
busybox.suid mount
Try each of them explicitely specifying mount command.

Title: Re: Strange 2TB HDD behavior
Post by: jgrulich on February 11, 2016, 11:34:11 AM
Now it works. I've used interactive
Code: (bash) [Select]
sudo parted
and percentage division of the disc space to have optimal alignment.
Than I've
Code: (bash) [Select]
sudo mkfs.ext4 /dev/sda1
and
Code: (bash) [Select]
sudo rebuildfstab
Than the regular
Code: (bash) [Select]
mount /mnt/sda1
works fine.

The strange LED flashing was there again, but found that in the
Code: (bash) [Select]
top
is some background root service like [ext4...]
Probably some indexing service which took some hours and now it's no more there and LED flashing disappeared.
This service is probably not run for small discs and therefor not visible.

Title: Re: Strange 2TB HDD behavior
Post by: bmarkus on February 11, 2016, 11:42:17 AM
/dev/sda1 ? Wasn't the issue with /dev/sda2?
Title: Re: Strange 2TB HDD behavior
Post by: Rich on February 11, 2016, 12:00:40 PM
Hi jgrulich

 ---- snip ----
Code: (bash) [Select]
sudo mkfs.ext4 /dev/sda1
---- snip ----
The strange LED flashing was there again, but found that in the
Code: (bash) [Select]
top
is some background root service like [ext4...]
Probably some indexing service which took some hours and now it's no more there and LED flashing disappeared.
This service is probably not run for small discs and therefor not visible.

Was the background service  ext4lazyinit  by any chance? See:
https://www.thomas-krenn.com/en/wiki/Ext4_Filesystem#Lazy_Initialization
Title: Re: Strange 2TB HDD behavior
Post by: jgrulich on February 11, 2016, 02:44:57 PM
/dev/sda1 ? Wasn't the issue with /dev/sda2?

Béla,

yes, it was sda2 before. Now I've swapped the partitions (sda2 to sda1) to have the main one as a first when used parted.
No another difference.
Title: Re: Strange 2TB HDD behavior
Post by: jgrulich on February 11, 2016, 02:46:17 PM
Hi jgrulich
Was the background service  ext4lazyinit  by any chance? See:
https://www.thomas-krenn.com/en/wiki/Ext4_Filesystem#Lazy_Initialization

Yes, you're right. That was the running service.
Title: Re: Strange 2TB HDD behavior
Post by: Lee on February 12, 2016, 10:39:52 AM
I'm -still- not a raspberry pi user and I don't have any multi-terabyte storage devices, but I have to ask:

Doesn't "lazy initialization" seem like a bad idea?

From the above referenced article:
Quote
In order to prevent lazy initialization, advanced options are offered by the mkfs.ext4 command:[20]

Code: [Select]
mkfs.ext4 -E lazy_itable_init=0,lazy_journal_init=0 /dev/mapper/fc-root
By specifying these options, the inodes and the journal will be initialized immediately during creation.