Keresés

Új hozzászólás Aktív témák

  • Ejelhar

    senior tag

    válasz Csicsóka #36464 üzenetére

    Szia,
    megcsináltam a módosítást, ki is próbáltam egy friss rc4.1 telepítéssel, 8 GB-s penről bootolva.
    A telepítő image ext4 partíciójába beleraktam az /sbin alá a parted és partprobe binárisokat, ezek az osmc rc3.3-ból származnak (ott feltelepítettem a parted csomagot).
    Valamint az /usr/local/bin/fs-resize file-t lecseréltem a módosítottra. Eredmény:
    osmc ~ # parted /dev/sda print
    Model: SanDisk Cruzer Switch (scsi)
    Disk /dev/sda: 7849MB
    Sector size (logical/physical): 512B/512B
    Partition Table: msdos
    Disk Flags:

    Number Start End Size Type File system Flags
    1 4194kB 273MB 268MB primary fat16 boot, lba
    2 273MB 1850MB 1577MB primary ext4

    osmc ~ # fs-resize
    Found the start point of /dev/sda2:
    Warning: Partition /dev/sda2 is being used. Are you sure you want to continue?
    Information: You may need to update /etc/fstab.

    Ok, Partition resized.
    Model: SanDisk Cruzer Switch (scsi)
    Disk /dev/sda: 7849MB
    Sector size (logical/physical): 512B/512B
    Partition Table: msdos
    Disk Flags:

    Number Start End Size Type File system Flags
    1 4194kB 273MB 268MB primary fat16 boot, lba
    2 273MB 7849MB 7576MB primary ext4
    Activating the new size
    resize2fs 1.43.4 (31-Jan-2017)
    Done!
    Start OSMC. Enjoy your new space!
    init: required argument missing.
    osmc ~ # df -h
    Fájlrendszer Méret Fogl. Szab. Fo.% Csatol. pont
    devtmpfs 783M 0 783M 0% /dev
    tmpfs 895M 19M 877M 3% /run
    /dev/sda2 6,9G 792M 6,1G 12% /
    tmpfs 895M 0 895M 0% /dev/shm
    tmpfs 5,0M 0 5,0M 0% /run/lock
    tmpfs 895M 0 895M 0% /sys/fs/cgroup
    /dev/mmcblk1p1 15G 2,7G 12G 19% /media/Sandisk_SD16G
    tmpfs 179M 0 179M 0% /run/user/1000
    osmc ~ #

    A módosított script, amit kivettem azok a sorok a könnyebb azonosíthatóság miatt ## -- ## kezdődnek.
    #!/bin/sh

    fdisk_first() {
    PART=$(grep "/" /proc/mounts | cut -d" " -f1 | grep '2$')

    case $PART in
    "/dev/mmcblk"*)
    DISK=$(echo $PART | sed s/p2$//g)
    ;;
    *)
    DISK=$(echo $PART | sed s/2$//g)
    ;;
    esac

    ## -- ## p2_start=`fdisk -l $DISK | grep $PART | awk '{print $2}'`
    echo "Found the start point of $PART: $p2_start"
    ## -- ## fdisk $DISK << __EOF__ >> /dev/null
    ## -- ## d
    ## -- ## 2
    ## -- ## n
    ## -- ## p
    ## -- ## 2
    ## -- ## $p2_start
    ## -- ##
    ## -- ## p
    ## -- ## w
    ## -- ## __EOF__
    /sbin/parted $DISK resizepart 2 Yes 100%
    sync
    touch /.resize
    echo "Ok, Partition resized."
    /sbin/parted $DISK print
    echo
    echo ""
    sleep 5
    ## -- ## reboot -f
    }

    resize_fs() {
    mount -t proc proc /proc >/dev/null 2>&1
    /usr/bin/clear
    PART=$(grep "/" /proc/mounts | cut -d" " -f1 | grep '2$')
    echo "Activating the new size"
    resize2fs $PART >> /dev/null
    echo "Done!"
    echo "Start OSMC. Enjoy your new space!"
    sleep 5
    rm -f /.resize
    mkdir -p /tmp/mnt
    mount -L OSMC /tmp/mnt
    rm -f /tmp/mnt/resize
    umount /tmp/mnt
    exec /sbin/init $*
    }


    if [ -f /.resize ]; then
    resize_fs
    else
    fdisk_first
    resize_fs
    fi

Új hozzászólás Aktív témák