Disk image

Posted on So 16 Mai 2021 in Notebook • Tagged with notebook, linux, filesystem

Creating

dd if=/dev/zero of=file.img bs=1 count=0 seek=512M

Copy

cp --sparse=always new_file.img recovered_file.img

Growing

dd if=/dev/zero of=file.img bs=1 count=0 seek=1G

This will increase its size to 1 Gb, and leave its information intact.

cryptsetup …

Continue reading

Recover Btrfs Partition

Posted on Fr 08 August 2014 in Notebook • Tagged with notebook, linux, filesystem

Let's assume that you don't have a physical device failure (which is a different set of tools -- mount -odegraded, btrfs dev del missing).

First thing to do is to take a btrfs-image -c9 -t4 of the filesystem, and keep a copy of the output to show josef. :)

Then start with …


Continue reading

LVM

Posted on So 28 August 2011 in Notebook • Tagged with notebook, linux, filesystem

shrink lvm

# Unmount the filesystem and check its' LV
umount /mnt/foo
e2fsck -f /dev/mapper/vg0-foo

# Shrink ext4 and then the LV to the desired size
resize2fs -p /dev/mapper/vg0-foo 40G
lvreduce -L 40G /dev/mapper/vg0-foo

# Before continuing, run e2fsck. If it bails because the partition
# is …

Continue reading