遇到問題:
root@b10000ea1f5b:/app/backend# ollama run phi3:14b
pulling manifest
pulling 7a3cc4804c64... 98% ▕███████████████████████████████████████ ▏ 7.8 GB/7.9 GB
Error: write /root/.ollama/models/blobs/sha256-7a3cc4804c645959a6734971b87607bc7eb2a2ed3e3adf3ad221f12b79dadff8-partial: no space left on device
空間不夠?檢查一下
Run:
df -h
Result:
Filesystem Size Used Avail Use% Mounted on
tmpfs 6.3G 1.3M 6.3G 1% /run
efivarfs 256K 63K 189K 25% /sys/firmware/efi/efivars
/dev/mapper/ubuntu--vg-ubuntu--lv 98G 98G 5.6T 100% /
tmpfs 32G 0 32G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
/dev/sda2 2.0G 118M 1.7G 7% /boot
/dev/sda1 1.1G 6.2M 1.1G 1% /boot/efi
tmpfs 6.3G 24K 6.3G 1% /run/user/1000
空間都沒啦~
那就看看能不能變大了
Run:
sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
Result:看起來很大夠用
NAME FSTYPE SIZE MOUNTPOINT LABEL
loop0 74.2M /snap/core22/1380
loop1 38.8M /snap/snapd/21759
sda 6T
├─sda1 vfat 1G /boot/efi
├─sda2 ext4 2G /boot
└─sda3 LVM2_member 6T
└─ubuntu--vg-ubuntu--lv ext4 100G /
sr0 1024M
Run:
(無工具時安裝) sudo apt install lvm2
sudo lvextend -l 100%VG ubuntu-vg/ubuntu-lv
Result:
Size of logical volume ubuntu-vg/ubuntu-lv changed from 100.00 GiB (25600 extents) to <6.00 TiB (1572082 extents).
Logical volume ubuntu-vg/ubuntu-lv successfully resized.
Run:
sudo fdisk -l /dev/mapper/ubuntu--vg-ubuntu--lv
Result:
Disk /dev/mapper/ubuntu--vg-ubuntu--lv: 6 TiB, 6593789820928 bytes, 12878495744 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
Run:
sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv
Result:
resize2fs 1.47.0 (5-Feb-2023)
Filesystem at /dev/mapper/ubuntu--vg-ubuntu--lv is mounted on /; on-line resizing required
old_desc_blocks = 13, new_desc_blocks = 768
The filesystem on /dev/mapper/ubuntu--vg-ubuntu--lv is now 1609811968 (4k) blocks long.
Run:
df -h
Result:
Filesystem Size Used Avail Use% Mounted on
tmpfs 6.3G 1.3M 6.3G 1% /run
efivarfs 256K 63K 189K 25% /sys/firmware/efi/efivars
/dev/mapper/ubuntu--vg-ubuntu--lv 6.0T 98G 5.6T 2% /
tmpfs 32G 0 32G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
/dev/sda2 2.0G 118M 1.7G 7% /boot
/dev/sda1 1.1G 6.2M 1.1G 1% /boot/efi
tmpfs 6.3G 24K 6.3G 1% /run/user/1000
成功變大啦~
原本錯誤:
root@b10000ea1f5b:/app/backend# ollama run phi3:14b
pulling manifest
pulling 7a3cc4804c64... 98% ▕███████████████████████████████████████ ▏ 7.8 GB/7.9 GB
Error: write /root/.ollama/models/blobs/sha256-7a3cc4804c645959a6734971b87607bc7eb2a2ed3e3adf3ad221f12b79dadff8-partial: no space left on device
重跑一遍,成功嚕:
root@b10000ea1f5b:/app/backend# ollama run phi3:14b
pulling manifest
pulling 7a3cc4804c64... 100% ▕████████████████████████████████████████▏ 7.9 GB
pulling fa8235e5b48f... 100% ▕████████████████████████████████████████▏ 1.1 KB
pulling 542b217f179c... 100% ▕████████████████████████████████████████▏ 148 B
pulling 8dde1baf1db0... 100% ▕████████████████████████████████████████▏ 78 B
pulling c266f81b82cd... 100% ▕████████████████████████████████████████▏ 483 B
verifying sha256 digest
writing manifest
removing any unused layers
success
>>> Send a message (/? for help)