XeusNguyen
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    1
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Selfhosted NAS with Raspberry Pi 4 ###### tags: `research` `network` `DIY` `tutorials` ![](https://i.imgur.com/xiyYWft.png) **This is first blog which i wrote with sharing another topic out of Security. And it is the most of part i like i bring more new technology for my room. So in this session, i will talk about adventure to building NAS. Hope u can setup it for your own and have good time to learning new somestuff on network :coffee:** ## So this so refference for my topic: * https://www.youtube.com/watch?v=gyMpI8csWis&t=968s&ab_channel=NetworkChuck * https://www.raspberrypi.com/tutorials/nas-box-raspberry-pi-tutorial/ ## What is NAS? **Network-attached storage (NAS) allows you to save files from your computer and mobile devices to external hard drives via your home or office wireless network. Using Raspberry Pi, you can connect your existing storage devices — such as external portable hard drives and USB flash drives — to create secure backups of all your important files, accessible from anywhere in the world.** ![](https://i.imgur.com/J9aek31.png) **Have some different on architecture SAN and NAS. So visualization to distinguishing btw** ==> **A NAS is a single storage device that operates on data files, while a SAN is a local network of several devices. [Reference Link](https://www.lifewire.com/san-vs-nas-818005) :smiley:** - So i find the solution for external storage without bring physical disk from me by NAS - And the market is very very popular and it have more type of NAS u can choose such as PC became NAS, Raspberrypi became NAS, ...![](https://i.imgur.com/ntgIcji.png) - And SYSNOLOGY is once of best NAS solution for anyone but it will cost to much to build it so with another method we can build NAS solution by Raspberrypi. Very Easy - GUI setup - Cheap :thinking_face: ## How to build it? ![](https://i.imgur.com/zSDHUhi.png) ### Shopping - Raspberrypi 3-4 or 5 **(Maybe soon and Higher is recommended)** - HDD or SDD or whatever external Disk can connect with Rasp4 - FlaskCard - Boot OS for NAS - USB or Laptop can read flaskCard to boot OS - LAN Cable - Really importance - Affected for speed of NAS - And external Cable for connect HDD or SDD to Rasp4 - Recommend using USB 3.0 or Higher (Base on Rasp) ### So if you have all of it and so take a look it some my recommend addition - Need to using a Official Power supply for Rasp to get stability![](https://i.imgur.com/h3xejCL.png) - Need to buy a box have power supply to storage physical disk to get stability ![](https://i.imgur.com/4wu6Aqa.png) ==> But don't worry but if you have it NAS will active with stability :smiling_face_with_smiling_eyes_and_hand_covering_mouth: and not yet to need all of that. The choices base on your budget ### Get OS For NAS ![](https://i.imgur.com/NJc9isW.png) - So you need choose the right version for next step tool so choice raspbian OS Lite 32 or 64 bit. - You can download all of that on [Official Link](https://www.raspberrypi.com/software/) - U can use Raspberry Pi Imager ==> To boot OS for your flaskcard **(Recommend using above or equal 16 Gb)**. Choose the option on one to easily open SSH and connect to LAN (if you don't have a cable for internet). ==> Easily step but you need more careful for setup the name or password really importance (Try to change default name pi because on 2022 some of version raspbian need you change default name and password) ==> Take a look for OS install on reference on top of blog ### If you have HDD or SDD on NTFS format you need to format that to ext4: - So basically, u need to know why we do that kind on 2 reason: - First, NTFS format is for Windows Disk format - Using that kind format on windows. It is your basic format on all of your disk you have now if you use windows ![](https://i.imgur.com/MH3eOUH.png) - Second, ext4 is linux format partion. Really helpful for next step so you can handle all of step to DIY NAS, you need format HDD or SSD for ext4 firstly - So method we can change very easily: - If you can SSH with raspberry via `ssh username@hostname` you can have console for on your own terminal like ![](https://i.imgur.com/ygvzUZC.png) - So typing on that command on that link [Link](https://phoenixnap.com/kb/linux-create-partition) so you will partition of your disk for ext4 format - Before format u need to unmount all of disk and choose gpt to initilize disk again ==> Remember choose ext4 format ### OpenMediaVault - We’re going to be using a free piece of software called OpenMediaVault to manage our network storage. OpenMediaVault offers an easy-to-use, web-based interface, and multiple add-on options for advanced users.`from raspberry`![](https://i.imgur.com/Fqyuzf4.png) - To install OpenMediaVault, run: `sudo wget -O - https://github.com/OpenMediaVault-Plugin-Developers/installScript/raw/master/install | sudo bash` - Reboot that after finished - Typing the IP address of your Rasp in browser and you will get the web![](https://i.imgur.com/yffnLvC.png) - Basic loggin with default `user: admin` and `password: openmediavault` - Login succesful, quickly change your password for access this monitor becasue it can control all of your rasp ### NAS Setup - Go to **storage** tab and click **Disks** ==> View your all of disk attach with raspberrypi if not try again or reboot ![](https://i.imgur.com/pRmAFd5.png) - After check everything is *okay*, go for clicking on **File Systems**. You likely won’t see anything here, so select **Create**. Here, you can select your storage device and select **OK** and close.![](https://i.imgur.com/lbU5IcP.png). After that Select the file system to mount it and apply changes. - Navigate continuous on Shared folder tab, click create icon and set up with your drive and click oke. Remember set up priviledge if you have more user on raspberrypi ![](https://i.imgur.com/JQJAmad.png)Save and apply changes. **Lastly, we need to make sure computers on your network can find the folder (IF 500 Err occur you need check your network or check or the format of your disk - 2 reason can make error occurring)**. - Navigate to Services and select SMB/CIFS ![](https://i.imgur.com/pz8suEx.png) go for setting to enable SMB service - Go for it on **Shares** and add shared folder and save that ![](https://i.imgur.com/VQV9JCz.png) - So reach NFS tab and **enable** it and save ![](https://i.imgur.com/Kc1X61r.png) - Click **Shares** and do it with your shared folder and add user u want on that ![](https://i.imgur.com/zCM0CWs.png) - Now your NAS is really work ### Using NAS via same Network with Raspberry #### With window OS ![](https://i.imgur.com/jzrQ8eo.png) - Choose `add network location` on ThisPC. So add with syntax to connect to your nas `//<IP Raspberrypi>/<Name_Shared_Folder>` - Typing your username and password of user u permit to access your NAS - And Click next and you get the NAS on your window - So remember you if you access it via with your private IP of Rasp and u work on once of network ==> The speed can have maximumspeed #### Using on Android - There are many way you can associate with NAS and software is think is very easily use is [AndSMB](https://play.google.com/store/apps/details?id=lysesoft.andsmb&hl=vi&gl=US)![](https://i.imgur.com/nr9ozQA.png) - Open it and add your setting on NAS like on windows OS which u need work. Remmember you need work on same network with raspbeerypi ### Using NAS remote anywhere - So you need using PortForward - NAT port of your public network for your Raspberrypi [Maybe it can help](https://www.cfos.de/en/cfos-personal-net/port-forwarding.htm) - If not work after u nat port, first you need check your gateway u config is right ? if it right go forward to ISP for open nat service for your network because some of ISP can block of network - To **deny** the usually replaced by **ISP** for your public IP, you need config your public IP address for **DNS** - Buy it or find fome free version like **noip**. Install it on Raspberrypi and assign it with Ip of Raspberrypi on your network ![](https://i.imgur.com/6EkBAAN.png) - And try it again on step above on Window OS and Android ==> NAS is activate ### Hopeful u can success for creating your own NAS. Becareful and stay safe and don't miss protect it on next session or other topic ... :smile:. Happy hacking and researching :100:

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully