Reinstall archlinux on pogoplug pro

This forum is for all other ARMv5 devices

Re: Reinstall archlinux on pogoplug pro

Postby fnu » Sun Sep 04, 2011 11:52 am

@doctorjb

Pimping plug computers is over all nothing for Linux noob's. So, if you want or not you need to leave pretty fast this status ....

IMHO you haven't done anything wrong, as you can logon using SSH. Don't worry regarding the endless blinking front LED and follow my above mentioned hint to copy stuff from NAND.

Logon per SSH and do as root, but only this time!

$this->bbcode_second_pass_code('', '#\> mkdir /tmp/ce
#\> mount -t ubifs ubi0:rootfs /tmp/ce
#\> cp -ar /tmp/ce/cloudengines /usr/local/
#\> cp /tmp/ce/usr/sbin/nandwrite /usr/local/cloudengines/bin/
#\> cp /tmp/ce/usr/sbin/flash_erase /usr/local/cloudengines/bin/')

I guess after these steps you could use the revert script, but why ... ;)

And do all the steps from here

http://archlinuxarm.org/support/guides/system/first-steps

including the password hash hardening from Arch Wiki:

https://wiki.archlinux.org/index.php/SHA_password_hashes

Regards
fnu
Last edited by fnu on Mon Oct 10, 2011 7:07 am, edited 4 times in total.
[*] Pogoplug Pro, Hitachi Travelstar 7K320 160GB 2,5" S-ATA, archlinux | ARM
fnu
 
Posts: 12
Joined: Fri Sep 02, 2011 12:06 pm

Re: Reinstall archlinux on pogoplug pro

Postby doctorjb » Sun Sep 04, 2011 11:56 am

Many thanks fnu!

I'm back to a factory fresh Pogoplug and am happily reinstalling Archlinux. I'll try not to blow away udev this time. I had actually got Samba instaleld and working and was feeling pretty pleased with myself :)
doctorjb
 
Posts: 7
Joined: Sun Sep 04, 2011 11:35 am

Re: Reinstall archlinux on pogoplug pro

Postby fnu » Sun Sep 04, 2011 12:11 pm

@doctorjb

In case you have the problem syslog-ng does does allocate 50% of systems cpu power due to faulty udev, you should urgently have look into this thread, starting from this post: http://archlinuxarm.org/forum/viewtopic.php?p=7186#p7186

Regards
fnu
[*] Pogoplug Pro, Hitachi Travelstar 7K320 160GB 2,5" S-ATA, archlinux | ARM
fnu
 
Posts: 12
Joined: Fri Sep 02, 2011 12:06 pm

Re: Reinstall archlinux on pogoplug pro

Postby danes » Tue Sep 06, 2011 12:56 am

Hello, I tried lots of things but I had no success on getting my pogoplug alive :cry:

Could you please explain what needs to be done after formating and extracting the files in the usb while reinstalling archlinux?

Can the file that needs to be created to specify the mac address be any text file called "mac_addr"? or is mac_addr a folder?

Also, what do you mean by getting the files from NAND?

I cant ssh my pogoplug so right now is just another brick in the wall :(


My pogo plug is blinking as crazy and I do not know what else to do. Please give more details for noobs like me.



Thanks
danes
 
Posts: 1
Joined: Tue Sep 06, 2011 12:49 am

Re: Reinstall archlinux on pogoplug pro

Postby mysteri » Tue Sep 06, 2011 7:15 am

right this is all off the top of my head, not actually near my pogo so this may not be 100% but should be very close. Will double check when I can

Make sure you are logged in root

OK take your storage media, put it in to another linux machine:

Start fdisk to partition the USB or SATA drive:
/sbin/fdisk /dev/sdb
#note the that it may not be "sdb" on your system it maybe sdc or sdd etc change as appropriate throught these docs. Once in fdisk i should be obvious if you have the correct device.

At the fdisk prompt, delete old partitions and create a new one:
Type o. This will clear out any partitions on the drive.
Type p to list partitions. There should be no partitions left.
Now type n, then p for primary, 1 for the first partition on the drive, and then press ENTER, accepting default values.
Exit by typing w.

at the prompt run
sync

Now your machine should already have mke2fs on it so simply run

mke2fs -j /dev/sdb1
# if your system doesnt have mk2js follow these hashed out steps
#cd /tmp
#wget http://archlinuxarm.org/os/pogoplug/mke2fs
#chmod 755 mke2fs
#./mke2fs -j /dev/sdb1

mkdir /tmp/usb
mount /dev/sdb1 /tmp/usb


Now we are going to download the latest image and extract it to the usb

cd /tmp
wget http://archlinuxarm.org/os/ArchLinuxARM ... est.tar.gz
cd /tmp/usb
tar -xvzf /tmp/ArchLinuxARM-oxnas-latest.tar.gz

#the extract will take a few minutes

Now create a new file and add the mac address

touch /usr/local/mac_addr
echo "XX:XX:XX:XX:XX:XX" > /usr/local/mac_addr

#replace x's with your mac address, should be on bottom of your pogo


I normally edit /etc/rc.conf and /etc/hosts files too, however that is up to you. I generally set the localisation, hostname and static ip so the device is easy to find. For basic networking the feilds i edit in /etc/rc.conf are:
HOSTNAME="alarm" #change to your choosen hostname
#eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255" # remove the # at the start and set ip's as requred
eth0="dhcp" # add a # to the start of this line
INTERFACES=(eth0) # leave this line
gateway="default gw 192.168.0.1" # change ip as needed
ROUTES=(!gateway) # remove the "!"
In /etc/hosts i just add a new entry for the hostname and IP set above

Now unmount and remove the storage device

cd /tmp
umount /tmp/usb


Insert storage device in to your pogo and power it on. You should now be able to ssh to it and as root


mkdir -p /usr/local/cloudengines/bin
mkdir /tmp/ce
mount -t ubifs -o ro ubi0:rootfs /tmp/ce

If the mount doesnt work try removing "-o ro"

cp /tmp/ce/usr/local/cloudengines/bin/xce.ko /usr/local/cloudengines/bin/
cp /tmp/ce/usr/local/cloudengines/bin/blparam /usr/local/cloudengines/bin/
cd /
umount /tmp/ce


Now update udev
pacman -Sy udev-oxnas
# follow instructions

Now restart your machine
reboot

Hopefully your system will come back up and work nicely. At this point i normally take a backup so that I dont have to mess around next time i restore. To take a backup I shut down the pogo and insert the storage media back in my pc

mkdir /tmp/usb
mount /dev/sdb1 /tmp/usb
cd /tmp/usb
tar -cvzf ~/mypogo.tar.gz *

Your backup will now be in your home dir.

So to restore follow the first few steps in formatting the storage media with fdisk, mke2fs the file system, mount the media can cd in to the mount. Now you can extract your backup


tar -xvzf ~/mypogo.tar.gz


Unmount, re-insert into pogo and power on
mysteri
 
Posts: 18
Joined: Sat Aug 20, 2011 2:37 pm

Re: Reinstall archlinux on pogoplug pro

Postby mtsk » Tue Jul 02, 2013 6:26 am

Hello,

I did a pacman -Sy something something and ended up lossing everything. I formated the thumbdrive using ubuntu 12.04. First using the disk utilitie,

then i tried

Start fdisk to partition the USB or SATA drive:
/sbin/fdisk /dev/sdb
At the fdisk prompt, delete old partitions and create a new one:

Type o. This will clear out any partitions on the drive.
Type p to list partitions. There should be no partitions left.
Now type n, then p for primary, 1 for the first partition on the drive, and then press ENTER, accepting default values.
Exit by typing w.

but this didn't work too well.


I unmounted and formatted the memory once again with disk utilities on Ubuntu. then using mke2fs -j /dev/sdxx where xx is your respective thumbdrive to reinstall everything too. in this case mine was /dev/sdb1

now create a xxxxxx.sh file. this one is for the Pogoplug Pro. I used it on mine based on my reading and it works/test on Model:
PogoPlug Pro. Probably works on others. PLease note this is just a modified version of the ./oxnas-install.sh

NOTE: notice the line with MAC=`00:25:31:01:XX:XX`, that is my pogoplug mac, use your own found in the sticker on base of unit

$this->bbcode_second_pass_code('', '#!/bin/sh
echo "#############################"
echo "##"
echo "## Pogoplug OXNAS based boards"
echo "## Arch Linux ARM rootfs Installer"
echo "##"
echo "#############################"
echo "##"
echo "## For use with OXNAS 7820 only."
echo "##"
echo "#############################"

echo "## PREPARATION "
echo "# Switching to /tmp..."
cd /tmp
echo "# Ensuring we're ready to proceed..."
## killall hbwd
umount /dev/sdb1
echo "# Preparing our way..."
mkdir /tmp/usb
mount /dev/sdb1 /tmp/usb

## get the things we need from blparam
echo "# Getting uboot parameters..."
/usr/local/cloudengines/bin/blparam > blparam.txt
echo "# This probably failed...as it does not exist!..."

MAC=`00:25:31:01:XX:XX`
LNAND=`nboot 60500000 0 200000`
BOOTARGS=``
BOARDVER=`PPRO1`
echo "# = MAC : $MAC"
echo "# = load_nand : $LNAND"
echo "# = bootargs : $BOOTARGS"
echo "# = board : $BOARDVER"
echo "# "

echo "# Checking board revision..."


if [ "$BOARDVER" != "PPRO1" -a "$BOARDVER" != "PPROHD1" -a "$BOARDVER" != "PPV3" ]
then
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "ABORTING!!! UNSUPPORTED MODEL"
echo "================================="
echo "See the wiki on models supported"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "Ignored since it's not connected to proper system"
fi
PCI=0
if [ "$BOARDVER" = "PPRO1" ]
then
PCI=1
fi
if [ "$BOARDVER" = "PPROHD1" ]
then
PCI=1
fi
echo "# board has PCI: $PCI"
echo "#"

echo "# Deriving boot partition format..."
mount > mount.txt
FMT=`ext3`
PART='/dev/sdb1'
echo "# = PARTITION: $PART"
echo "# = FMT : $FMT"
echo "# "

if [ "$FMT" != "ext2" -a "$FMT" != "ext3" ]
then
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "ABORTING!!! Cannot boot from $FMT"
echo "================================="
echo "See the wiki on how to format your"
echo "drive to ext2/ext3"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "I really hope this didn't happen, but verified and it is ext3 so f**k it"
## this is kinda usless since we manually formatted it, and it just double checking but w/e
## exit
fi

#######
## GET files
#######
echo "#############################"
echo "## RETRIEVING FILES "
echo "# Downloading ArchLinuxARM-oxnas-rootfs...(approx. 138MB)"
cd /tmp/usb
wget http://archlinuxarm.org/os/ArchLinuxARM-oxnas-latest.tar.gz
wget http://archlinuxarm.org/os/ArchLinuxARM-oxnas-latest.tar.gz.md5

if [ -f /tmp/usb/ArchLinuxARM-oxnas-latest.tar.gz ]
then
echo "# Verifying MD5"
RFSMD5=`/usr/bin/md5sum ArchLinuxARM-oxnas-latest.tar.gz | sed 's/\W.*//'`
GOODMD5=`sed 's/\W.*//' ArchLinuxARM-oxnas-latest.tar.gz.md5`
if [ "$GOODMD5" != "$RFSMD5" ]
then
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "MD5 verification Failure."
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
exit
fi

cd /tmp/usb
echo "# Extracting"
tar xzf ArchLinuxARM-oxnas-latest.tar.gz

if [ -f /tmp/usb/boot/uImage.pci -a -d /tmp/usb/usr/lib/modules/2.6.31.6_SMP_820 -a -f /tmp/usb/boot/uImage.nopci ]
then

echo "# Recording MAC Address"
echo "$MAC" > usr/local/mac_addr
echo "# Coping key CE binaries..."
echo " Kernel Flash Skipped"
#######
## flash boot arguments
#######


echo "# "
echo "# Skipping Setting up uboot parameters"

echo "#############################"
echo "## Looks good!"
echo "# Sync ..."
## on my system, it got stuck on sync command. I waited about 5 mins then just unpluged usb drive.
sync
echo "# Unmount "
cd /tmp
umount /dev/sdb1
echo "# Reboot to enter into Arch Linux ARM"
echo "reboot skipped, please connect to system now"
exit
fi
else
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "Extraction FAILED or WRONG rootfs"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
exit
fi

else
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "DOWNLOAD FAILED"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
fi')

Once this finishes, just remove the thumbdrive from the ubuntu computer, then insert into pogoplug. Mine took about 7-10mins to boot up, but then I was able to ssh into it using root@ip address. Note that now you will need to update pacages. Mine broke when i forced an update. I'll try to help further question if possible

Thanks to the following post, really helped me out
http://archlinuxarm.org/platforms/armv6/pogoplug-v3oxnasend-life
http://archlinuxarm.org/forum/viewtopic.php?f=29&t=5485


Good luck all! btw, I would try this on a new thubdrive and save your currently working one, just in case.
mtsk
 
Posts: 1
Joined: Tue Jul 02, 2013 6:09 am

Previous

Return to Community Supported

Who is online

Users browsing this forum: No registered users and 15 guests