← Alle Beiträge
Linux 2014-12-10 14:46 Author: Stefan 2 Min. read

Skript zum anpassen der root PartitionScript for resize root partition

Hallo, hier ein kleine Skript um die root Partition zu vergößern

[Shell] #!/bin/bash

fdiskfirst() { p2start=fdisk -l /dev/mmcblk0 | grep mmcblk0p2 | awk '{print $2}' echo "Found the start point of mmcblk0p2: $p2start" fdisk /dev/mmcblk0 > /dev/null d 2 n p 2 $p2start

p w EOF

sync touch /root/.resize echo "Ok, Partition resized, please reboot now" echo "Once the reboot is completed please run this script again" }

resize_fs() { echo "Activating the new size" resize2fs /dev/mmcblk0p2 >> /dev/null echo "Done!" echo "Enjoy your new space!" rm -rf /root/.resize }

if [ -f /root/.resize ]; then resizefs else fdiskfirst fi [/shell]

Die Datei liegt dann als /root/resize.sh vor chmod +x /root/resize.sh ausführen mit ./root/resize.sh anschließend System neu starten und das Skript ein zweites mal ausführenhi there, here a little script for resize the root partition on the bpi or like somthing else

` cat /dev/null d 2 n p 2 $p2_start

p w EOF

sync touch /root/.resize echo "Ok, Partition resized, please reboot now" echo "Once the reboot is completed please run this script again" }

resize_fs() { echo "Activating the new size" resize2fs /dev/mmcblk0p2 >> /dev/null echo "Done!" echo "Enjoy your new space!" rm -rf /root/.resize }

if [ -f /root/.resize ]; then resizefs else fdiskfirst fi EOT `

you can find the file here /root/resize.sh then chmod +x /root/resize.sh run it once with ./root/resize.sh reboot your system and run the script again

Comments (0)

Moderated & spam-checked

No approved comments yet. Feel free to write the first comment!

Write a comment

Note: Your comment will be checked for authenticity before publication and approved by a moderator.