How to mount PiDrive on your Raspberry pi?

So, you bought a PiDrive from WD Labs and you want to mount it to yours Raspberry Pi? So, this tutorial might help. Note: I'm using my Raspberry Pi 3 and ordered PiDrive from NextCloud Box. And I will be using entire PiDrive as a one giant partition instead of partitioning it into several partitions.

Follow these steps:
- Connect your PiDrive to Raspberry, boot your Raspberry. Then find where your Raspberry Pi is mounted:
$ sudo fdisk -l
<... Lots of input here ...>
Disk /dev/sda: 931.5 GiB, 1000170586112 bytes, 1953458176 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


So, our Raspberry lives on /dev/sda. Good.

- Format this partition by using ext4:
$ sudo mkfs.ext4 /dev/sda1 -L "PiDrive"

- Mount partition to your system to /mnt/data
$ sudo mkdir /mnt/data
$ sudo mount -t ext4 -o "noatime" /dev/sda /mnt/data

 
- You need to setup correct user permissions on your mounted drive. First of all, find your UID/GID:
$ id
uid=1000(pi) gid=1000(pi) groups=1000(pi),4(adm),20(dialout),24(cdrom),27(sudo),29(audio)

So, in my case, UID/GID are 1000/1000.

Set permissions on drive:
$ sudo chown -R 1000:1000 /mnt/data
$ sudo chmod -R 775 /mnt/data


And you're done!

But you might want to permanently mount our PiDrive. So, you need to edit /etc/fstab file to do this.

- Find UUID of your drive:
$ sudo blkid
/dev/mmcblk0: PTUUID="6f92008e" PTTYPE="dos"
/dev/mmcblk0p1: SEC_TYPE="msdos" LABEL="boot" UUID="947B-B89A" TYPE="vfat" PARTUUID="6f92008e-01"
/dev/mmcblk0p2: UUID="eda95d8a-9cdd-4224-96d0-890b4791600c" TYPE="ext4" PARTUUID="6f92008e-02"
/dev/sda: LABEL="PiDrive" UUID="0562789e-5f04-44c6-b36e-c64bb4e340bf" TYPE="ext4"


So, in my case UUID is 0562789e-5f04-44c6-b36e-c64bb4e340bf.

- Edit /etc/fstab and add the following entry:
$ sudo nano /etc/fstab
/dev/disk/by-uuid/0562789e-5f04-44c6-b36e-c64bb4e340bf /mnt/data ext4 defaults,noatime,nofail 0 0


Now you're finally done :)

Komentarai

Awesome blog! Is your theme custom made or did
you download it from somewhere? A theme like yours with a few simple tweeks
would really make my blog stand out. Please let me know where you got your design.
Kudos

Greetings I am so excited I found your weblog, I really found you by accident, while
I was browsing on Yahoo for something else, Regardless
I am here now and would just like to say kudos for a incredible
post and a all round enjoyable blog (I also love the
theme/design), I don’t have time to read through it all at the moment but I have bookmarked it and also added
your RSS feeds, so when I have time I will be back
to read a great deal more, Please do keep up the superb b.

A motivating discussion is worth comment.
I think that you need to publish more about this subject, it may not be a
taboo matter but usually folks don't speak about these topics.
To the next! Cheers!!

Today, while I was at work, my sister stole my apple ipad
and tested to see if it can survive a thirty foot drop, just so she can be a
youtube sensation. My apple ipad is now broken and she has 83 views.

I know this is completely off topic but I had to share it with someone!

Link exchange is nothing else however it is only placing the other person's web site link on your page at proper place and other person will
also do same for you.

I just couldn't go away your website before suggesting that I
actually loved the usual info a person provide to your visitors?

Is gonna be back often to inspect new posts

Nice response in return of this issue with genuine
arguments and explaining the whole thing regarding that.

Asking questions are actually good thing if you are not understanding anything totally, however this piece of writing
provides good understanding even.

Thanks for every other informative web site. The place else could
I am getting that kind of info written in such an ideal way?
I've a project that I am just now running on, and I have been on the glance out for such info.

I'm gone to tell my little brother, that he
should also go to see this blog on regular basis to obtain updated from hottest information.

Hi there, for all time i used to check blog posts here in the early hours in the morning, for
the reason that i enjoy to find out more and more.

What's up it's me, I am also visiting this website
regularly, this website is genuinely pleasant and the users are genuinely sharing fastidious thoughts.

Asking questions are truly fastidious thing if you are not understanding anything totally,
except this piece of writing provides good understanding even.

I always spent my half an hour to read this website's content everyday along with a mug of coffee.

I'm amazed, I have to admit. Rarely do I encounter a blog that's both equally
educative and engaging, and without a doubt, you have hit the nail on the head.
The problem is an issue that not enough men and women are speaking intelligently about.
I am very happy that I stumbled across this in my search
for something relating to this.

Komentuoti