基于树莓派4B+OMV搭建NAS
2021-06-03T11:08:46

准备

  1. 一块树莓派4B开发版
  2. 一张TF卡至少16G
  3. 一台PC或者一台MAC
  4. 读卡器
  5. 移动硬盘

开始

  1. 为树莓派刷写系统

    1. 下载并安装系统刷写工具https://downloads.raspberrypi.org/imager/
    2. 将TF卡通过读卡器连接到PC,开始刷写系统image-20201129191918025
      1. 系统选择 Operating System --> Raspberry PI OS(other) --> Raspherry PI OS Lite(32-bit)
      2. SD Card 选择你插入的TF卡
      3. 点击 WRITE 刷写系统image-20201129192813994
      4. 点击YES清除TF所有数据
      5. 刷写中image-20201129193016564
      6. 刷写完成image-20201129193355456
      7. 点击 CONTINUE
    3. 系统准备好了,将TF卡插入树莓派中,启动image-20201129200157152
    4. 输入账号密码(默认账号pi 密码raspberry)image-20201129200345286
    5. 输入sudo raspi-config进行配置WIFI(网线连接可以忽略)image-20201129200555711
    6. 选择第二项 Network Options -> Wircless LANimage-20201129200655942image-20201129200744430
    7. 输入WIFI SSID和密码连接成功,输入ifconfig可查看IPimage-20201129200830371image-20201129200846548image-20201129200913469image-20201129201108680
    8. 开启端口22, 输入 sudo raspi-config,选择 5 Interfacing Options-->P2 SSH,选择YESimage-20201129201322470
    9. ssh端口开启成功,至此树莓派系统配置完成
  2. 安装OMV

    1. OMV全称openmediavault,是一款开源NAS系统,官网地址https://www.openmediavault.org/

    2. 安装OMV之前需要更新一下树莓派系统,输入一下命令

      sudo apt-get update sudo
      image-20201129202416782
      image-20201129202416782
      sudo apt-get upgrade -y

      image-20201129202509294image-20201129203331725

      sudo rm -f /etc/systemd/network/99-default.link
      image-20201129203704630
      image-20201129203704630
    3. 重启树莓派sudo reboot重新连接树莓派,查看系统版本lsb_release -aimage-20201129204114734

    4. 设置本机hosts文件vi /etc/hosts,输入一下解析好的IP,可能每个地区的IP不一样,大家可以自己解析后添加

      # GitHub Start
      192.30.255.113 github.com
      192.30.255.113 gist.github.com
      185.199.108.153 assets-cdn.github.com
      151.101.76.133 raw.githubusercontent.com
      151.101.76.133 gist.githubusercontent.com
      151.101.76.133 cloud.githubusercontent.com
      151.101.76.133 camo.githubusercontent.com
      151.101.76.133 avatars0.githubusercontent.com
      151.101.76.133 avatars1.githubusercontent.com
      151.101.76.133 avatars2.githubusercontent.com
      151.101.76.133 avatars3.githubusercontent.com
      151.101.76.133 avatars4.githubusercontent.com
      151.101.76.133 avatars5.githubusercontent.com
      151.101.76.133 avatars6.githubusercontent.com
      151.101.76.133 avatars7.githubusercontent.com
      151.101.76.133 avatars8.githubusercontent.com
      # GitHub End
      image-20201129205630050
      image-20201129205630050
    5. 执行官方安装脚本安装OMV

      wget -O - https://github.com/OpenMediaVault-Plugin-Developers/installScript/raw/master/install | sudo bash
      image-20201129205804791
      image-20201129205804791
    6. 安装完成,自动重启image-20201129212828773

    7. 访问树莓派地址http://<ipaddress>,输入账号密码(默认账户admin,默认密码openmediavault)image-20201129213236466

    8. 登陆,首页,至此OMV安装完成image-20201129213332562

  3. 修改登陆密码image-20201129213645899

  4. 挂载移动硬盘

    1. 将移动硬盘连接到树莓派
    2. image-20201129214130511
      image-20201129214130511
    3. image-20201129214417191
      image-20201129214417191
    4. 挂载完成
  5. 共享文件

    1. 添加共享文件夹image-20201129214705592
    2. 开启共享image-20201129214816188image-20201129215010186
    3. OK,完成共享
公告
暂无公告
img
全部分类
收藏链接