Guide Benutzung USB-Festplatte/en

Aus EUserv Wiki

(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
(Die Seite wurde neu angelegt: „Kategorie:Excluded from RecentActivity {{Languages|Guide_Benutzung_USB-Festplatte}} Kategorie:Server '''''Using the USB hard disk drive''''' __TOC__ <div …“)
 
Zeile 1: Zeile 1:
-
[[Kategorie:Excluded from RecentActivity]]
 
{{Languages|Guide_Benutzung_USB-Festplatte}}
{{Languages|Guide_Benutzung_USB-Festplatte}}
-
[[Kategorie:Server]]
+
[[Kategorie:Servers]]
'''''Using the USB hard disk drive'''''
'''''Using the USB hard disk drive'''''
__TOC__
__TOC__
Zeile 54: Zeile 53:
== Partitioning the USB hard disk drive ==
== Partitioning the USB hard disk drive ==
-
You can partition the connected USB hard disk drive via '''fdisk'''. Please proceed as follows:
+
You can partition the connected USB hard disk drive via '''parted'''. Please proceed as follows:
-
* Start fdisk with the following command (Replace X with the respective drive letter, which is shown in dmesg):
+
* Start parted with the following command (Replace X with the respective drive letter, which is shown in dmesg):
-
   fdisk /dev/sdX
+
   parted /dev/sdX
-
* Create a new partition with the following command:
+
* Set the used size units (Replace X with the respective size unit, possible data are MiB, GiB, MB, GB or %) :
-
   n
+
   unit X
-
* Enter the partition type (select between primary or extended):
+
* Create the partition label with the following command:
-
<pre>
+
  mklabel msdos
-
# primary partition p
+
-
p
+
-
# extended partition e
+
-
e
+
-
</pre>
+
-
* Enter the number of the new partition with the following command (up to 4 primary partitions are possible. If you want to create more partitions, the last one must be an extended partition, which serves as container for more logical partitions):
+
* Create a partition with the following command (Replace X with the start point and Y with the end point of the partition. Also enter the partition type (primary or extended) and set the filesystem type (ext3 in this case)). Start and end points are measured in the unit you have stated above:
-
<pre>
+
  mkpart primary ext3 X Y
-
1
+
 
-
#or
+
or
-
2
+
-
#or
+
-
3
+
-
#or
+
-
4
+
-
</pre>
+
-
* Enter the number for the start cylinder or press enter to use the first available cylinder.
+
  mkpart extended ext3 X Y
-
* Enter the number of the end cylinder. Press enter to assign the available storage space or enter the size of the new partition in cylinders if you don't want to use the whole availabe storage space. You can also state the size directly. For example a 10 GB partition can be created by entering '''+10G'''
+
-
* Enter the following command to write the changes in the partition table:
+
-
  w
+
* Quit parted with the following command:
 +
  quit
=== Example ===
=== Example ===
Zeile 97: Zeile 84:
-
* Start fdisk with the following command:
+
* Start parted with the following command:
-
   fdisk /dev/sdc
+
   parted /dev/sdc
-
* Create a new partition with the following command:
+
* Set the used size unit:
-
   n
+
   unit MB
-
* Enter the partition type:
+
* Create the partition label:
-
   p
+
   mklabel msdos
-
* Enter the number of the partition with the following command:
+
* Create a new partition (In this example a partition with the size of 500 MB and the filesystem ext3 will be created):
-
   1
+
   mkpart primary ext3 0 500
-
* Press enter to use the first available cylinder.
+
* Quit parted:
-
* Press enter to use the last available cylinder. The partition will be created over the whole volume.
+
-
* Enter the following command to write the changes in the partition table:
+
-
   w
+
   quit
== Creating the filesystem on the USB hard disk drive ==
== Creating the filesystem on the USB hard disk drive ==
-
To create a new filesystem on the USB hard disk drive, enter the following command (Replace X with the drive letter of the USB hard disk drive and y with the number of the created partition):
+
Create the filesystem '''ext3''' on the newly created partition (Replace X with the respective drive letter):
-
   mkfs.ext3 /dev/sdXy
+
   /sbin/mkfs -t ext3 /dev/sdX
Example:
Example:
-
To create a filesystem on the created partition named sdc1, enter the following command:
+
To create the filesystem '''ext3''' on the created partition, enter the following command:
-
   mkfs.ext3 /dev/sdc1
+
   /sbin/mkfs -t ext3 /dev/sdc
= Using the USB hard disk drive =
= Using the USB hard disk drive =

Aktuelle Version vom 16:09, 23. Apr. 2014

Using the USB hard disk drive

Inhaltsverzeichnis

Using the USB hard disk drive

General

EUserv provides the possibility for every dedicated server to extend the hard disk space by adding an external USB hard disk drive. If you have ordered an USB hard disk drive for your server plan, you can use it as an additional storage device. The following guide shows you how to set up and use the additional USB hard disk drive.

Setting up the USB hard disk drive

To set up your USB hard disk drive, please start the rescue system first. This guide shows you how to start your server in the rescue system: Customer Service Center Server Rescue System.


Detecting the USB hard disk drive

To check if the connected USB hard disk drive is detected by the system, enter the following command in the shell:

 dmesg

The USB drive will be displayed as a new hard disk.

Example output:

usb 1-3: new high speed USB device using ehci_hcd and address 3
usb 1-3: configuration #1 chosen from 1 choice
scsi0 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 3
usb-storage: waiting for device to settle before scanning
scsi 0:0:0:0: Direct-Access     LEXAR    GEYSER JUMPDRIVE 1.00 PQ: 0 ANSI: 1 CCS
SCSI device sdb: 1001952 512-byte hdwr sectors (513 MB)
sdb: Write Protect is off
sdb: Mode Sense: 23 00 00 00
sdb: assuming drive cache: write through
SCSI device sdb: 1001952 512-byte hdwr sectors (513 MB)
sdb: Write Protect is off
sdb: Mode Sense: 23 00 00 00
sdb: assuming drive cache: write through
sdb: sdb1
sd 0:0:0:0: Attached scsi removable disk sdb
usb-storage: device scan complete

Here the USB hard disk drive is detected as sdb. The drive has a partition named sdb1.

If your server has two hard disk drives, they will be detected as sda and sdb and the additional USB hard disk drive as sdc.

Partitioning the USB hard disk drive

You can partition the connected USB hard disk drive via parted. Please proceed as follows:

  • Start parted with the following command (Replace X with the respective drive letter, which is shown in dmesg):
 parted /dev/sdX
  • Set the used size units (Replace X with the respective size unit, possible data are MiB, GiB, MB, GB or %) :
 unit X
  • Create the partition label with the following command:
 mklabel msdos
  • Create a partition with the following command (Replace X with the start point and Y with the end point of the partition. Also enter the partition type (primary or extended) and set the filesystem type (ext3 in this case)). Start and end points are measured in the unit you have stated above:
 mkpart primary ext3 X Y

or

 mkpart extended ext3 X Y
  • Quit parted with the following command:
 quit

Example

In the following example the connected USB hard disk drive is detected as sdc. This has been determined by dmesg. To add a new partition, proceed as follows:


  • Start parted with the following command:
 parted /dev/sdc
  • Set the used size unit:
 unit MB
  • Create the partition label:
 mklabel msdos
  • Create a new partition (In this example a partition with the size of 500 MB and the filesystem ext3 will be created):
 mkpart primary ext3 0 500
  • Quit parted:
 quit

Creating the filesystem on the USB hard disk drive

Create the filesystem ext3 on the newly created partition (Replace X with the respective drive letter):

 /sbin/mkfs -t ext3 /dev/sdX

Example:

To create the filesystem ext3 on the created partition, enter the following command:

 /sbin/mkfs -t ext3 /dev/sdc

Using the USB hard disk drive

Mounting the USB hard disk drive in the file system

To mount the USB hard disk drive in the file system, proceed as follows:

  • Create a directory, which serves as the mounting point:
 mkdir /mnt/usb1
  • Enter the following command to mount the new partition in the new directory (Replace X with the drive letter of the USB hard disk drive and y with the number of the created partition):
 mount /dev/sdXy /mnt/usb1 


Example

To mount the USB hard disk drive in the file system, proceed as follows:

  • Create the directory for the mounting point:
 mkdir /mnt/usb1
  • Mount the hard disk drive partition with the following command:
 mount /dev/sdc1 /mnt/usb1

Unmounting the USB hard disk drive

To unmount the USB hard disk drive in the file system, proceed as follows (Replace X with the drive letter of the USB hard disk drive and y with the number of the created partition):

 umount /mnt/usb1

or

 umount /dev/sdXy


Example

Enter the following command to unmount the hard disk drive:

 umount /mnt/usb1


Auto-mounting of the USB hard disk drive during system startup

If you want your hard disk drive to be automatically mounted during the system start, please proceed as follows:

  • Open the file /etc/fstab with the following command:
 nano /etc/fstab
  • Add the following line (Replace X with the drive letter of the USB hard disk drive and y with the number of the created partition):
# <fs>        <mountpoint>    <type>    <opts>        <dump/pass>
/dev/sdXy     /mnt/usb1          ext3      defaults      0 0


The label <fs> (short for fs_spec) stands for the block device (your partition). <mountpoint> stands for the absolute path where the partition has to be mounted. <type> describes which file system resides on the partition (in this case ext3). <opts> delivers additional options specific to the file system.

The last column is used to define whether a dump of the partition has to be created (0 - no, 1 - yes). The pass option defines in which order fsck (a file system check tool) has to be executed during startup. All partitions except the root partition (/) should get the value 2. A 0 disables fsck during the boot process.

Example

  • Enter the following line in /etc/fstab:
# <fs>        <mountpoint>    <type>    <opts>        <dump/pass>
/dev/sdc1     /mnt/usb1          ext3      defaults      0 0