Jump to content

Howto: create your own linux home server using Debian

The RAID array is actually no problem at all. I recently reinstalled my server with a fresh Debian 8 image and the raid got detected just fine once I installed mdadm. There are some subtle differences between 7 and 8 due to the new systemd service manager in 8, though. One of those subtle differences is in block device names.

Maybe I should upgrade at some point then. For now my focus is to expand the Raid array and upgrade my main rig to Win 10 :)

 

Here's a screenshot of the command "lsblk"

RiU1h3X.png

 

From this picture I can see that the command I should run to expand the array should be

mdadm --add /dev/md0 /dev/sdfmdadm --grow --raid-devices=5 /dev/md0

NAS build log: Gimli, a NAS build by Shaqalac.

Mechanical keyboards: Ducky Mini YotH - Ducky Mini

Link to comment
Share on other sites

Link to post
Share on other sites

@MG2R

I guess it's fair to assume that your 'like' means that the command is correct and my array is mounted correctly and I should be all set to add my HDD and grow my Raid array?  :)

And thank you very much for your help! :)

yes. Do keep in mind you'll hafe to grow the actual file system as well for the newly added space to be usable :)

Link to comment
Share on other sites

Link to post
Share on other sites

yes. Do keep in mind you'll hafe to grow the actual file system as well for the newly added space to be usable :)

Cool.

Would that be the command, when I'm using XFS for my array,

xfs_growfs /dev/md0

Btw. I'm using ruTorrent (rTorrent) as my tracker client, is it required to stop that before I start to grow the array or shouldn't it just do that automatically? This is a long shut as I've no idea if you use this client or not :)

NAS build log: Gimli, a NAS build by Shaqalac.

Mechanical keyboards: Ducky Mini YotH - Ducky Mini

Link to comment
Share on other sites

Link to post
Share on other sites

Cool.

Would that be the command, when I'm using XFS for my array,

xfs_growfs /dev/md0

Btw. I'm using ruTorrent (rTorrent) as my tracker client, is it required to stop that before I start to grow the array or shouldn't it just do that automatically? This is a long shut as I've no idea if you use this client or not :)

That should be correct. XFS should be able to be resized (well, grown. you can't shrink it) online, so there shouldn't be any need to stop services or unmount the file system. You can always do so if you want to be extra careful though. I've never use XFS personally, so I can't share my experience here, unfortunately.

Link to comment
Share on other sites

Link to post
Share on other sites

That should be correct. XFS should be able to be resized (well, grown. you can't shrink it) online, so there shouldn't be any need to stop services or unmount the file system. You can always do so if you want to be extra careful though. I've never use XFS personally, so I can't share my experience here, unfortunately.

Awesome. Just to be absolutely sure, if you look at this section of the wiki page, they list a few options in the end of the section

 

 

A full command example with options is as follows

resize2fs -S 128 -p /dev/md1 630G
  • -S raid stride size calculated with chunk / block = 512k / 4k = 128k. These are custom numbers that will not make sense with the default. Please find your numbers and use those for this. You can also just not call this option and stick to default.
  • remember to set chunk in mdadm command, as chunk is set to 64? by default
  • higher chunk was decided upon based on info from raid wiki that research showed that high chunk size for raid-5 arrays worked good
  • 630G gigabytes shrink to size

 

Would I have to include any of those in this command?

xfs_growfs /dev/md0

NAS build log: Gimli, a NAS build by Shaqalac.

Mechanical keyboards: Ducky Mini YotH - Ducky Mini

Link to comment
Share on other sites

Link to post
Share on other sites

Nope, that command should just grow whatever XFS file system you throw at it to the maximum size available :)

That's great. I'm about to install my new HDD and while I have the case open I'll make some small improvements to the insides of my NAS.

Thanks!

NAS build log: Gimli, a NAS build by Shaqalac.

Mechanical keyboards: Ducky Mini YotH - Ducky Mini

Link to comment
Share on other sites

Link to post
Share on other sites

I'll definitely have to double-check this but as far as I can remember that's what my array and the new drive is called. The sda, sdb and so on is an automatic naming scheme right?

 

 

Yes, it depends on the SATA port you plug it in at (on older kernels). If you're on Debian 8, this is very random and shouldn't be trusted at all.

Addendum: On Arch (I presume on Debian too), you can do

 

ls /dev/disk/by-id
Which will give you persistent identifiers for your disks (and partitions) which are

always the same for the same disk and can be used just like /dev/sda or /dev/sda1 etc.

I originally came across this due to ZFS since you need it for that or else things can

get kinda funky (as in: ZFS gets confused about which drives are part of its pools if

the OS starts shuffling things around) and use them for most stuff nowadays since I've

found it very practical. Not sure if this is of any use to you at this point, but just

FYI for future reference.

Example: Mounf first partition on a drive to a mountpoint in /etc/fstab:

 

#/etc/fstab/dev/disk/by-id/ata-SAMSUNG_HD103UJ_S13PJ1KQ605124A-part1     /mnt     jfs     auto,rw,user 0 0
And this will always work AFAIK, even if you add new drives or change ports or whatever.

There's also other stuff, like by-partlabel, by-uuid and so on, but I've found this

to be the most useful for me personally.

Edited by alpenwasser

BUILD LOGS: HELIOS - Latest Update: 2015-SEP-06 ::: ZEUS - BOTW 2013-JUN-28 ::: APOLLO - Complete: 2014-MAY-10
OTHER STUFF: Cable Lacing Tutorial ::: What Is ZFS? ::: mincss Primer ::: LSI RAID Card Flashing Tutorial
FORUM INFO: Community Standards ::: The Moderating Team ::: 10TB+ Storage Showoff Topic

Link to comment
Share on other sites

Link to post
Share on other sites

The new HDD has been successfully added to the system and detected by the system.

8WVJxJT.png

All I need to do know is to make a back-up of the most critical items from the array. Should probably have done that before I started to mess with the internals of my NAS. Anyway, that has to be done and then I'm ready to go. :D

 

This would probably be a good time to update my NAS build log, I think it's been 1.5 years since I've posted anything to it  :rolleyes:

 

And this will always work AFAIK, even if you add new drives or change ports or whatever.

This doesn't sound like a bad idea at all but right now I have my drives labelled from the top to bottom.  :)

NAS build log: Gimli, a NAS build by Shaqalac.

Mechanical keyboards: Ducky Mini YotH - Ducky Mini

Link to comment
Share on other sites

Link to post
Share on other sites

@MG2R

One last question.

I'm wondering, if this process will last up to two days, how will I be able to monitor the process? Normally I shut down my desktop during the night, so when I start it up again, will I be able to log on to Debian and follow the progress? :-)

NAS build log: Gimli, a NAS build by Shaqalac.

Mechanical keyboards: Ducky Mini YotH - Ducky Mini

Link to comment
Share on other sites

Link to post
Share on other sites

@MG2R

One last question.

I'm wondering, if this process will last up to two days, how will I be able to monitor the process? Normally I shut down my desktop during the night, so when I start it up again, will I be able to log on to Debian and follow the progress? :-)

Yes. You can run

sudo mdadm --detail /dev/md0

or

cat /proc/mdstat
Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×