[NSA320-archlinux-second HDD]

Install Arch Linux ARM on other devices.

[NSA320-archlinux-second HDD]

Postby Tonkiplis2 » Sat Mar 30, 2013 12:32 pm

Hello,

Finally, I am able to use my new NSA320 since some weeks! :) However, I am mainly facing 3 different problems:

---------------------------------------------------------------------------------------------

1) I can't see my second HDD.

The output of fdisk -l is :

$this->bbcode_second_pass_code('', '[root@alarm ~]# fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes, 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x019fbf35

Device Boot Start End Blocks Id System
/dev/sda1 63 48194 24066 83 Linux
Partition 1 does not start on physical sector boundary.
/dev/sda2 48195 1953520064 976735935 83 Linux
Partition 2 does not start on physical sector boundary.

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes, 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0xf76c366a

Device Boot Start End Blocks Id System
/dev/sdb1 63 1028159 514048+ 8 AIX
Partition 1 does not start on physical sector boundary.
/dev/sdb2 1028160 1953520064 976245952+ 20 Unknown

Disk /dev/md127: 999.7 GB, 999675789312 bytes, 1952491776 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
')

So I guess, in order to see it, I will have to partition sdb1 and 2 in ext3/4?

---------------------------------------------------------------------------------------------

2) When a shut down the device (poweroff or the power button), I can't get eth0 "link ready". The only way to get ssh to work is to first run to_stock, get the dhcp lease, reboot the system and the run to_linux.

This is however a bit annoying, because it means that I need the TTL/Serial connector to be plugged in all the time... I tried the solution with power_resume.sh script. But it doesn't seem to correct it perfectly for me.

Any idea how to solve this?

---------------------------------------------------------------------------------------------

3) From a design point of view, I would like to trigger the color of the leds as well as to illuminate some more. Currently when I run archlinux, I have only the On/Off led blue and the SYS LED orange.

I would like to get the SYS LED green as well as the two leds for the HDD1 and HDD2.

Any idea?


---------------------------------------------------------------------------------------------

I hope some of you can help me :)

Have a nice easter =)

Tonkiplis
Tonkiplis2
 
Posts: 19
Joined: Wed Jan 09, 2013 7:01 am

Re: [NSA320-archlinux-second HDD]

Postby FourOhFour » Sat Mar 30, 2013 1:20 pm

It looks like /dev/sdb is partitioned. If it already has filesystems created, you should be able to (as root) create mountpoints (for example, mkdir /mnt/sdb1) and then mount (mount /dev/sdb1 /mnt/sdb1). If this doesn't work, or if you don't need the data on the drive, then yes, you'll need to format it. https://wiki.archlinux.org/index.php/File_Systems

The power_resume script works for me if I boot the device by unplugging the power cord and then plugging it back in. Awkward, but eh, it works. Booting with the power button usually fails for me, and rarely a restart fails too.

For the LEDs, here's my script:
$this->bbcode_second_pass_code('', '#!/bin/sh

/bin/echo 255 > /sys/class/leds/nsa320\:green\:sys/brightness
/bin/echo 0 > /sys/class/leds/nsa320\:orange\:sys/brightness
/bin/echo ide-disk > /sys/class/leds/nsa320\:green\:hdd1/trigger ')

Run at startup, that'll change the system light to green and make the hd1 light blink green whenever either disk is accessed.

I start it with this systemd service (put it in /etc/systemd/system/ (and yes, I just tried to tab complete in a forum post... *sigh*))
$this->bbcode_second_pass_code('', '[Unit]
Description=turning system LED green
After=sshd.service

[Service]
User=root
Type=oneshot
ExecStart=/opt/led/bootcomplete.sh

[Install]
WantedBy=multi-user.target')
FourOhFour
 
Posts: 3
Joined: Sun Mar 10, 2013 12:52 pm

Re: [NSA320-archlinux-second HDD]

Postby Tonkiplis2 » Sat Mar 30, 2013 4:25 pm

Hello FourOhFour,

Thanks for your reply :)

Mounting part was easy ;) Although I don't really understand why I can only use 976.7 GB out of 1 TB, is that because of the stock firmware?


The leds:
Your script works for the leds if I run it manually :)

Although I placed a system.service script in the /etc/systemd/system/ (of course chmod 755 system.service) the system does not run it automatically when booting :). Isn't it some symbolic link to be created?

The power up/down with the alimentation still does not work for me. Where did you place your resume_power.sh script? Do you need something similar as for the led, to make sure it is run at startup? :)

Best,

Tonkiplis
Tonkiplis2
 
Posts: 19
Joined: Wed Jan 09, 2013 7:01 am

Re: [NSA320-archlinux-second HDD]

Postby FourOhFour » Sat Mar 30, 2013 8:14 pm

For the systemd service, just run systemctl enable <whatever you named the script>.

For the resume_power script, just run it once as root with the argument 1. So something along the lines of "sudo ./resume_power.sh 1". You shouldn't need to run it again.

As for 976 GB out of 1 TB... some of that is the difference between TB and TiB, some of it is space lost to the partition table and filesystem related things (journal, etc).
FourOhFour
 
Posts: 3
Joined: Sun Mar 10, 2013 12:52 pm

Re: [NSA320-archlinux-second HDD]

Postby Tonkiplis2 » Sat Mar 30, 2013 9:46 pm

works perfectly! thanks a lot! :)
Tonkiplis2
 
Posts: 19
Joined: Wed Jan 09, 2013 7:01 am

Re: [NSA320-archlinux-second HDD]

Postby pepedog » Sun Mar 31, 2013 12:45 am

I tried for days getting that ethernet up, it came up once and even rebooted ok, but then failed and couldn't bring up.
The difference is you have to remove power, count to 5 slowly (I'm sure I heard a click from unit) and powerup again running the script. You know it will start because it powers up without pressing power button.

I went about script differently
$this->bbcode_second_pass_code('', '# cat /usr/lib/systemd/scripts/nsa.sh
#!/bin/bash
# power_resume.sh [0/1]
# 0 to disable, 1 to enable.
# enable/disable resume from power loss.

# export both gpios
/bin/echo 47 > /sys/class/gpio/export
/bin/echo 49 > /sys/class/gpio/export

# 49 out, value 1
/bin/echo "out" > /sys/class/gpio/gpio49/direction
/bin/echo 1 > /sys/class/gpio/gpio49/value
# 47 out, value 1
/bin/echo "out" > /sys/class/gpio/gpio47/direction
/bin/echo 1 > /sys/class/gpio/gpio47/value
# set 49 value 0
/bin/echo 0 > /sys/class/gpio/gpio49/value

/bin/echo 255 > /sys/class/leds/nsa320\:green\:sys/brightness
/bin/echo 0 > /sys/class/leds/nsa320\:orange\:sys/brightness
/bin/echo ide-disk > /sys/class/leds/nsa320\:green\:hdd1/trigger

sleep 5')
And in the interface file in /etc/network.d/ I added this line
$this->bbcode_second_pass_code('', 'PRE_UP="/usr/lib/systemd/scripts/nsa.sh"')
Because I don't have a suitable serial, I did this
$this->bbcode_second_pass_code('', 'ln -sf /usr/lib/systemd/system/poweroff.target /etc/systemd/system/ctrl-alt-del.target')
Then a USB keyboard plugged in, Ctrl-Alt-Del will poweroff instead of reboot, unplug unit for 5 seconds and all is well
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK


Return to [Please read announcement] Community-Supported Devices

Who is online

Users browsing this forum: No registered users and 4 guests