Guide Benutzung USB-Festplatte/en
Aus EUserv Wiki
Languages: |
Deutsch • English |
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 fdisk. Please proceed as follows:
- Start fdisk with the following command (Replace X with the respective drive letter, which is shown in dmesg):
fdisk /dev/sdX
- Create a new partition with the following command:
n
- Enter the partition type (select between primary or extended):
# primary partition p p # extended partition e e
- 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):
1 #or 2 #or 3 #or 4
- Enter the number for the start cylinder or press enter to use the first available cylinder.
- 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
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 fdisk with the following command:
fdisk /dev/sdc
- Create a new partition with the following command:
n
- Enter the partition type:
p
- Enter the number of the partition with the following command:
1
- Press enter to use the first available cylinder.
- 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
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):
mkfs.ext3 /dev/sdXy
Example:
To create a filesystem on the created partition named sdc1, enter the following command:
mkfs.ext3 /dev/sdc1
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