Welcome! Log In Create A New Profile

Advanced

Lenovo IX2-ng question

Posted by feldwebel 
feldwebel
Lenovo IX2-ng question
February 05, 2019 07:11AM
Hi there,

I have a Lenovo IX2-ng with stock u-boot (as far as I know it can't be updated anyway) and with linux-4.15.2-kirkwood-tld-1-bodhi.tar.bz2 installed on an old HDD.

My interest is replace the HDD with a SSD. Can it boot debian from a SSD ?



Edited 1 time(s). Last edit at 02/05/2019 07:22AM by bodhi.
Re: Lenovo IX2-ng question
February 05, 2019 07:22AM
Yes, it can.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
feldwebel
Re: Lenovo IX2-ng question
February 10, 2019 02:23PM
Thanks. I have some doubts of how I should proceed to make the SSD future-proof. I plan to use this device as a small cloud storage and media server.

I'm thinking to format the disk using MBR, create an ext2 boot partition, one ext4 for rootfs and one more ext4 for data and leaving at the end about 10% percent unnallocated for provisioning.

Is there any advantage here for using GPT with 100MB free at the start and dd-ing boot image there ?

Or could be even more efficient for me to run the debian from a USB stick ?

I'm not really sure of the best option.
Re: Lenovo IX2-ng question
February 10, 2019 03:34PM
feldwebel,

I would use 2 MBR partitions. 20GB for rootfs, formatted as Ext3. The rest (minus 100MB) for data, formatted as Ext4.

And a swap file of 1GB on the rootfs.

GPT would be unecessary if the disk is small (<= 2TB).

USB rootfs is not as efficient without doing a lot of tweaks. However, I usually run USB rootfs on smaller Kirkwood plugs (so that it can be reused between plugs that don't have SATA and ones that have SATA, such as Dockstar and GoFlex Net).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
feldwebel
Re: Lenovo IX2-ng question
February 10, 2019 03:57PM
Thanks for the advice, sounds good.

But is the u-boot from Lenovo Ix2-ng capable of booting from ext3 partition ?
Re: Lenovo IX2-ng question
February 10, 2019 04:27PM
feldwebel,

> Thanks for the advice, sounds good.
>
> But is the u-boot from Lenovo Ix2-ng capable of
> booting from ext3 partition ?

That should be OK.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Lenovo IX2-ng question
February 10, 2019 07:09PM
It should boot from ext3, it's the partition format that is important (GPT won't work).

You can get around the stock u-boot limitations on these boxes, here's what I did;

IX2-DL howto

Remember to give extra space between the kernel and initrd when loading u-boot, the stock u-boot can be problematic with the sizes of newer kernels.
feldwebel
Re: Lenovo IX2-ng question
February 12, 2019 03:37AM
jdwl101,
I've read the howto, very useful info, helped me to get it working when I used the NAS as a big storage backup. Now I don't need that workaround as MBR is fine for me.

It successfully boot from an ext3 partition, but after some documenting found out that the journaling feature of that file system is harmful for a SSD. I think I'll may go go with 3 partitions after all: ext2 boot, ext4 rootfs and ext4 data..I think I have to document more to get the right decision.

Playing around with the debian ( by the way thanks a lot for the rootfs, kernels an tutorials bodhi) raised a few questions for me. When downloading something on the box the CPU temperature reaches as much as 85 degrees celsius, is this ok ? Seems a bit high. Also, I managed to control the LEDS on the box, but did not manage to configure the button to initiate shutdown. Is it possible on this box ?
Re: Lenovo IX2-ng question
February 12, 2019 01:53PM
feldwebel,

> It successfully boot from an ext3 partition, but
> after some documenting found out that the
> journaling feature of that file system is harmful
> for a SSD. I think I'll may go go with 3
> partitions after all: ext2 boot, ext4 rootfs and
> ext4 data..

There is really no gain in your configuration. The ext4 rootfs is under similar journaling policy. The Ext2 boot only help in avoiding corruption if you set it to Read-Only (Ext2 is prone to be corrupted when you have a power failure). If the Ext4 rootfs is too corrupted, you can't boot the box successful anyway.

FWIW, the 3-partition scheme is a throw back to the old day.

To make absolutely sure the rootfs is not frequently written to, see the Wiki thread:

Quote

Flash drives issues

How to prolong the life of your rootfs USB thumb drive
Overprovisioning A Flash Drive?


>
> Playing around with the debian ( by the way thanks
> a lot for the rootfs, kernels an tutorials bodhi)
> raised a few questions for me. When downloading
> something on the box the CPU temperature reaches
> as much as 85 degrees celsius, is this ok ? Seems
> a bit high. Also, I managed to control the LEDS on
> the box, but did not manage to configure the
> button to initiate shutdown. Is it possible on
> this box ?

Yes. It should be possible. The poweroff is defined in the DTS.

Install a key daemon as instructed in the Wiki thread:
https://forum.doozan.com/read.php?2,23630

Quote

Key daemon (button control)

Multimedia keyboard daemon for Linux

And define the shutdown as the action for Power button.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Lenovo IX2-ng question
February 12, 2019 03:33PM
Your cpu temp is fine, mine get very hot but the Kirkwood doesn’t care.

You could stick a heat sink on, but it’s not needed.

SSD won’t care about the journals either.
feldwebel
Re: Lenovo IX2-ng question
February 13, 2019 04:40AM
Ok, got it. Thanks a lot for the Wiki Thread, there I can find the answers to all my questions. And you're right, the 3 partition scheme is mostly outdated.

It's a little bit complicated sticking a heat sink on the cpu and if those temps are fine, it's really not worth it.

Thanks.
feldwebel
Re: Lenovo IX2-ng question
February 15, 2019 03:18PM
I've reformatted the SSD with 2 partitions: 20GB rootfs and the rest a data partition.

Now the boot hangs on "Starting Linux kernel". What could be the problem ? Below are the bootcmd and bootargs I'm using.

For installing the rootfs I've followed bodhi steps from https://forum.doozan.com/read.php?2,12096 (just like the last time, when it worked..)

bootcmd=ide reset; ext2load ide 1:1 0x800000 /boot/uImage; ext2load ide 1:1 0x1100000 /boot/uInitrd; bootm 0x800000 0x1100000
bootargs=console=ttyS0,115200 root=/dev/sda1 rootdelay=10 mtdparts=orion_nand:0x80000@0(uboot),0x20000@0xa0000(env),0x20000@0xc0000(env2),0x300000@0x100000(uImage),0x400000@0x400000(initrd),0x3f800000@0x800000(boot),1024m@0x0(flash) earlyprintk=serial

Re: Lenovo IX2-ng question
February 15, 2019 04:27PM
feldwebel,

When you have more than 1 partition, the bootargs needs to reflect the changes. Using the partition label will help the kernel to mount the rootfs correctly.

bootargs=console=ttyS0,115200 root=LABEL=rootfs rootdelay=10

Since you have serial console, you can also use a better bootargs, like this:

bootargs=console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 earlyprintk=serial

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
feldwebel
Re: Lenovo IX2-ng question
February 16, 2019 06:37AM
Sadly I've tried specifying the label too and did not work. Also I have the earlyprintk included in my bootargs. Could it be from the mtdparts variable ?
Re: Lenovo IX2-ng question
February 16, 2019 02:15PM
feldwebel Wrote:
-------------------------------------------------------
> Sadly I've tried specifying the label too and did
> not work. Also I have the earlyprintk included in
> my bootargs. Could it be from the mtdparts
> variable ?

Please post entire serial console boot log. It'll show us why.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Lenovo IX2-ng question
February 16, 2019 02:30PM
Hi, you haven’t left enough space for the kernel.
Load the initrd to 2100000 and it should boot.
Re: Lenovo IX2-ng question
February 16, 2019 02:41PM
J's guess is probably right!

However, please post the boot log anyway.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Lenovo IX2-ng question
February 28, 2019 09:08AM
So after some delay I've come back working on this.

jdwl101 was right, that was the problem. Now it boots just fine, there seemed to be no clue of this problem in the logs..

Also I'm relatively new to Linux, especially in embedded environment. Does sysV have any advantage in this case over systemd ? Also if I switch to systemd (using the bootargs as in bodhi's Note2 from rootfs install steps) will affect the services I've already installed and configured ?
Re: Lenovo IX2-ng question
February 28, 2019 04:22PM
feldwebel,

> jdwl101 was right, that was the problem. Now it
> boots just fine, there seemed to be no clue of
> this problem in the logs..

Yes, there is if you look closely.

>
> Also I'm relatively new to Linux, especially in
> embedded environment. Does sysV have any advantage
> in this case over systemd ? Also if I switch to
> systemd (using the bootargs as in bodhi's Note2
> from rootfs install steps) will affect the
> services I've already installed and configured ?

In general, you will experience less breakage with Sysv on these boxes. I don't use systemd on these embedded Linux boxes except for testing (but I do on my Linux Mint laptop).

Theorically, when you transition to systemd, it should run all your services the same way before, but YMMV.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Lenovo IX2-ng question
March 04, 2019 06:47PM
Hi, mine run systemd, generally without issue, except that there can be issues restarting services if /var/run isn't large enough. Not a major problem but can mean more reboots after package upgrades.

If I was starting again I'd stick with sysV init. I went with systemd as I know how to write systemd service files and tend to stuff up sysV init scripts.
Re: Lenovo IX2-ng question
May 02, 2019 12:24PM
Hi guys,

Thanks for the advice. I've had the box functioning for a while now wihtout any problem.

At some point I've updated the kernel to 4.20.6 from 4.12.1 and the sensors now output only:

adt7473-i2c-0-2e
Adapter: mv64xxx_i2c adapter
in1:          +1.10 V  (min =  +0.00 V, max =  +2.99 V)
+3.3V:        +3.32 V  (min =  +2.96 V, max =  +3.61 V)
fan1:         812 RPM  (min =    0 RPM)
fan2:           0 RPM  (min =    0 RPM)
fan3:           0 RPM  (min =    0 RPM)
fan4:           0 RPM  (min =    0 RPM)
temp1:        +36.5°C  (low  = -63.0°C, high = +191.0°C)
                       (crit = +100.0°C, hyst = +96.0°C)
Board Temp:   +34.2°C  (low  = -63.0°C, high = +191.0°C)
                       (crit = +100.0°C, hyst = +96.0°C)
temp3:        +30.8°C  (low  = -63.0°C, high = +191.0°C)
                       (crit = +100.0°C, hyst = +96.0°C)


It seems to miss the CPU temperature which was there with the old kernel. Is it safe to downgrade the kernel ?
Re: Lenovo IX2-ng question
May 03, 2019 01:59PM
Solved it !

If anybody ecounters this issue - CPU integrated sensor not appearing - or any "virtual" sensor not appearing: there is a problem with lm-sensors 3.4.0 in combination with linux kernel >= 4.19 . Upgrading lm-sensors to 3.5.0 solved the problem.
Author:

Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: