Buffalo NAS-Central Forums

Welcome to the Linkstation Wiki community
It is currently Fri Aug 17, 2018 3:52 pm

All times are UTC+01:00

Post new topic  Reply to topic  [ 1 post ] 
Author Message
PostPosted: Thu Jun 26, 2014 10:58 am 
Total Newbie

Joined: Thu Jun 26, 2014 10:17 am
Posts: 1
Hello !

I'm new on the forum (and i'm french too, so sorry for my bad english) and i have found a tutorial to chroot debian on Linkstation !

1st : You must have a Linux Installation on your PC (debian on virtual box is good)

On your PC, open a terminal and type :
sudo apt-get install debootstrap
mkdir sdebian
sudo debootstrap --foreign --arch armel wheezy sdebian
sudo tar -cvpzf sdebian.tar.gz sdebian

Put the archive on your Linkstation and connect it via SSH

Extract the archive anywhere (and adapt the script below) :
tar -xvpzf sdebian.tar.gz

2nd : Then, create a script called chroot.sh and type that :
CHROOT=[CHROOT REPERTORY, In my case "/mnt/disk1/sdebian/"]
mount -o bind /dev $CHROOT/dev
mount -o bind /proc $CHROOT/proc
mount -o bind /dev/pts $CHROOT/dev/pts
mount -o bind /sys $CHROOT/sys

cp /etc/resolv.conf $CHROOT/etc/resolv.conf

chroot $CHROOT /bin/bash

Then, make it executable :
chmod +x chmod.sh

And execute it as root !
sh chroot.sh

3rd : But it's not finish, we have to finalize the installation :
/debootstrap/debootstrap --second-stage

It's long if you have a slow Linkstation, like me.

Then, generate a sources.list :

And update your debian :
apt-get update
apt-get upgrade

Don't forget to add an user !
adduser [YOUR NAME HERE]

4rd: After the installation, install packages and configure some permissions :
chmod 777 /tmp
chmod +t /tmp

apt-get install openssh-server htop most uptimed screen irssi

To start your Debian at startup of your NAS, do that (Not in the CHROOT !) :
cd /etc/rc.d/
touch S99zchrootDebian.sh
chmod 755 S99zchrootDebian.sh
chmod +x S99zchrootDebian.sh
nano S99zchrootDebian.sh

And type that in the file :
# Define where is the chroot on filesystem
CHROOT=[CHROOT REPERTORY, In my case "/mnt/disk1/sdebian/"]
# local necessary
mount -o bind /dev $CHROOT/dev
mount -o bind /proc $CHROOT/proc
mount -o bind /dev/pts $CHROOT/dev/pts
mount -o bind /sys $CHROOT/sys
cp /etc/resolv.conf $CHROOT/etc/resolv.conf
cp /etc/hosts $CHROOT/etc/hosts
# Start Services, you want …
chroot $CHROOT /etc/init.d/rsyslog start
chroot $CHROOT /etc/init.d/mtab.sh start
#chroot $CHROOT /etc/init.d/cron start
#chroot $CHROOT /etc/init.d/ssh start
chroot $CHROOT /etc/init.d/uptimed start

And you have to think to edit the file for add services that you have added on your Debian.

Contragulations ! You have Debian on your NAS !

The source (in french, like me) : http://pellelatarte.fr/2011/06/nas-syno ... -et-mysql/

Normaly, it's for a Synology NAS, but i have a little adaptated it.

Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 1 post ] 

All times are UTC+01:00

Who is online

Users browsing this forum: No registered users and 25 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited