GNU/Linux >> Linux Esercitazione >  >> Linux

Smontare un arrangiamento Raid 1 senza rimuovere/reinstallare il sistema?

Ho impostato un Soft Raid 1 utilizzando Debian integrati nei sistemi RAID. Ho impostato il raid perché avevo un HDD spaziale quando ho impostato il server e ho pensato perché no. Il RAID è configurato usando quello che Debian ha mai fatto quando ho installato il sistema operativo (scusate, non un tecnico Linux).

Ora, comunque, potrei davvero usare il disco per uno scopo molto più utile.

È facile interrompere il raid senza dover reinstallare il sistema operativo e come potrei farlo?

fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x000d9640

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048   976771071   488384512   fd  Linux raid autodetect

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x0009dd99

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048   950560767   475279360   83  Linux
/dev/sdb2       950562814   976771071    13104129    5  Extended
Partition 2 does not start on physical sector boundary.
/dev/sdb5       950562816   976771071    13104128   82  Linux swap / Solaris

Disk /dev/sdc: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x6fa10d6b

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1              63  3907024064  1953512001    7  HPFS/NTFS/exFAT

Disk /dev/sdd: 7803 MB, 7803174912 bytes
122 heads, 58 sectors/track, 2153 cylinders, total 15240576 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xc3072e18

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1   *        8064    15240575     7616256    b  W95 FAT32

fstab contenuto:

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sdb1 during installation
UUID=cbc19adf-8ed0-4d20-a56e-13c1a74e9cf0 /               ext4    errors=remount-ro 0       1
# swap was on /dev/sdb5 during installation
UUID=f6836768-e2b6-4ccf-9827-99f58999607e none            swap    sw              0       0
/dev/sda1       /media/usb0     auto    rw,user,noauto  0       0
/dev/sdc1       /media/mns       ntfs-3g defaults        0       2

Risposta accettata:

Il metodo più semplice, che non richiede alcuna modifica alla configurazione, è probabilmente ridurre il RAID a un singolo disco. Ciò ti lascia la possibilità di aggiungere un disco e quindi riutilizzare il RAID in un secondo momento.

mdadm /dev/mdx --fail /dev/disky1
mdadm /dev/mdx --remove /dev/disky1
mdadm --grow /dev/mdx --raid-devices=1 --force

Il risultato sarebbe simile a questo:

mdx : active raid1 diskx1[3]
      62519296 blocks super 1.2 [1/1] [U]

Ta-daa un singolo disco "RAID1".

Correlati:rendere tutti i nuovi file in una directory accessibili a un gruppo?

Se vuoi eliminare del tutto il livello RAID, ciò comporterebbe mdadm --examine /dev/diskx1 (per scoprire l'offset dei dati), mdadm --zero-superblock (per eliminare i metadati RAID) e parted per spostare la partizione in base all'offset dei dati in modo che punti al filesystem, quindi aggiornare il bootloader e le configurazioni di sistema per riflettere l'assenza di RAID...


Linux
  1. Come riparare il sistema operativo Ubuntu rotto senza reinstallarlo

  2. Output dell'"ultimo" comando?

  3. Le partizioni del dispositivo loop non vengono visualizzate?

  4. Trovare la dimensione del settore di una partizione?

  5. Come rimuovere X byte dalla fine di un file di grandi dimensioni senza leggere l'intero file?

Introduzione al file system Linux

Come eseguire a secco o simulare i comandi Linux senza modificare nulla nel sistema

Come riparare il sistema operativo Ubuntu rotto senza reinstallarlo

Come utilizzare il comando fd sul sistema Linux

Come riparare il sistema operativo Ubuntu rotto senza reinstallare il sistema

Dove è documentato l'ABI x86-64 System V?