Skip to content

標籤: Pi

Raspberry Pi的備份與還原

這裡介紹在Windows、Linux與OSX中,如何備份與還原Raspberry Pi的記憶卡。

Windows

在 Windows 中若要備份或回復記憶卡的資料,可以使用Win32 Disk Imager這個開放原始碼的免費工具。

Win32 Disk Imager 是專門用來備份 USB 手指、記憶卡的小工具,安裝好之後,先將記憶卡插進電腦,並執行 Win32 Disk Imager,就會看到這樣的操作畫面。

首先選擇備份影像檔的儲存路徑與檔案名稱(Image File),然後選擇要備份的設備(Device),接著按下「Read」按鈕即可將記憶卡的資料全部備份至檔案中。

如果要從備份影像檔中將資料還原至記憶卡,則按下「Write」按鈕即可。

把VNC設置成開機服務(Jessie)

此文章用於把VNC設置成開機服務。

1. Install Tight VNC server:

sudo apt-get install tightvncserver

2. Start it manually and enter new VNC password.

vncserver :1

3. Create a new file /etc/systemd/system/vncserver@.service

4. (Optional) Replace the parameters in the unit file, if you want to.

5. Run

sudo systemctl daemon-reload && sudo systemctl enable vncserver@1.service

6. Reboot.

以下是/etc/systemd/system/vncserver@.service的內容:

開機自動運行VNC程式(Jessie)

此文章用於把VNC設置成開機啟動,如此方法不行,則可以參考另一篇設置成開機服務的文章。

  1. Install the VNC server.
    sudo apt-get install tightvncserver
  2. Launch vncserver for the first time to set up a password.
    vncserver :1
  3. Create a file as /etc/init.d/vncserver (be sure to modify the USER, GEOMETRY, NAME, etc.)
  4. sudo chmod +x /etc/init.d/vncserver
  5. sudo update-rc.d vncserver defaults

以下是/etc/init.d/vncserver的內容:

讓Raspberry Pi成為你的電腦開關伺服器

Note: This post and the accompanying software packages have been updated several times since this was originally posted. The most up-to-date releases and instructions can always be found in the GitHub Repo.

I have a very power hungry desktop computer that I use for video editing and large file storage. When I’m travelling with my laptop, I obviously can’t carry all my files and data with me, so I occasionally use “remote desktop” to access my desktop from the road. I also use a Plex Media Server to stream content from my desktop computer. However, the computer has to be on for me to be able to do this. This means I need to leave the computer on all the time, just in case I need to access it. This wastes power, costs me money, and harms the environment. My Raspberry Pi, on the other hand, consumes a minuscule amount of power, and is always on anyways, serving other purposes. In this tutorial, I’ll show you how to run a simple mobile-friendly website from your Raspberry Pi that will allow you to remotely wake up your power-hungry computer, so you can remotely access it. When you’re done, just put it back to sleep from within the remote desktop service (or use the mobile app plus a small background server running on your desktop to put it back to sleep – this is described in the instructions). The app pings the computer from the Raspberry Pi to inform you of when the computer has woken up and established network connectivity. Follow along after the break…

使用USB手指為Raspberry Pi安裝Raspbian系統

In this tutorial, I’m going to talk you through running Raspbian from a USB connected drive instead of from an SD card. Running from a USB connected Flash or Hard Drive has many advantages, the biggest being speed and reliability.

SD Cards have a limited read/write cycle, and when hosting a site with a MySQL database from a SD card, it won’t take long before you start getting corruptions and failures. USB Flash drives provide a cheap and reliable alternative. I’ve tested several USB Flash drives, and found Sandisk and Corsair to be the best for speed and reliability. This site is run off a 16GB Kingston USB 3.0 Flash drive.

Assumptions before we begin

I’m going to assume that you know your way around Terminal, and are using a Mac to perform these steps. You will still need an SD card to store the boot instructions to tell the Raspberry Pi to launch the OS from the USB; the Raspberry Pi’s can’t (yet) boot directly from a USB storage device.