-
Notifications
You must be signed in to change notification settings - Fork 14
Description
Hi there, this is my first time submitting an issue so please let me know if I can provide more information.
I used shrinkwrap on my Rpi4b to shrink a backup image file on an attached USB drive. I created the image with win32diskimager.
There's an error that re-reading the partition table failed, but also a note to "ignore that error and everything seems fine until nearly the end. At the point where the script attempts to truncate the img file, I get the error "truncate: Invalid number: ‘8.51628e+09’" and the source file remains at a full un-shrunken size. Full log is attached and pasted below:
pi@nasberry:~/shrinkwrap $ sudo ./shrinkwrap.sh /home/pi/Desktop/NASBerry/12-Backups/00_NASBerry/20191126_NASBerry_Backup.img
Disk /home/pi/Desktop/NASBerry/12-Backups/00_NASBerry/20191126_NASBerry_Backup.img: 119.3 GiB, 128043712512 bytes, 250085376 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
Disklabel type: dos
Disk identifier: 0x5e3da3da
Device Boot Start End Sectors Size Id Type
/home/pi/Desktop/NASBerry/12-Backups/00_NASBerry/20191126_NASBerry_Backup.img1 8192 532479 524288 256M c W95
/home/pi/Desktop/NASBerry/12-Backups/00_NASBerry/20191126_NASBerry_Backup.img2 532480 250085375 249552896 119G 83 Linu
START of partition: 532480
losetup: /dev/loop0: detach failed: No such device or address
Good - no /dev/loop0 is already free
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 119.3G 0 loop
├─loop0p1 259:0 0 256M 0 part
└─loop0p2 259:1 0 119G 0 part
e2fsck 1.44.5 (15-Dec-2018)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
rootfs: 197549/7768320 files (0.5% non-contiguous), 2186120/31194112 blocks
resize2fs 1.44.5 (15-Dec-2018)
Resizing the filesystem on /dev/loop0p2 to 2012607 (4k) blocks.
Begin pass 2 (max = 250881)
Relocating blocks XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Begin pass 3 (max = 952)
Scanning inode table XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Begin pass 4 (max = 19052)
Updating inode references XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The filesystem on /dev/loop0p2 is now 2012607 (4k) blocks long.
dumpe2fs 1.44.5 (15-Dec-2018)
Filesystem volume name: rootfs
Last mounted on: /
Filesystem UUID: efc2ea8b-042f-47f5-953e-577d8860de55
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent flex_bg sparse_super large_file dir_nlink extra_isize
Filesystem flags: unsigned_directory_hash
Default mount options: user_xattr acl
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 505920
Block count: 2012607
Reserved block count: 81508
Free blocks: 284329
Free inodes: 308371
First block: 0
Block size: 4096
Fragment size: 4096
Reserved GDT blocks: 389
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 8160
Inode blocks per group: 510
Flex block group size: 16
Filesystem created: Wed Sep 25 19:44:35 2019
Last mount time: Sun Nov 24 21:49:52 2019
Last write time: Wed Nov 27 09:28:57 2019
Mount count: 0
Maximum mount count: -1
Last checked: Wed Nov 27 09:19:04 2019
Check interval: 0 ()
Lifetime writes: 42 GB
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 256
Required extra isize: 32
Desired extra isize: 32
Journal inode: 8
Default directory hash: half_md4
Directory Hash Seed: 2a510282-7c57-4970-8f9a-1514cd4b5a23
Journal backup: inode blocks
Journal features: journal_incompat_revoke
Journal size: 64M
Journal length: 16384
Journal sequence: 0x000275a4
Journal start: 0
NEW SIZE of partition: 16100872 512-blocks
Welcome to fdisk (util-linux 2.33.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): Disk /dev/loop0: 119.3 GiB, 128043712512 bytes, 250085376 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
Disklabel type: dos
Disk identifier: 0x5e3da3da
Device Boot Start End Sectors Size Id Type
/dev/loop0p1 8192 532479 524288 256M c W95 FAT32 (LBA)
/dev/loop0p2 532480 250085375 249552896 119G 83 Linux
Command (m for help): Partition number (1,2, default 2):
Partition 2 has been deleted.
Command (m for help): Partition type
p primary (1 primary, 0 extended, 3 free)
e extended (container for logical partitions)
Select (default p): Partition number (2-4, default 2): First sector (2048-250085375, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (532480-250085375, default 250085375):
Created a new partition 2 of type 'Linux' and of size 7.7 GiB.
Partition #2 contains a ext4 signature.
Command (m for help):
Command (m for help):
Disk /dev/loop0: 119.3 GiB, 128043712512 bytes, 250085376 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
Disklabel type: dos
Disk identifier: 0x5e3da3da
Device Boot Start End Sectors Size Id Type
/dev/loop0p1 8192 532479 524288 256M c W95 FAT32 (LBA)
/dev/loop0p2 532480 16633352 16100873 7.7G 83 Linux
Command (m for help): The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Invalid argument
The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).
Ignore that error.
Disk /home/pi/Desktop/NASBerry/12-Backups/00_NASBerry/20191126_NASBerry_Backup.img: 119.3 GiB, 128043712512 bytes, 250085376 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
Disklabel type: dos
Disk identifier: 0x5e3da3da
Device Boot Start End Sectors Size Id Type
/home/pi/Desktop/NASBerry/12-Backups/00_NASBerry/20191126_NASBerry_Backup.img1 8192 532479 524288 256M c W95
/home/pi/Desktop/NASBerry/12-Backups/00_NASBerry/20191126_NASBerry_Backup.img2 532480 16633352 16100873 7.7G 83 Linu
TRUNCATE AT: 8.51628e+09 bytes
truncate: Invalid number: ‘8.51628e+09’
`