NSA325 - Removed every package, cannot reach device

This forum is for topics dealing with problems with software specifically in the ARMv5 repo.

NSA325 - Removed every package, cannot reach device

Postby enisz » Fri Jun 08, 2018 4:18 pm

Hi Everyone,

First of all, I'm pretty new in Linux. I've used it before, i know a few things but I'm far from an advanced user.

I just installed Arch Linux ARM on my NSA325 NAS. I've tried to clone the system's disk to the other one, but to reduce the size of the files I ran some scripts with pacman which removed every package from the system. (at least that's what I'm thinking). My intension was to remove only the packages installed by me and leave the stock ones.

At the moment the device can boot. It is answering when I'm pinging it from my laptop, but I cannot log in with SSH or Telnet. That's why I'm thinking that the pacman remove command cleared everything.

At this point I don't know what can I do. I tried to create the bootable usb drive again to start the installation process from scratch but it is not booting from the usd drive. The USB led blinks a few times and that's it. Seemingly nothing happens. I tried it with different HDD's but it's the same. Maybe something is changed in lower level of the OS?

The data on the HDD is not important.

Any help would be appriciated!

Thanks!

[edit] One interesting thing: at boot the device seems to reboot rigth after the start before any other led's lighting up except the power led.
enisz
 
Posts: 4
Joined: Fri Jun 08, 2018 3:59 pm

Re: NSA325 - Removed every package, cannot reach device

Postby summers » Fri Jun 08, 2018 6:58 pm

I guess easiest would be reinstall on a HDD, If you have a spare HDD, then install on that. If you unzip: http://de4.mirror.archlinuxarm.org/os/nsa3x0/nsa325-alarm.tar.gz you find the commands to install on a HDD. If you install on a second HDD, then you can use the second slot on the NSA325 to copy stuff from the first to the second HDD.
summers
 
Posts: 333
Joined: Sat Sep 06, 2014 12:56 pm

Re: NSA325 - Removed every package, cannot reach device

Postby enisz » Sat Jun 09, 2018 4:07 pm

Thanks for the reply!

I've created the install usb drive and formatted the HDD, but when I start the NAS none of the leds are blinking.

The usb drive has been formatted as the following (sorry for the foreign labels, but the settings are visible)
Image

Then I've copied the following files to the drive:
Image

To format the HDD I've used the EaseUS Partition program. Removed every partition (only unallcoated space visible).

After booting the NAS the HDD led's are not blinking.

Did I miss somehting? Should it work this way? Or should I do anything else?

Thanks!
enisz
 
Posts: 4
Joined: Fri Jun 08, 2018 3:59 pm

Re: NSA325 - Removed every package, cannot reach device

Postby summers » Sat Jun 09, 2018 6:46 pm

Look in the file:
Code: Select all
usb_key_func.sh.2

it contains:
Code: Select all
fdisk /dev/sda <<EOF
o
n
p
1

+16M

n
p
2


p
w

EOF
echo " * pause for ioctl to re-sync partitions"
sleep 5
###
#  make filesystems
echo "- make filesystems"
#  ext2 makes u-boot happy.
mkfs.ext2 -L "boot" /dev/sda1
#  stock does not know how to make ext4!
mkfs.ext4 -L "rootfs" /dev/sda2

###
#  make dirs & mount
echo "- mount destination"
mkdir -p /tmp/boot
mount -t ext2 /dev/sda1 /tmp/boot
mkdir -p /tmp/rootfs
mount -t ext4 /dev/sda2 /tmp/rootfs

###
#  prepare the system
#  extract the rootfs
echo "- extract rootfs"
tar xzf /mnt/parnerkey/rootfs.tgz -C /tmp/rootfs/

#  copy the uImage to the boot partition
echo "- prepare boot partition"
cp -aR /tmp/rootfs/boot/* /tmp/boot/

#  always make sure you're sync'd!
sync

Or at least used to - I haven't checked the latest version.

These are the commands used to create the HDD, so if you run these (carefully) on another machine - then you can create the boot disk. Be careful on another machine your disk that you want to install in won't be /dev/sda - so you'll need to work with whatever you disk comes up as. (note on another machine /dev/sda will probably be your main disk - and you don't want to be reformatting that ...)
summers
 
Posts: 333
Joined: Sat Sep 06, 2014 12:56 pm

Re: NSA325 - Removed every package, cannot reach device

Postby enisz » Sat Jun 09, 2018 8:27 pm

So if I get it right, formatting the HDD on a different machine with this command, then the NAS will recognize it and will be able to recognize the disk and boot from usb key to start the installation?
enisz
 
Posts: 4
Joined: Fri Jun 08, 2018 3:59 pm

Re: NSA325 - Removed every package, cannot reach device

Postby summers » Sun Jun 10, 2018 11:14 am

Its more than that! This is in install procedure, so when you carry it out on another machine, you will create an arm arch HDD. Plugged into the NSA325 and power on, and it should boot straight into arm arch.

You probably won't need most of the steps in the script, as you have already had a working arch on the system. So the partition table should be fine (e.g. in fdisk do a "p" first - and you'll probably see the 16MB sda1 and the rest of the HDD as sda2). You'll probably be able to mount these partitions as ext2 and ext4, so you won't need to create the partitions. This is good, it means that you'll still have all your installed stuff on the machine.

So there is is a good chance that all you'll need to do is the
Code: Select all
tar xzf /mnt/parnerkey/rootfs.tgz -C /tmp/rootfs/

To recreate the original file structure, it should overlay whats already in there. You'll need to check that /boot is ok, or copy across the install files.

Then unmount and sync, and hopefully you'll have a HDD which will boot ...
summers
 
Posts: 333
Joined: Sat Sep 06, 2014 12:56 pm

Re: NSA325 - Removed every package, cannot reach device

Postby enisz » Sun Jun 10, 2018 10:03 pm

I've managed to make it work! I've used a different, empty HDD so basically I have a brand new installation but it works. Repartitioned the HDD and copied every file to it's place.

Thank you very much!
enisz
 
Posts: 4
Joined: Fri Jun 08, 2018 3:59 pm

Re: NSA325 - Removed every package, cannot reach device

Postby Orko08 » Mon Jun 11, 2018 9:53 am

I totally agree with @Summer the easiest way were reinstall on a HDD. Here is an detailed article on phen375 customer reviews Well, as you have managed to make it work then nothing to post to help you. Congrats!
Last edited by Orko08 on Tue Jun 19, 2018 9:55 am, edited 1 time in total.
Orko08
 
Posts: 2
Joined: Mon Jun 11, 2018 9:29 am

Re: NSA325 - Removed every package, cannot reach device

Postby summers » Mon Jun 11, 2018 12:21 pm

Good that you have got it to work again.

Solution is common to many of these (embedded) arm boards, the boot set up (often uboot) expects to find a certain file structure on the HDD. if you set up a HDD in the correct way, it will boot. Usually the hard bit, is what to do when the board doesn't boot - trying to debug the bit that went wrong.

Anyway arm arch is good, in gives you a root file system for most set ups. This makes life easy.
summers
 
Posts: 333
Joined: Sat Sep 06, 2014 12:56 pm

Re: NSA325 - Removed every package, cannot reach device

Postby WarheadsSE » Tue Jun 12, 2018 2:27 pm

Yay! Thanks for helping everyone. I was at a conference, so I was unable to assist when this was occurring :ugeek:
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6781
Joined: Mon Oct 18, 2010 2:12 pm


Return to ARMv5

Who is online

Users browsing this forum: No registered users and 1 guest