ajouter_un_disque_dur_sur_un_vps
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédente | |||
| ajouter_un_disque_dur_sur_un_vps [2016/05/27 12:31] – simon | ajouter_un_disque_dur_sur_un_vps [Date inconnue] (Version actuelle) – supprimée - modification externe (Date inconnue) 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | ====== Ajouter un disque dur sur un VPS ====== | ||
| - | J'ai un VPS chez OVH sur lequel tourne mon instance [[https:// | ||
| - | |||
| - | <WRAP center round important 60%> | ||
| - | Petite remarque : Voici les étapes que j'ai suivies en y allant "pas à pas". Il y a moyen de faire plus court et d' | ||
| - | </ | ||
| - | |||
| - | |||
| - | C'est parti ! Une fois le disque commandé via l' | ||
| - | <code bash> | ||
| - | # fdisk -l | ||
| - | |||
| - | Disk /dev/vda: 10 GiB, 10737418240 bytes, 20971520 sectors | ||
| - | Units: sectors of 1 * 512 = 512 bytes | ||
| - | Sector size (logical/ | ||
| - | I/O size (minimum/ | ||
| - | Disklabel type: dos | ||
| - | Disk identifier: 0x00000000 | ||
| - | |||
| - | Device | ||
| - | / | ||
| - | |||
| - | Disk /dev/vdb: 50 GiB, 53687091200 bytes, 104857600 sectors | ||
| - | Units: sectors of 1 * 512 = 512 bytes | ||
| - | Sector size (logical/ | ||
| - | I/O size (minimum/ | ||
| - | </ | ||
| - | |||
| - | Il n'a pas encore de partition(s). On va en créer une avec '' | ||
| - | <code bash> | ||
| - | # fdisk /dev/vdb | ||
| - | |||
| - | Welcome to fdisk (util-linux 2.25.2). | ||
| - | Changes will remain in memory only, until you decide to write them. | ||
| - | Be careful before using the write command. | ||
| - | |||
| - | Device does not contain a recognized partition table. | ||
| - | Created a new DOS disklabel with disk identifier 0x78fc199b. | ||
| - | |||
| - | Command (m for help): n | ||
| - | Partition type | ||
| - | | ||
| - | | ||
| - | Select (default p): p | ||
| - | Partition number (1-4, default 1): 1 | ||
| - | First sector (2048-104857599, | ||
| - | Last sector, +sectors or +size{K, | ||
| - | |||
| - | Created a new partition 1 of type ' | ||
| - | |||
| - | Command (m for help): w | ||
| - | The partition table has been altered. | ||
| - | Calling ioctl() to re-read partition table. | ||
| - | Syncing disks. | ||
| - | </ | ||
| - | |||
| - | On peut voir la différence avec un '' | ||
| - | <code bash> | ||
| - | # fdisk -l | ||
| - | (...) | ||
| - | Disk /dev/vdb: 50 GiB, 53687091200 bytes, 104857600 sectors | ||
| - | Units: sectors of 1 * 512 = 512 bytes | ||
| - | Sector size (logical/ | ||
| - | I/O size (minimum/ | ||
| - | Disklabel type: dos | ||
| - | Disk identifier: 0x78fc199b | ||
| - | |||
| - | Device | ||
| - | / | ||
| - | </ | ||
| - | |||
| - | On formate la partition '' | ||
| - | <code bash> | ||
| - | # mkfs.ext4 /dev/vdb1 | ||
| - | mke2fs 1.42.12 (29-Aug-2014) | ||
| - | Creating filesystem with 13106944 4k blocks and 3276800 inodes | ||
| - | Filesystem UUID: 5e9d2a50-54bd-47ff-8d1e-873d32991c6c | ||
| - | Superblock backups stored on blocks: | ||
| - | 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, | ||
| - | 4096000, 7962624, 11239424 | ||
| - | |||
| - | Allocating group tables: done | ||
| - | Writing inode tables: done | ||
| - | Creating journal (32768 blocks): done | ||
| - | Writing superblocks and filesystem accounting information: | ||
| - | </ | ||
| - | |||
| - | On regarde l'UUID du nouveau disque avec la commande [[blkid]] : | ||
| - | <code bash> | ||
| - | # blkid | ||
| - | /dev/vda1: UUID=" | ||
| - | /dev/vdb1: UUID=" | ||
| - | </ | ||
| - | |||
| - | L'UUID du nouveau disque : " | ||
| - | <code bash> | ||
| - | # mkdir / | ||
| - | </ | ||
| - | |||
| - | On modifie maintenant le fichier ''/ | ||
| - | <code bash># vim /etc/fstab | ||
| - | proc /proc | ||
| - | / | ||
| - | UUID=" | ||
| - | </ | ||
| - | |||
| - | On vérifie : | ||
| - | <code bash> | ||
| - | # mount -a | ||
| - | # mount | ||
| - | sysfs on /sys type sysfs (rw, | ||
| - | proc on /proc type proc (rw, | ||
| - | udev on /dev type devtmpfs (rw, | ||
| - | devpts on /dev/pts type devpts (rw, | ||
| - | tmpfs on /run type tmpfs (rw, | ||
| - | /dev/vda1 on / type ext3 (rw, | ||
| - | securityfs on / | ||
| - | tmpfs on /dev/shm type tmpfs (rw, | ||
| - | tmpfs on /run/lock type tmpfs (rw, | ||
| - | tmpfs on / | ||
| - | cgroup on / | ||
| - | pstore on / | ||
| - | cgroup on / | ||
| - | cgroup on / | ||
| - | cgroup on / | ||
| - | cgroup on / | ||
| - | cgroup on / | ||
| - | cgroup on / | ||
| - | cgroup on / | ||
| - | systemd-1 on / | ||
| - | hugetlbfs on / | ||
| - | mqueue on /dev/mqueue type mqueue (rw, | ||
| - | debugfs on / | ||
| - | tmpfs on / | ||
| - | /dev/vdb1 on / | ||
| - | </ | ||
| - | |||
| - | Dans le dossier OwnCloud on a donc un dossier '' | ||
| - | <code bash> | ||
| - | # cp -r / | ||
| - | # cp / | ||
| - | </ | ||
| - | |||
| - | On applique les bons droits : | ||
| - | <code bash> | ||
| - | # chown www-data: | ||
| - | </ | ||
| - | |||
| - | On copie le dossier '' | ||
| - | <code bash> | ||
| - | # mv / | ||
| - | </ | ||
| - | |||
| - | On démonte la partition de 50Gio, on la déplace (en changeant le nom du dossier et le fichier '' | ||
| - | <code bash> | ||
| - | # umount / | ||
| - | # mv / | ||
| - | # vim /etc/fstab | ||
| - | proc /proc | ||
| - | / | ||
| - | UUID=" | ||
| - | </ | ||
| - | |||
| - | On teste : | ||
| - | <code bash> | ||
| - | # mount -a | ||
| - | # mount | ||
| - | sysfs on /sys type sysfs (rw, | ||
| - | proc on /proc type proc (rw, | ||
| - | udev on /dev type devtmpfs (rw, | ||
| - | devpts on /dev/pts type devpts (rw, | ||
| - | tmpfs on /run type tmpfs (rw, | ||
| - | /dev/vda1 on / type ext3 (rw, | ||
| - | securityfs on / | ||
| - | tmpfs on /dev/shm type tmpfs (rw, | ||
| - | tmpfs on /run/lock type tmpfs (rw, | ||
| - | tmpfs on / | ||
| - | cgroup on / | ||
| - | pstore on / | ||
| - | cgroup on / | ||
| - | cgroup on / | ||
| - | cgroup on / | ||
| - | cgroup on / | ||
| - | cgroup on / | ||
| - | cgroup on / | ||
| - | cgroup on / | ||
| - | systemd-1 on / | ||
| - | hugetlbfs on / | ||
| - | mqueue on /dev/mqueue type mqueue (rw, | ||
| - | debugfs on / | ||
| - | tmpfs on / | ||
| - | /dev/vdb1 on / | ||
| - | </ | ||
| - | |||
| - | Ça semble bon, mon instance d' | ||
| - | On nettoie : | ||
| - | <code bash> | ||
| - | # rm -r / | ||
| - | </ | ||
ajouter_un_disque_dur_sur_un_vps.1464352297.txt.gz · Dernière modification : (modification externe)
