|
Suche |
Mit dieser Hilfe können Sie Ihre USB Festplatte oder USB Flash Disk auf Ihrem Linux Server konfigurieren. Damit Ihr USB Gerät konfiguriert werden kann müssen Sie es zuerst vom System erkennen lassen. Dazu müssen Sie mindestens einen 2.6.xxx Kernel verwenden. Sie können entweder: - Einen Netboot Kernel verwenden: http://hilfe.ovh.de/KernelNetboot - Oder den Kernel auf Ihrem Server installieren: http://hilfe.ovh.de/KernelInstall Nach dem Neustart können Sie dann mit folgendem Befehl überprüfen, ob Ihr USB Gerät erkannt wird: # sfdisk -l Disk /dev/hda: 4865 cylinders, 255 heads, 63 sectors/track Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0 Device Boot Start End #cyls #blocks Id System /dev/hda1 * 0+ 381 382- 3068383+ 83 Linux /dev/hda2 382 4799 4418 35487585 83 Linux /dev/hda3 4800 4864 65 522112+ 82 Linux swap / Solaris /dev/hda4 0 - 0 0 0 Empty Disk /dev/sda: 1023 cylinders, 254 heads, 62 sectors/track Units = cylinders of 8062976 bytes, blocks of 1024 bytes, counting from 0 Device Boot Start End #cyls #blocks Id System /dev/sda1 0+ 1022 1023- 8055071 b FAT32 /dev/sda2 0 - 0 0 0 Empty /dev/sda3 0 - 0 0 0 Empty /dev/sda4 0 - 0 0 0 Empty Unser USB Gerät erscheint auf diesem Server als sda mit einer Partition sda1, je nach verbautem Festplattentyp kann es auch als sdb oder sdc aufgeführt sein. Wir sehen, dass die erste Partition nicht das ext3 Dateisystem verwendet, und werden dies korrigieren. Achtung, prüfen Sie genau, dass Sie das richtige Device Ihres USB Geräts angeben! # fdisk /dev/sda Command (m for help) : t Partition number (1-4): 1 Hex code (type L to list codes) : 83 Changed system file of partition 1 to 83 (Linux) Command (m for help) : p Disk /dev/sdc: 901 MB, 901242368 bytes 28 heads, 62 sectors/track, 1013 cylinders Units = cylinders of 1736 * 512 = 888832 bytes Device Boot Start End Blocks Id System /dev/sda1 1 1023 8055071 83 Linux Command (m for help) : w The partition table has been altered! Call ioctl() to re-read partition table. Syncing disks Wir überprüfen dies nochmal: # sfdisk -l Disk /dev/hda: 4865 cylinders, 255 heads, 63 sectors/track Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0 Device Boot Start End #cyls #blocks Id System /dev/hda1 * 0+ 381 382- 3068383+ 83 Linux /dev/hda2 382 4799 4418 35487585 83 Linux /dev/hda3 4800 4864 65 522112+ 82 Linux swap / Solaris /dev/hda4 0 - 0 0 0 Empty Disk /dev/sda: 1023 cylinders, 254 heads, 62 sectors/track Units = cylinders of 8062976 bytes, blocks of 1024 bytes, counting from 0 Device Boot Start End #cyls #blocks Id System /dev/sda1 0+ 1022 1023- 8055071 83 Linux /dev/sda2 0 - 0 0 0 Empty /dev/sda3 0 - 0 0 0 Empty /dev/sda4 0 - 0 0 0 Empty Wir werden nun das USB Gerät formatieren: #mkfs.ext3 /dev/sda1 mke2fs 1.40.4 (31-Dec-2007) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) 979200 inodes, 1957904 blocks 97895 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=2009071616 60 block groups 32768 blocks per group, 32768 fragments per group 16320 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632 Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 25 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override. Nun richten wir es noch so ein, dass wenn ein zweites USB Gerät hinzugefügt wird und/oder die USB Anschlüsse vertauscht werden weiterhin alles funktioniert. #tune2fs -L usb1 /dev/sda1 tune2fs 1.40.4 (31-Dec-2007 Wir erstellen nun einen Eintrag für das USB Gerät: # mkdir /mnt/usb und mounten dieses nun: Dazu editieren wir die Datei /etc/fstab per SSH und fügen folgende Zeile hinzu: LABEL=usb1 /mnt/usb ext3 defaults 0 2 # mount /mnt/usb Und prüfen nochmal, dass das USB Gerät korrekt gemountet wurde: # df Filesystem 1K-blocs Used Available Use% Mounted on /dev/hda1 3020140 1996788 869936 70% / tmpfs 255900 0 255900 0% /lib/init/rw udev 10240 44 10196 1% /dev tmpfs 255900 0 255900 0% /dev/shm /dev/sda1 7928516 148908 7376856 2% /usb /dev/hda2 34930216 32836 33123004 1% /home |