Skip to main content
added 95 characters in body
Source Link

Truncate 2 partitions image

sudo losetup --partscan /dev/loop13 disk_image.img sudo e2fsck -f /dev/loop13p1 sudo e2fsck -f /dev/loop13p2 ' sudo resize2fs /dev/loop13p1 -M sudo resize2fs /dev/loop13p2 -M ' ### RUN THE "DISC" software and resize partition using the gui fdisk -l disk_image.img sudo losetup --detach /dev/loop13 truncate -s $(INSERT THE (END*BLOCKSIZE) OF PARTITION2 HERE) disk_image.img sudo losetup --partscan /dev/loop13 disk_image.img mkdir /tmp/disk_image sudo mount /dev/loop13p1 /tmp/disk_image sudo fstrim -v /tmp/disk_image sudo umount /tmp/disk_image sudo losetup --detach /dev/loop13 
sudo losetup --partscan /dev/loop13 disk_image.img sudo e2fsck -f /dev/loop13p1 sudo e2fsck -f /dev/loop13p2 ' sudo resize2fs /dev/loop13p1 -M sudo resize2fs /dev/loop13p2 -M ' fdisk -l disk_image.img sudo losetup --detach /dev/loop13 truncate -s $(INSERT THE (END*BLOCKSIZE) OF PARTITION2 HERE) disk_image.img sudo losetup --partscan /dev/loop13 disk_image.img mkdir /tmp/disk_image sudo mount /dev/loop13p1 /tmp/disk_image sudo fstrim -v /tmp/disk_image sudo umount /tmp/disk_image sudo losetup --detach /dev/loop13 

Truncate 2 partitions image

sudo losetup --partscan /dev/loop13 disk_image.img sudo e2fsck -f /dev/loop13p1 sudo e2fsck -f /dev/loop13p2 ' sudo resize2fs /dev/loop13p1 -M sudo resize2fs /dev/loop13p2 -M ' ### RUN THE "DISC" software and resize partition using the gui fdisk -l disk_image.img sudo losetup --detach /dev/loop13 truncate -s $(INSERT THE (END*BLOCKSIZE) OF PARTITION2 HERE) disk_image.img sudo losetup --partscan /dev/loop13 disk_image.img mkdir /tmp/disk_image sudo mount /dev/loop13p1 /tmp/disk_image sudo fstrim -v /tmp/disk_image sudo umount /tmp/disk_image sudo losetup --detach /dev/loop13 
deleted 893 characters in body
Source Link
sudo losetup --partscan /dev/loop13 disk_image.img sudo e2fsck -f /dev/loop13p1 sudo e2fsck -f /dev/loop13p2 ' sudo resize2fs /dev/loop13p1 -M sudo resize2fs /dev/loop13p2 -M ' block_count1=$(sudo tune2fs -l /dev/loop13p1 | grep 'Block count1' | sed 's/[^0-9]//g') block_count2=$(sudo tune2fs -l /dev/loop13p1 | grep 'Block count2' | sed 's/[^0-9]//g') ' block_size1=$(sudo tune2fs -l /dev/loop13p1 | grep 'Block size1' | sed 's/[^0-9]//g') block_size2=$(sudo tune2fs -l /dev/loop13p2 | grep 'Block size2' | sed 's/[^0-9]//g') ' fs_size1=$(((block_count1) * (block_size1))) fs_size2=$(((block_count2) * (block_size2))) ' sudo losetup --detach /dev/loop13 ' sudo losetup --partscan /dev/loop13 disk_image.img start1=$(sudo parted /dev/loop13 unit B print --json | jq -r '.disk.partitions[0].start[0:-1]') start2=$(sudo parted /dev/loop13 unit B print --json | jq -r '.disk.partitions[1].start[0:-1]') end1=$((start1 + fs_size1)) end2=$((start2 + fs_size2)) ' sudo parted /dev/loop13 resizepart 1 ${end1}B sudo parted /dev/loop13 resizepart 2 ${end2}B ' fdisk -l disk_image.img sudo losetup --detach /dev/loop13 truncate -s $(INSERT THE (END*BLOCKSIZE) OF PARTITION2 HERE) disk_image.img sudo losetup --partscan /dev/loop13 disk_image.img mkdir /tmp/disk_image sudo mount /dev/loop13p1 /tmp/disk_image sudo fstrim -v /tmp/disk_image sudo umount /tmp/disk_image sudo losetup --detach /dev/loop13 
sudo losetup --partscan /dev/loop13 disk_image.img sudo e2fsck -f /dev/loop13p1 sudo e2fsck -f /dev/loop13p2 ' sudo resize2fs /dev/loop13p1 -M sudo resize2fs /dev/loop13p2 -M ' block_count1=$(sudo tune2fs -l /dev/loop13p1 | grep 'Block count1' | sed 's/[^0-9]//g') block_count2=$(sudo tune2fs -l /dev/loop13p1 | grep 'Block count2' | sed 's/[^0-9]//g') ' block_size1=$(sudo tune2fs -l /dev/loop13p1 | grep 'Block size1' | sed 's/[^0-9]//g') block_size2=$(sudo tune2fs -l /dev/loop13p2 | grep 'Block size2' | sed 's/[^0-9]//g') ' fs_size1=$(((block_count1) * (block_size1))) fs_size2=$(((block_count2) * (block_size2))) ' sudo losetup --detach /dev/loop13 ' sudo losetup --partscan /dev/loop13 disk_image.img start1=$(sudo parted /dev/loop13 unit B print --json | jq -r '.disk.partitions[0].start[0:-1]') start2=$(sudo parted /dev/loop13 unit B print --json | jq -r '.disk.partitions[1].start[0:-1]') end1=$((start1 + fs_size1)) end2=$((start2 + fs_size2)) ' sudo parted /dev/loop13 resizepart 1 ${end1}B sudo parted /dev/loop13 resizepart 2 ${end2}B ' fdisk -l disk_image.img sudo losetup --detach /dev/loop13 truncate -s $(INSERT THE (END*BLOCKSIZE) OF PARTITION2 HERE) disk_image.img sudo losetup --partscan /dev/loop13 disk_image.img mkdir /tmp/disk_image sudo mount /dev/loop13p1 /tmp/disk_image sudo fstrim -v /tmp/disk_image sudo umount /tmp/disk_image sudo losetup --detach /dev/loop13 
sudo losetup --partscan /dev/loop13 disk_image.img sudo e2fsck -f /dev/loop13p1 sudo e2fsck -f /dev/loop13p2 ' sudo resize2fs /dev/loop13p1 -M sudo resize2fs /dev/loop13p2 -M ' fdisk -l disk_image.img sudo losetup --detach /dev/loop13 truncate -s $(INSERT THE (END*BLOCKSIZE) OF PARTITION2 HERE) disk_image.img sudo losetup --partscan /dev/loop13 disk_image.img mkdir /tmp/disk_image sudo mount /dev/loop13p1 /tmp/disk_image sudo fstrim -v /tmp/disk_image sudo umount /tmp/disk_image sudo losetup --detach /dev/loop13 
added 12 characters in body
Source Link
sudo losetup --partscan /dev/loop13 disk_image.img sudo e2fsck -f /dev/loop13p1 sudo e2fsck -f /dev/loop13p2 ' sudo resize2fs /dev/loop13p1 -M sudo resize2fs /dev/loop13p2 -M ' block_count1=$(sudo tune2fs -l /dev/loop13p1 | grep 'Block count1' | sed 's/[^0-9]//g') block_count2=$(sudo tune2fs -l /dev/loop13p1 | grep 'Block count2' | sed 's/[^0-9]//g') ' block_size1=$(sudo tune2fs -l /dev/loop13p1 | grep 'Block size1' | sed 's/[^0-9]//g') block_size2=$(sudo tune2fs -l /dev/loop13p2 | grep 'Block size2' | sed 's/[^0-9]//g') ' fs_size1=$(((block_count1) * (block_size1))) fs_size2=$(((block_count2) * (block_size2))) ' sudo losetup --detach /dev/loop13 ' sudo losetup --partscan /dev/loop13 disk_image.img start1=$(sudo parted /dev/loop13 unit B print --json | jq -r '.disk.partitions[0].start[0:-1]') start2=$(sudo parted /dev/loop13 unit B print --json | jq -r '.disk.partitions[1].start[0:-1]') end1=$((start1 + fs_size1)) end2=$((start2 + fs_size2)) ' sudo parted /dev/loop13 resizepart 1 ${end1}B sudo parted /dev/loop13 resizepart 2 ${end2}B ' fdisk -l disk_image.img sudo losetup --detach /dev/loop13 truncate -s $(INSERT THE END(END*BLOCKSIZE) OF PARTITION2 HERE) disk_image.img sudo losetup --partscan /dev/loop13 disk_image.img mkdir /tmp/disk_image sudo mount /dev/loop13p1 /tmp/disk_image sudo fstrim -v /tmp/disk_image sudo umount /tmp/disk_image sudo losetup --detach /dev/loop13 
sudo losetup --partscan /dev/loop13 disk_image.img sudo e2fsck -f /dev/loop13p1 sudo e2fsck -f /dev/loop13p2 ' sudo resize2fs /dev/loop13p1 -M sudo resize2fs /dev/loop13p2 -M ' block_count1=$(sudo tune2fs -l /dev/loop13p1 | grep 'Block count1' | sed 's/[^0-9]//g') block_count2=$(sudo tune2fs -l /dev/loop13p1 | grep 'Block count2' | sed 's/[^0-9]//g') ' block_size1=$(sudo tune2fs -l /dev/loop13p1 | grep 'Block size1' | sed 's/[^0-9]//g') block_size2=$(sudo tune2fs -l /dev/loop13p2 | grep 'Block size2' | sed 's/[^0-9]//g') ' fs_size1=$(((block_count1) * (block_size1))) fs_size2=$(((block_count2) * (block_size2))) ' sudo losetup --detach /dev/loop13 ' sudo losetup --partscan /dev/loop13 disk_image.img start1=$(sudo parted /dev/loop13 unit B print --json | jq -r '.disk.partitions[0].start[0:-1]') start2=$(sudo parted /dev/loop13 unit B print --json | jq -r '.disk.partitions[1].start[0:-1]') end1=$((start1 + fs_size1)) end2=$((start2 + fs_size2)) ' sudo parted /dev/loop13 resizepart 1 ${end1}B sudo parted /dev/loop13 resizepart 2 ${end2}B ' fdisk -l disk_image.img sudo losetup --detach /dev/loop13 truncate -s $(INSERT THE END OF PARTITION2 HERE) disk_image.img sudo losetup --partscan /dev/loop13 disk_image.img mkdir /tmp/disk_image sudo mount /dev/loop13p1 /tmp/disk_image sudo fstrim -v /tmp/disk_image sudo umount /tmp/disk_image sudo losetup --detach /dev/loop13 
sudo losetup --partscan /dev/loop13 disk_image.img sudo e2fsck -f /dev/loop13p1 sudo e2fsck -f /dev/loop13p2 ' sudo resize2fs /dev/loop13p1 -M sudo resize2fs /dev/loop13p2 -M ' block_count1=$(sudo tune2fs -l /dev/loop13p1 | grep 'Block count1' | sed 's/[^0-9]//g') block_count2=$(sudo tune2fs -l /dev/loop13p1 | grep 'Block count2' | sed 's/[^0-9]//g') ' block_size1=$(sudo tune2fs -l /dev/loop13p1 | grep 'Block size1' | sed 's/[^0-9]//g') block_size2=$(sudo tune2fs -l /dev/loop13p2 | grep 'Block size2' | sed 's/[^0-9]//g') ' fs_size1=$(((block_count1) * (block_size1))) fs_size2=$(((block_count2) * (block_size2))) ' sudo losetup --detach /dev/loop13 ' sudo losetup --partscan /dev/loop13 disk_image.img start1=$(sudo parted /dev/loop13 unit B print --json | jq -r '.disk.partitions[0].start[0:-1]') start2=$(sudo parted /dev/loop13 unit B print --json | jq -r '.disk.partitions[1].start[0:-1]') end1=$((start1 + fs_size1)) end2=$((start2 + fs_size2)) ' sudo parted /dev/loop13 resizepart 1 ${end1}B sudo parted /dev/loop13 resizepart 2 ${end2}B ' fdisk -l disk_image.img sudo losetup --detach /dev/loop13 truncate -s $(INSERT THE (END*BLOCKSIZE) OF PARTITION2 HERE) disk_image.img sudo losetup --partscan /dev/loop13 disk_image.img mkdir /tmp/disk_image sudo mount /dev/loop13p1 /tmp/disk_image sudo fstrim -v /tmp/disk_image sudo umount /tmp/disk_image sudo losetup --detach /dev/loop13 
added 25 characters in body
Source Link
Loading
deleted 13 characters in body
Source Link
Loading
added 31 characters in body
Source Link
Loading
added 6 characters in body
Source Link
Loading
Source Link
Loading