You are not logged in.
To back up my files I booted in to a live enviorment resized my root partition from 250Gb to 10Gb because I only used about 7.5Gb of space I thought it would be a good idea to save some space in the Iso file and then copied the whole partition with:
dd if=/dev/myRootPartition of=/mnt/IsoOnUsb.iso
This worked great until I ran out of memory alldough I resized the partition back to 250Gb, I noticed it when I was installing a package with pacman and it didn't have enough space left except there were 240G of free space in the same partition.
I've tried to do a
mkfs.ext4 /dev/myRootPartition
which wiped the whole partition. Then I copied the backup Iso back to the root partition with:
dd if=/mnt/IsoOnUsb.iso of=/dev/myRootPartition
and my data was back, but the problem remained.
Any one got an idea except reinstalling the system?
Last edited by Gian-Laager (2021-06-17 04:41:36)
Offline
How exactly did you resize the root partition? And am I reading correctly that the only reason you intended to do that so that the dd image wouldn't be huge? That's why you don't want to use plain dd for backups. Just rsync files to another posix compatible filesystem: https://wiki.archlinux.org/title/Rsync# … tem_backup
What's your output
sudo fdisk -l $diskinquestion
df -h
Last edited by V1del (2021-06-16 16:02:57)
Offline
I've also just tried to
mkfs.ext4 /dev/myRootPartition
and than I dd'ed the backup Iso to a partition on the usb. Then I mouted the root partition and the usb partition with the Iso and copied every thing with:
cp -r /mnt/usbPartitionWithIso/* /mnt/myRootPartition
I could boot but then an emergency shell showed up.
Offline
How exactly did you resize the root partition? And am I reading correctly that the only reason you intended to do that so that the dd image wouldn't be huge? That's why you don't want to use plain dd for backups. Just rsync files to another posix compatible filesystem: https://wiki.archlinux.org/title/Rsync# … tem_backup
What's your output
sudo fdisk -l $diskinquestion df -h
with cfdisk's resize option, yes it was a dum Idea but I'd hate it if I'd have to reinstall the system.
Last edited by Gian-Laager (2021-06-16 16:05:21)
Offline
You need to resize the filesystem before resizing the partition... And now you synced over a filesystem that's practically cut to a tenth of it's size.
Can you fsck and/or actually mount the partition/the image from a live system? If you're unlucky you only carried over metadata and recovery information.
If you were actually able to mount and copy over files then you likely have to adjust your boot loader parameters and fstab because the UUID will have changed.
Last edited by V1del (2021-06-16 16:21:02)
Offline
I was busy installing the backup iso and the output of fdisk is
Disk /dev/nvme0n1: 953.87 GiB, 1024209543168 bytes, 2000409264 sectors
Disk model: HFM001TD3JX013N
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: gpt
Disk identifier: 019FB864-4CE5-4C75-A388-33D92072BC29
Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 534527 532480 260M EFI System
/dev/nvme0n1p2 534528 567295 32768 16M Microsoft reserved
/dev/nvme0n1p3 567296 1425187470 1424620175 679.3G Microsoft basic data
/dev/nvme0n1p4 1425188864 1949476863 524288000 250G Linux filesystem
/dev/nvme0n1p5 1949476864 1957670911 8194048 3.9G Linux filesystem
/dev/nvme0n1p7 1957670912 1959104511 1433600 700M Windows recovery environment
/dev/nvme0n1p8 1959104512 1999998975 40894464 19.5G Microsoft basic data
/dev/nvme0n1p9 1999998976 2000408575 409600 200M Windows recovery environment
and wait a minute I have to boot in to the live system.
Offline
fsck gives the output:
fsck from util linux 2.36.2
e2fsck 1.46.2 (28-Feb-2021)
/dev/nvme0n1p4: clean, 125197/524288 files, 1989146/2097152 blocks
(this code may contain syntax errors because I typed it on my phone)
And yes I can mount the partition and copy files.
Offline
I‘ve now generated a new fstab and reinstalled grub to generate the right grub.cfg but it didn‘t help
EDIT:
I made a mistake of course it didn't work i forgot to resize the file system before the partation, for some who doesn't now how to do it here's an article about it
Last edited by Gian-Laager (2021-06-16 20:11:18)
Offline
Solution:
Boot up a live system, first resize the partition to the size you want, then run these two commands to resize the file system:
e2fsck /dev/myPartition
resize2fs /dev/myPartition
in my case this worked fine, but I'd recomend you to have a backup when your're doing this since I needed it about 3 times.
Last edited by Gian-Laager (2021-06-16 20:36:25)
Offline
How can I mark this question as solved?
Offline
Edit the first post and amend the topic title.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline