mirror of
https://github.com/maxkratz/community-tutorials.git
synced 2024-09-08 00:02:56 +00:00
Using Local Block Storage on Netcup Linux Server
This commit is contained in:
parent
1251b92f9e
commit
ed714fcc44
2 changed files with 260 additions and 0 deletions
130
community-tutorials/how-to-use-local-block-storage/01-de.md
Normal file
130
community-tutorials/how-to-use-local-block-storage/01-de.md
Normal file
|
@ -0,0 +1,130 @@
|
|||
---
|
||||
title: Einbinden von lokalem Blockspeicher unter Netcup Linux Server
|
||||
description: Lernen Sie, wie Sie unter einem Netcup Linux-Server zusätzliche Festplatten einbinden und nutzen können. Dieses Tutorial richtet sich an Benutzer mit SSH-Zugriff und bietet Schritt-für-Schritt-Anleitungen für die Einrichtung.
|
||||
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 zusätzliche Festplatten 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. **Hinweis:** 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
|
||||
|
||||
Die zusätzliche Festplatte ist nun einsatzbereit und wird automatisch nach einem Neustart eingebunden.
|
||||
|
||||
# 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
community-tutorials/how-to-use-local-block-storage/01-en.md
Normal file
130
community-tutorials/how-to-use-local-block-storage/01-en.md
Normal file
|
@ -0,0 +1,130 @@
|
|||
---
|
||||
title: Using Local Block Storage on Netcup Linux Server
|
||||
description: Learn how to attach and utilize additional hard drives on a Netcup Linux server. This tutorial is designed for users with SSH access and provides step-by-step instructions for setup.
|
||||
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. **Note:** 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 hard disk is now ready for use and is automatically 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.
|
Loading…
Reference in a new issue