Build your Raspberry Pi into a NAS

Source: Internet
Author: User

Do you have an idle mobile hard drive or Raspberry Pi? You can use these to create a cheap and low-energy NAS. The final effect is definitely not as good as the NAS for $500, such as those produced by Synology DiskStation. But you can build a low-energy network storage platform-and especially suitable for those who are tired of the National Security Agency's data monitoring, you can store the data in this "loose.

You need a Raspberry Pi and two idle mobile hard disks. A smaller 2.5 hard drive can be directly powered by a USB interface, but we need a USB splitter with power supply, because the USB interface provided by Raspberry Pi is insufficient to power the mobile hard disk. You can also use thumbdrive or even an SD card. In fact, I am currently using a USB port mobile hard disk and a thumbdrive, and the operation process is the same.

Recommended reading:

Raspberry Pi build LAMP Server

Install Weston on Raspberry Pi

Install a game simulator on Raspberry Pi

You can use only one hard disk to create network storage for shared files. However, with two hard disks, you can set up data backup to prevent a hard disk from being damaged.

Prepare Hard Disk

The initial step is to format the hard disk on the desktop. This is for convenience. If something goes wrong, we can remove the hard disk from the NAS and read the data on a PC.

It can be formatted on Raspberry Pi, but it will take several hours to format it much faster from the desktop. Do it now.

Set SSH to enable the root user. First, set the password for the root user:
Sudo-I
Passwd root
(Enter your password)

Run the raspi-config script under the command line. You can run the sudo command or log out of the current user and log in as the root user. Enable SSH in the advanced options menu.

After the restart, you should be able to log on from another online machine (if on windows, you can use Putty ):
SSH root @ [IP address]

After logging in, find out the number of the inserted hard disk under/dev. The following assumes that two hard disks are used to create a data backup. Input
Fdisk-l

The mounted storage devices are displayed. You should see a picture similar to this:

/Dev/mmc is the partition of the Raspberry Pi system, and mmc refers to the SD card. /Dev/sda1 and/dev/sdb1 have nothing to do with the SD card. These are the USB hard disks you have inserted (originally SCSI drives, but now they are used to refer to any SATA ports or other storage devices)

Install the ntfs-3g module, so we can read and write the NTFS Format hard disk.
Apt-get install ntfs-3g

Create a directory and use this directory as the mount point to mount the hard disk. For simplicity, 1 and 2 are used below.
Mkdir/media/1
Mkdir/media/2
Mount-t auto/dev/sda1/media/1
Mount-t auto/dev/sdb1/media/2
Mkdir/media/1/shares
Mkdir/media/2/shares

  • 1
  • 2
  • Next Page

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.