Difference between revisions of "Plug Tips and Tricks"

From Amahi Wiki
Jump to: navigation, search
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
Back to [[Amahi_Plug_Edition]]
 +
 
= Introduction =
 
= Introduction =
  
Line 30: Line 32:
 
''If you use the NAND flash as swap you will lose this ability.''
 
''If you use the NAND flash as swap you will lose this ability.''
  
{{Code|cfdisk /dev/mtdblock2}}
+
cfdisk /dev/mtdblock2
 
* Create a "Linux swap / Solaris" partition that takes all the space:  
 
* Create a "Linux swap / Solaris" partition that takes all the space:  
 
# remove any existing partitions, if any
 
# remove any existing partitions, if any
Line 37: Line 39:
 
# select Write option
 
# select Write option
 
# select Quit option
 
# select Quit option
{{Code|mkswap /dev/mtdblock2
+
mkswap /dev/mtdblock2
echo "/dev/mtdblock2          swap                    swap    defaults        0 0" >> /etc/fstab
+
echo "/dev/mtdblock2          swap                    swap    defaults        0 0" >> /etc/fstab
swapon -a}}
+
swapon -a
  
 
== Copy a root filesystem from one disk to another ==
 
== Copy a root filesystem from one disk to another ==
Line 45: Line 47:
  
 
The code below assumes the old (usb) disk is at /dev/sdb1 and the new (internal) disk is at /dev/sda1. Substitute accordingly
 
The code below assumes the old (usb) disk is at /dev/sdb1 and the new (internal) disk is at /dev/sda1. Substitute accordingly
{{Code|
+
 
# /dev/sda1 is the target filesystem; must have an empty filesystem on it
+
# /dev/sda1 is the target filesystem; must have an empty filesystem on it
mount /dev/sda1 /mnt
+
mount /dev/sda1 /mnt
mkdir /mnt2
+
mkdir /mnt2
# /dev/sdb2 is the source filesystem
+
# /dev/sdb2 is the source filesystem
mount /dev/sdb1 /mnt2
+
mount /dev/sdb1 /mnt2
cd  /mnt2
+
cd  /mnt2
cp -ar * /mnt
+
cp -ar * /mnt
}}
 

Latest revision as of 03:50, 23 June 2020

Back to Amahi_Plug_Edition

Introduction

This page contains some tips, tricks and howto's for the plug distro. Feel free to add your own.

Setting the timezone

The timezone is not set on a new plug install (See #757. To set it manually follow the steps below:

  • Login as root or su to root.
  • choose from /usr/share/zoneinfo which timezone you want to set your plug to.
  • Issue the command rm /etc/localtime; ln -sf /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime
  • Issue the command hda-php-zone-change "Europe/Amsterdam" to set the timezone for PHP.

Obviously replace Europe/Amsterdam with whatever timezone you want to set the timezone to.

Useful commands

The following useful commands are not installed by default:

  • which
  • man
  • scp
  • ssh
  • make

To install issue the command:

yum -y install which man openssh-clients make

Advanced

Using the onboard NAND flash as a swap drive

Note that many devices are configured to fallback to booting from NAND flash if no USB/SD card is found. This makes it almost impossible to brick your device.

If you use the NAND flash as swap you will lose this ability.

cfdisk /dev/mtdblock2
  • Create a "Linux swap / Solaris" partition that takes all the space:
  1. remove any existing partitions, if any
  2. create a new primary partition
  3. select Type option, enter "82"
  4. select Write option
  5. select Quit option
mkswap /dev/mtdblock2
echo "/dev/mtdblock2          swap                    swap    defaults        0 0" >> /etc/fstab
swapon -a

Copy a root filesystem from one disk to another

This may be useful if you have set up things on a USB device and want to copy to an internal harddisk:

The code below assumes the old (usb) disk is at /dev/sdb1 and the new (internal) disk is at /dev/sda1. Substitute accordingly

# /dev/sda1 is the target filesystem; must have an empty filesystem on it
mount /dev/sda1 /mnt
mkdir /mnt2
# /dev/sdb2 is the source filesystem
mount /dev/sdb1 /mnt2
cd  /mnt2
cp -ar * /mnt