Findet Grub immer die Startpartition?

Folgende Situation:
GParted zeigt mir meine Festplatte wie folgt:
Leere Partition (230GB)> SWAP Partition > / ext4 Partition (230GB).
Möchte die ext4 Partition nach vorne Schieben.
Weiss Grub anschliessend wo es booten muss?
Wenn nicht, mit welchem Befehl weise ich Grub an sich neu zu sortieren?

bevor Sie etwas Dummes tun:
formart GPT- oder MBR-Partition?

lsblk -f und/oder sudo fdisk -l
Herr @Rallebiker :wink:

Hallo,
was meinen Sie damit?
Ich kann da nichts mit anfangen, wo kann ich das sehen?

lsblk -f
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
sda
├─sda3
│ swap 1 5a258017-a95d-4d7a-a5b2-8ad81b4e6541 [SWAP]
└─sda4
ext4 1.0 35e24fc1-3938-4b43-a80b-6939ee92fdfa 166,6G 12% /
sr0

peux-t-on avoir le retour

sudo parted -l
sudo fdisk -l
sudo parted -l
Modell: ATA KINGSTON SA400S3 (scsi)
Festplatte  /dev/sda:  480GB
Sektorgröße (logisch/physisch): 512B/512B
Partitionstabelle: msdos
Disk-Flags: 

Nummer  Anfang  Ende   Größe   Typ      Dateisystem     Flags
 3      258GB   260GB  2097MB  primary  linux-swap(v1)
 4      260GB   480GB  220GB   primary  ext4            boot
sudo fdisk -l
Festplatte /dev/ram0: 64 MiB, 67108864 Bytes, 131072 Sektoren
Einheiten: Sektoren von 1 * 512 = 512 Bytes
Sektorgröße (logisch/physikalisch): 512 Bytes / 4096 Bytes
E/A-Größe (minimal/optimal): 4096 Bytes / 4096 Bytes


Festplatte /dev/ram1: 64 MiB, 67108864 Bytes, 131072 Sektoren
Einheiten: Sektoren von 1 * 512 = 512 Bytes
Sektorgröße (logisch/physikalisch): 512 Bytes / 4096 Bytes
E/A-Größe (minimal/optimal): 4096 Bytes / 4096 Bytes


Festplatte /dev/ram2: 64 MiB, 67108864 Bytes, 131072 Sektoren
Einheiten: Sektoren von 1 * 512 = 512 Bytes
Sektorgröße (logisch/physikalisch): 512 Bytes / 4096 Bytes
E/A-Größe (minimal/optimal): 4096 Bytes / 4096 Bytes


Festplatte /dev/ram3: 64 MiB, 67108864 Bytes, 131072 Sektoren
Einheiten: Sektoren von 1 * 512 = 512 Bytes
Sektorgröße (logisch/physikalisch): 512 Bytes / 4096 Bytes
E/A-Größe (minimal/optimal): 4096 Bytes / 4096 Bytes


Festplatte /dev/ram4: 64 MiB, 67108864 Bytes, 131072 Sektoren
Einheiten: Sektoren von 1 * 512 = 512 Bytes
Sektorgröße (logisch/physikalisch): 512 Bytes / 4096 Bytes
E/A-Größe (minimal/optimal): 4096 Bytes / 4096 Bytes


Festplatte /dev/ram5: 64 MiB, 67108864 Bytes, 131072 Sektoren
Einheiten: Sektoren von 1 * 512 = 512 Bytes
Sektorgröße (logisch/physikalisch): 512 Bytes / 4096 Bytes
E/A-Größe (minimal/optimal): 4096 Bytes / 4096 Bytes


Festplatte /dev/ram6: 64 MiB, 67108864 Bytes, 131072 Sektoren
Einheiten: Sektoren von 1 * 512 = 512 Bytes
Sektorgröße (logisch/physikalisch): 512 Bytes / 4096 Bytes
E/A-Größe (minimal/optimal): 4096 Bytes / 4096 Bytes


Festplatte /dev/ram7: 64 MiB, 67108864 Bytes, 131072 Sektoren
Einheiten: Sektoren von 1 * 512 = 512 Bytes
Sektorgröße (logisch/physikalisch): 512 Bytes / 4096 Bytes
E/A-Größe (minimal/optimal): 4096 Bytes / 4096 Bytes


Festplatte /dev/ram8: 64 MiB, 67108864 Bytes, 131072 Sektoren
Einheiten: Sektoren von 1 * 512 = 512 Bytes
Sektorgröße (logisch/physikalisch): 512 Bytes / 4096 Bytes
E/A-Größe (minimal/optimal): 4096 Bytes / 4096 Bytes


Festplatte /dev/ram9: 64 MiB, 67108864 Bytes, 131072 Sektoren
Einheiten: Sektoren von 1 * 512 = 512 Bytes
Sektorgröße (logisch/physikalisch): 512 Bytes / 4096 Bytes
E/A-Größe (minimal/optimal): 4096 Bytes / 4096 Bytes


Festplatte /dev/ram10: 64 MiB, 67108864 Bytes, 131072 Sektoren
Einheiten: Sektoren von 1 * 512 = 512 Bytes
Sektorgröße (logisch/physikalisch): 512 Bytes / 4096 Bytes
E/A-Größe (minimal/optimal): 4096 Bytes / 4096 Bytes


Festplatte /dev/ram11: 64 MiB, 67108864 Bytes, 131072 Sektoren
Einheiten: Sektoren von 1 * 512 = 512 Bytes
Sektorgröße (logisch/physikalisch): 512 Bytes / 4096 Bytes
E/A-Größe (minimal/optimal): 4096 Bytes / 4096 Bytes


Festplatte /dev/ram12: 64 MiB, 67108864 Bytes, 131072 Sektoren
Einheiten: Sektoren von 1 * 512 = 512 Bytes
Sektorgröße (logisch/physikalisch): 512 Bytes / 4096 Bytes
E/A-Größe (minimal/optimal): 4096 Bytes / 4096 Bytes


Festplatte /dev/ram13: 64 MiB, 67108864 Bytes, 131072 Sektoren
Einheiten: Sektoren von 1 * 512 = 512 Bytes
Sektorgröße (logisch/physikalisch): 512 Bytes / 4096 Bytes
E/A-Größe (minimal/optimal): 4096 Bytes / 4096 Bytes


Festplatte /dev/ram14: 64 MiB, 67108864 Bytes, 131072 Sektoren
Einheiten: Sektoren von 1 * 512 = 512 Bytes
Sektorgröße (logisch/physikalisch): 512 Bytes / 4096 Bytes
E/A-Größe (minimal/optimal): 4096 Bytes / 4096 Bytes


Festplatte /dev/ram15: 64 MiB, 67108864 Bytes, 131072 Sektoren
Einheiten: Sektoren von 1 * 512 = 512 Bytes
Sektorgröße (logisch/physikalisch): 512 Bytes / 4096 Bytes
E/A-Größe (minimal/optimal): 4096 Bytes / 4096 Bytes


Festplatte /dev/sda: 447,13 GiB, 480103981056 Bytes, 937703088 Sektoren
Festplattenmodell: KINGSTON SA400S3
Einheiten: Sektoren von 1 * 512 = 512 Bytes
Sektorgröße (logisch/physikalisch): 512 Bytes / 512 Bytes
E/A-Größe (minimal/optimal): 512 Bytes / 512 Bytes
Festplattenbezeichnungstyp: dos
Festplattenbezeichner: 0xbd7db947

Gerät      Boot    Anfang      Ende  Sektoren  Größe Kn Typ
/dev/sda3       503042048 507138047   4096000     2G  2 XENIX root
/dev/sda4  *    507138048 937701375 430563328 205,3G 83 Linux

es ist ein Bios-Format , MBR maximal 4 physische Partitionen
Dies führt im schlimmsten Fall dazu, dass die gesamte Partition verschoben wird und die Möglichkeit besteht, dass die UID der Partition geändert wird.

Es besteht auch das Risiko einer erneuten Grub-Installation, wenn der Startpunkt nicht gefunden wird.

Sind das die beiden Befehle die einsetzbar sind:
sudo grub-setup /dev/sda
bzw.
sudo grub-install /dev/sda

Nein :wink:

Diese:

sudo grub-install /dev/sdX
sudo grub-mkconfig -o /boot/grub/grub.cfg

wobei fpr grub-install optionen nötig sein können… aber auf MBR Bios ist das nicht wirklich der Fall.

Festplatte /dev/sda: 447,13 GiB, 480103981056 Bytes, 937703088 Sektoren
Festplattenmodell: KINGSTON SA400S3
Einheiten: Sektoren von 1 * 512 = 512 Bytes
Sektorgröße (logisch/physikalisch): 512 Bytes / 512 Bytes
E/A-Größe (minimal/optimal): 512 Bytes / 512 Bytes
Festplattenbezeichnungstyp: dos
Festplattenbezeichner: 0xbd7db947

Gerät      Boot    Anfang      Ende  Sektoren  Größe Kn Typ
/dev/sda3       503042048 507138047   4096000     2G  2 XENIX root
/dev/sda4  *    507138048 937701375 430563328 205,3G 83 Linux

da fehlt ja aber eine ganze Menge and Sektoren die nicht zugeordnet sein müssten… und auch das es nicht sda1 und sda2 sondern sda3/4 sind …

ah da :wink:

Vorher

|__________________|     |___|    |_____________________|
leer                      swap     ext4 system partition

Nachher

|_______________________________________| |___|
ext4 system partition                      swap

Ist im Grunde genommen kein Problem das nach vorne zu verschieben… würde die swap Partition aber einfach auch löschen und dann neu erstellen… aber du wirst deine fstab anpassen müssen und grub neu in swn MBR schreiben müssen (danach) dazu wirst du in das system chrooten müssen nachdem alles verschoben und neu erstellt ist…

Was heisst:
Generating grub configurations file …
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
grub-probe: errror: cannot find a GRUB drive /dev/sdb1.
Check your device map.

sdb1 ist mein USB Stick. (?)

das ist wie zu sehen die Ausgabe von einer unter prozedur die von grub genutzt wird grub-probe.. und ja dein USB stick hat kein grub-drive :wink: und lvm hast du wohl auch nicht.
Helfen würde der komplette output dann könnte ich erkennen ob etwas nicht richtig ist…

wenn du die partitiononen verschoben hast kann es sein das du die UUIDS in deiner /etc/fstab ändern musst – eventuell auch in der /etc/default/grub wenn du “resume” für die swap akiviert hast…

im arch-chroot auf deinem installierten system…

ls -l /dev/disk/by-uuid/

Zeigt dir alle uuids…

1 Like

Ok danke.
Mittels Ubuntu-Live-Iso und der genau beschriebenen Vorgehensweise in der dortigen Wiki, war es relativ einfach Grub neu zu installieren.
Gruss
Rallebiker

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.