-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #160 from lucawun/main
Using Local Block Storage on Netcup Linux Server
- Loading branch information
Showing
2 changed files
with
260 additions
and
0 deletions.
There are no files selected for viewing
130 changes: 130 additions & 0 deletions
130
community-tutorials/how-to-use-local-block-storage/01-en.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
--- | ||
title: Using local Blockstorage on netcup Linux Server | ||
description: Learn how to attach an local Blockstorage | ||
updated_at: 2023-12-31 | ||
slug: how-to-use-local-block-storage | ||
author_name: Luca Wunderlich | ||
author_url: https://github.com/lucawun | ||
author_image: | ||
author_bio: | ||
tags: [local-block-storage, backup, more-storage] | ||
netcup_product_url: https://www.netcup.de/vserver/local-block-storage | ||
language: de | ||
available_languages: en,de | ||
--- | ||
|
||
# Introduction | ||
|
||
In this tutorial we will show you how to integrate and use additional hard disks under Linux on a netcup server. | ||
|
||
# Requirements | ||
|
||
The tutorial is aimed at users who already have access to their server via SSH. Please make sure that your user has the required authorizations. | ||
|
||
You can execute the following command at the beginning of each SSH session: ```bash sudo -i``` | ||
|
||
# Step 1 - Overview of available hard disks | ||
|
||
To get an overview of all recognized hard disks, use the command: | ||
|
||
``` | ||
fdisk -l | ||
``` | ||
|
||
In our example, we have two hard disks: /dev/sda (the system hard disk) and /dev/vda (an additional 50 GiB hard disk). | ||
|
||
# Step 2 - Create a partition | ||
|
||
Use `cfdisk` to create a partition on the additional disk: | ||
|
||
``` | ||
cfdisk /dev/vdb1 | ||
``` | ||
|
||
Select "dos" in the selection menu for an MBR partition table. Then create a 50 GiB partition as the primary partition. | ||
|
||
# Step 3 - Format partition | ||
|
||
Exit `cfdisk` and check that the partition has been created: | ||
|
||
``` | ||
fdisk -l | ||
``` | ||
|
||
Format the partition (in our example as ext4): | ||
|
||
``` | ||
mkfs.ext4 /dev/vdb1 | ||
``` | ||
|
||
# Step 4 - Mount the partition | ||
|
||
Create a folder for the hard disk (in our example "lbstorage"): | ||
|
||
``` | ||
mkdir /lbstorage | ||
``` | ||
|
||
Mount the partition in the folder: | ||
|
||
``` | ||
mount /dev/vdb1 /lbstorage | ||
``` | ||
|
||
# Step 5 - Automatic mounting after reboot | ||
|
||
Find the UUID of the partition: | ||
|
||
``` | ||
blkid /dev/vdb1 | ||
``` | ||
|
||
Open the `/etc/fstab` file and add the UUID: | ||
|
||
``` | ||
nano /etc/fstab | ||
``` | ||
|
||
Add the line at the end of the file (replace the UUID with the correct one): | ||
|
||
``` | ||
UUID=your_uuid_here /lbstorage ext4 defaults 0 0 | ||
``` | ||
|
||
Save the file. | ||
|
||
# Conclusion | ||
|
||
The additional disk is now ready for use and will automatically be mounted after a reboot. | ||
|
||
# License | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicence, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
|
||
# Contributor's Certificate of Origin | ||
|
||
By making a contribution to this project, I certify that: | ||
|
||
1. The contribution was created in whole or in part by me and I have the right to submit it under the license indicated in the file; or | ||
|
||
2. The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same license (unless I am permitted to submit under a different license), as indicated in the file; or | ||
|
||
3. The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. | ||
|
||
4. I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the license(s) involved. |
130 changes: 130 additions & 0 deletions
130
community-tutorials/how-to-use-local-block-storage/02-de.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
--- | ||
title: Einbinden von local Blockstorage mit einem netcup Linux Server | ||
description: Lernen Sie, wie Sie das Feature local Blockstorage einrichten können. | ||
updated_at: 2023-12-31 | ||
slug: how-to-use-local-block-storage | ||
author_name: Luca Wunderlich | ||
author_url: https://github.com/lucawun | ||
author_image: | ||
author_bio: | ||
tags: [local-block-storage, backup, more-storage] | ||
netcup_product_url: https://www.netcup.de/vserver/local-block-storage | ||
language: de | ||
available_languages: en,de | ||
--- | ||
|
||
# Einführung | ||
|
||
In diesem Tutorial zeigen wir Ihnen, wie Sie local Blockstorage unter Linux auf einem netcup Server einbinden und nutzen können. | ||
|
||
# Anforderungen | ||
|
||
Die Anleitung richtet sich an Benutzer, die bereits Zugriff auf ihren Server über SSH haben. Bitte stellen Sie sicher, dass Ihr Benutzer die erforderlichen Berechtigungen hat. | ||
|
||
Sie können zu Beginn einer jeden SSH-Session das folgende Kommando ausführen: ```bash sudo -i``` | ||
|
||
# Schritt 1 - Übersicht über verfügbare Festplatten | ||
|
||
Um eine Übersicht über alle erkannten Festplatten zu erhalten, verwenden Sie den Befehl: | ||
|
||
``` | ||
fdisk -l | ||
``` | ||
|
||
In unserem Beispiel haben wir zwei Festplatten: /dev/sda (die Systemfestplatte) und /dev/vda (eine zusätzliche 50 GiB-Festplatte). | ||
|
||
# Schritt 2 - Partition erstellen | ||
|
||
Verwenden Sie `cfdisk`, um eine Partition auf der zusätzlichen Festplatte zu erstellen: | ||
|
||
``` | ||
cfdisk /dev/vdb1 | ||
``` | ||
|
||
Wählen Sie im Auswahlmenü "dos" für eine MBR-Partitionstabelle. Danach erstellen Sie eine 50 GiB-Partition als Primärpartition. | ||
|
||
# Schritt 3 - Partition formatieren | ||
|
||
Verlassen Sie `cfdisk` und überprüfen Sie, ob die Partition erstellt wurde: | ||
|
||
``` | ||
fdisk -l | ||
``` | ||
|
||
Formatieren Sie die Partition (in unserem Beispiel als ext4): | ||
|
||
``` | ||
mkfs.ext4 /dev/vdb1 | ||
``` | ||
|
||
# Schritt 4 - Partition einbinden | ||
|
||
Erstellen Sie einen Ordner für die Festplatte (in unserem Beispiel "lbstorage"): | ||
|
||
``` | ||
mkdir /lbstorage | ||
``` | ||
|
||
Binden Sie die Partition in den Ordner ein: | ||
|
||
``` | ||
mount /dev/vdb1 /lbstorage | ||
``` | ||
|
||
# Schritt 5 - Automatische Einbindung nach Neustart | ||
|
||
Finden Sie die UUID der Partition: | ||
|
||
``` | ||
blkid /dev/vdb1 | ||
``` | ||
|
||
Öffnen Sie die `/etc/fstab`-Datei und fügen Sie die UUID hinzu: | ||
|
||
``` | ||
nano /etc/fstab | ||
``` | ||
|
||
Fügen Sie am Ende der Datei die Zeile ein (ersetzen Sie die UUID durch die richtige): | ||
|
||
``` | ||
UUID=your_uuid_here /lbstorage ext4 defaults 0 0 | ||
``` | ||
|
||
Speichern Sie die Datei. | ||
|
||
# Fazit | ||
|
||
Ihr local Blockstorage wird automatisch nach einem Neustart eingebunden und ist einsatzbereit. | ||
|
||
# License | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicence, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
|
||
# Contributor's Certificate of Origin | ||
|
||
By making a contribution to this project, I certify that: | ||
|
||
1. The contribution was created in whole or in part by me and I have the right to submit it under the license indicated in the file; or | ||
|
||
2. The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same license (unless I am permitted to submit under a different license), as indicated in the file; or | ||
|
||
3. The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. | ||
|
||
4. I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the license(s) involved. |