Die Partition der /boot Festplatte wird häufig relativ klein gemacht, häufig auch etwas "zu"-klein, denn neuere Linux Distributionen brauchen für die Kernel-History gerne mal über 200MB.
Doch was tun, wenn die /boot Partition zu klein wird? – Neue erstellen und das boot Laufwerk verschieben!
Hier wird beschrieben wies geht.
Wir gehen her davon aus, dass:
/dev/sda1 die alte und
/dev/sdb1 die neue Platte/Partition ist.
Die neue boot Partition sollte ausserdem bereits mit fdisk/cfdisk formatiert und mit dem "bootable" flag markiert sein.
Zur Sicherheit ändern wir erst nur das label der alten boot Platte (/boot wird in fstab meist nach label gemountet) und passen den fstab Eintrag ggf. an.
Erst wenn die neue Partition in Betrieb ist, kann die alte gelöscht werden:
tune2fs -L/oldboot /dev/sda1
# ggf. Eintrag in /etc/fstab anpassen |
tune2fs -L/oldboot /dev/sda1
# ggf. Eintrag in /etc/fstab anpassen
Nun erstellen wir das filesystem der neuen Partition:
mke2fs -j -L /boot /dev/sdb1 |
mke2fs -j -L /boot /dev/sdb1
Als nächstes werden die beiden Partition gemountet und synchronisiert:
umount /boot
mkdir -pv /mnt/{sda1,sdb1}
mount /dev/sda1 /mnt/sda1
mount /dev/sdb1 /mnt/sdb1
rsync -ahv --numeric-ids --delete /mnt/sda1/ /mnt/sdb1/ |
umount /boot
mkdir -pv /mnt/{sda1,sdb1}
mount /dev/sda1 /mnt/sda1
mount /dev/sdb1 /mnt/sdb1
rsync -ahv --numeric-ids --delete /mnt/sda1/ /mnt/sdb1/
Zum Schluss muss man noch mittels grub den boot Sektor auf die neue Disk schreiben:
grub
grub> device (hd1) /dev/sdb
device (hd1) /dev/sdb
grub> root (hd1,0)
root (hd1,0)
Filesystem type is ext2fs, partition type 0x83
grub> setup (hd1)
setup (hd1)
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... yes
Checking if "/grub/stage2" exists... yes
Checking if "/grub/e2fs_stage1_5" exists... yes
Running "embed /grub/e2fs_stage1_5 (hd1)"... 15 sectors are embedded.
succeeded
Running "install /grub/stage1 (hd1) (hd1)1+15 p (hd1,0)/grub/stage2 /grub/grub.conf"... succeeded
Done.
grub> quit |
grub
grub> device (hd1) /dev/sdb
device (hd1) /dev/sdb
grub> root (hd1,0)
root (hd1,0)
Filesystem type is ext2fs, partition type 0x83
grub> setup (hd1)
setup (hd1)
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... yes
Checking if "/grub/stage2" exists... yes
Checking if "/grub/e2fs_stage1_5" exists... yes
Running "embed /grub/e2fs_stage1_5 (hd1)"... 15 sectors are embedded.
succeeded
Running "install /grub/stage1 (hd1) (hd1)1+15 p (hd1,0)/grub/stage2 /grub/grub.conf"... succeeded
Done.
grub> quit
Nach einem Reboot sollte die neue boot Partition aktiv sein!
Ressourcen