Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No space left on device #6

Open
qcbit opened this issue Feb 4, 2021 · 2 comments · May be fixed by #7
Open

No space left on device #6

qcbit opened this issue Feb 4, 2021 · 2 comments · May be fixed by #7

Comments

@qcbit
Copy link

qcbit commented Feb 4, 2021

./resize-img C uc8220V1.3-2.2-3.10-blender-twin.img

[resize-img] Mounting original image
[resize-img] Calculating original image's partitions size
[resize-img] Creating new image
[create-img] Extract information from options
[create-img] Generating image file
[create-img] Creating partitions
[create-img] Formating partitions
[create-img] OK
[resize-img] Mounting new image
[resize-img] Copying files
cp: error writing '/tmp/resized_mnt/p2/var/lib/systemd/deb-systemd-helper-enabled/ssh.service.dsh-also': No space left on device
cp: error writing '/tmp/resized_mnt/p2/var/lib/systemd/deb-systemd-helper-enabled/ssh.socket.dsh-also': No space left on device
cp: error writing '/tmp/resized_mnt/p2/var/lib/systemd/deb-systemd-helper-enabled/moxa-module-control.service.dsh-also': No space left on device
cp: error writing '/tmp/resized_mnt/p2/var/lib/systemd/deb-systemd-helper-enabled/apt-daily-upgrade.timer.dsh-also': No space left on device
cp: error writing '/tmp/resized_mnt/p2/var/lib/systemd/deb-systemd-helper-enabled/apt-daily.timer.dsh-also': No space left on device
cp: error writing '/tmp/resized_mnt/p2/var/lib/systemd/deb-systemd-helper-enabled/rsyslog.service.dsh-also': No space left on device
cp: error writing '/tmp/resized_mnt/p2/var/lib/systemd/deb-systemd-helper-enabled/networking.service.dsh-also': No space left on device
cp: cannot create directory '/tmp/resized_mnt/p2/var/lib/systemd/deb-systemd-helper-enabled/network-online.target.wants': No space left on device
cp: cannot create directory '/tmp/resized_mnt/p2/var/lib/systemd/deb-systemd-helper-enabled/timers.target.wants': No space left on device
cp: cannot create directory '/tmp/resized_mnt/p2/var/lib/systemd/deb-systemd-helper-enabled/multi-user.target.wants': No space left on device
cp: error writing '/tmp/resized_mnt/p2/var/lib/systemd/deb-systemd-helper-enabled/cron.service.dsh-also': No space left on device
cp: cannot create directory '/tmp/resized_mnt/p2/var/lib/systemd/deb-systemd-helper-enabled/poweroff.target.wants': No space left on device
cp: cannot create directory '/tmp/resized_mnt/p2/var/lib/systemd/catalog': No space left on device
cp: error writing '/tmp/resized_mnt/p2/var/lib/systemd/random-seed': No space left on device
cp: cannot create directory '/tmp/resized_mnt/p2/var/lib/apache2': No space left on device
cp: cannot create directory '/tmp/resized_mnt/p2/var/lib/ntp': No space left on device
cp: cannot create directory '/tmp/resized_mnt/p2/var/lib/dbus': No space left on device
cp: cannot create directory '/tmp/resized_mnt/p2/var/lib/ucf': No space left on device
cp: cannot create directory '/tmp/resized_mnt/p2/var/lib/snmp': No space left on device
cp: cannot create directory '/tmp/resized_mnt/p2/var/lib/tpm': No space left on device
cp: cannot create directory '/tmp/resized_mnt/p2/var/lib/sudo': No space left on device
cp: cannot create directory '/tmp/resized_mnt/p2/var/www': No space left on device
root@nov-Yoga-6-13ARE05:/home/nov/Downloads/resize-image-develop# df
Filesystem 1K-blocks Used Available Use% Mounted on
udev 3720580 0 3720580 0% /dev
tmpfs 756496 2068 754428 1% /run
/dev/nvme0n1p2 244568380 16563924 215511400 8% /
tmpfs 3782480 46048 3736432 2% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 3782480 0 3782480 0% /sys/fs/cgroup
/dev/loop0 56320 56320 0 100% /snap/core18/1880
/dev/loop1 30720 30720 0 100% /snap/snapd/8542
/dev/loop2 261760 261760 0 100% /snap/gnome-3-34-1804/36
/dev/loop3 51072 51072 0 100% /snap/snap-store/467
/dev/loop4 63616 63616 0 100% /snap/gtk-common-themes/1506
/dev/nvme0n1p1 523248 7988 515260 2% /boot/efi
tmpfs 756496 92 756404 1% /run/user/1000
/dev/loop5 31872 31872 0 100% /snap/snapd/10707
/dev/loop6 56832 56832 0 100% /snap/core18/1944
/dev/loop7 52352 52352 0 100% /snap/snap-store/518
/dev/loop8 66432 66432 0 100% /snap/gtk-common-themes/1514
/dev/loop9 224256 224256 0 100% /snap/gnome-3-34-1804/66
/dev/loop10 23537 6942 14302 33% /tmp/original_mnt/p1
/dev/loop11 380533 302723 53644 85% /tmp/original_mnt/p2
/dev/loop12 6773528 1259051 5229975 20% /tmp/original_mnt/p3
/dev/loop13 23536 6200 15048 30% /tmp/resized_mnt/p1
/dev/loop14 340948 333740 0 100% /tmp/resized_mnt/p2
/dev/loop15 1506688 4512 1408840 1% /tmp/resized_mnt/p3

@codegraft
Copy link

I just ran into the same issue with an uc-3100 image.
Comparing the created filesystem with the source image using dumpe2fs shows different block sizes:

/tmp/original_mnt/p2
Block size: 1024

/tmp/resized_mnt/p2
Block size: 4096

Modifying create-img to specify a blocksize of 1024 for the mkfs command for the ext4 partitions fixes the issue for me:
mkfs -t ${fs_type} -b 1024 -J size=8 ${loopdev} >/dev/null 2>&1

Not sure if 1024 is an appropriate value for all different image types / systems so I'm not creating a pull request. Proper solution is more likely to query the parameters of the source partition to get the value from there, but maybe this info helps someone with the same issue.

@TheFern2
Copy link

TheFern2 commented Apr 18, 2023

This issue is fixed on my fork, didn't feel like making a PR just yet because I made a few other scripts for cleanup on the same branch. I've tested on 8200 devices and it works great, still need test on 8112 families.

# Get block size GH issue #6
o_loop=$(lsblk | grep original_mnt/p${i} | awk '{print $1}')
blocksize=$(dumpe2fs /dev/$o_loop | grep 'Block size' | awk '{print $3;}')

# Perform formation for different fs_type
#   vfat: format
#   ext4: format with journal
#   raw: do nothing
if [ "${fs_type}" == "ext4" ]; then
	mkfs -t ${fs_type} -b ${blocksize} -J size=8 ${loopdev} >/dev/null 2>&1
elif [ "${fs_type}" == "vfat" ]; then
	mkfs -t ${fs_type} ${loopdev} >/dev/null
fi

TheFern2@038346b

@TheFern2 TheFern2 linked a pull request Sep 20, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants