![]() Next, let's go ahead and mount the drive to the newly created mount point: This creates a mount point titled "usb" for our drive. This will allow us to more easily reference the storage location from our web server or through any connections we might make: The format process may take a while, but once it's done, run sudo fdisk -l again to make sure your drive was correctly formatted (your drive entry should have a "System" type of "Linux" now):įinally, let's create a mount point for our newly formatted drive in our Raspbian system. If there are currently files you plan to use on the drive, I highly recommend disconnecting the drive now and backing them on another computer. NOTE: Formatting will erase all data currently on the drive. ![]() Now that the drive is set up with a single, new partition, we can format it to 'ext4': Once the process is complete, you should see the message "Created a new partition 1 of type 'Linux' and a size of xxx.x GiB." (NOTE: The size listed here will depend on the capacity of your drive).įinally, save your changes and exit by typing w. In the prompts that follow, you can just hit "Enter" to choose the default values and create your new partition. Type n to define a new partition on the drive. To do this, we'll use the 'fdisk' utility: Next, we need to create a new partition on the drive. To do this, first need to wipe any formatted partitions:Ĭonfirm that the drive is now unformatted by checking the sudo fdisk -l results: Now that we know where our drive is connected to, we can go ahead and format it to the Linux-friendly format of 'ext4'. NOTE: If your drive is currently divided into multiple partitions, they will appear as separate entries here (i.e. If you have multiple devices connected, you can narrow down to which is your hard drive by looking at the storage "Size" of the device (in my case, the device at 'sda1' reports 7.5G the capacity of my drive): In most cases, your drive will be detected under either 'dev/sda1' or '/dev/sdb1'. You should see a list of connected storage, including your new hard drive. First, make sure your newly connected drive is detected: If your drive isn't already formatted to 'ext4', don't worry - it's easy enough to do from within the Pi's terminal. The recommended file format for Linux drives is 'ext4'. Now we can go ahead and configure the HDD to play nice with Raspbian. At this point, if your drive is equipped with a power LED, it should light up indicating everything is connected correctly. Next, let's connect your external drive to the hub. If you try to connect a hard drive without using a powered hub, it may power up but not be detectable in the file system. NOTE: It's necessary to use a hub with a power supply for anything but a flash drive, since the on-board USB ports will not be able to supply enough power for an external hard drive. Make sure you plug in the hub's power supply, as well as connect the hub's USB cable to one of your Pi's open USB ports. The first step is to connect up the powered USB hub. Now that we've got everything we need, let's get started! Step 1: Connect Hub and Drive to the Pi ![]() A powered USB hub (the powered part is key here).A USB hard drive (or if you have an extra 2.5" drive laying around, a SATA to USB enclosure).A Raspberry Pi set up to run as a web server (see the tutorial here if you haven't done this yet).In addition, I'll go through the steps to configure the Samba file service on your server, so that you can transfer files directly from any other computers in your home.īefore we get started, you'll need to collect a few items we're going to use: In this guide, I'll describe how to expand your Raspberry Pi's storage by connecting an external USB hard drive. In the previous tutorial, Setting Up a Raspberry Pi Web Server, we followed the steps to set up your Rasbperry Pi as a web server, able to serve files publicly thanks to Dynamic DNS. ![]()
0 Comments
Leave a Reply. |