It's a very strange article because the original knowledge is that rather than being drunk.
When I first saw the console, it was in emergency mode. Ls / sysroot was empty with an error that / sysroot could not be mounted. When a genius colleague rebooted, he said he was able to boot in rescue mode.
What I learned for the first time this time. It seems that centos 7 has systemd.unit = rescue.target after pressing e when grub is selected. When I looked it up later, this was just a single user mode (for me). I heard the name rescue mode, but what was it just a single user mode?
rescue mode is equivalent to single user mode RHEL 10.3. WORKING WITH SYSTEMD TARGETS
That's the way I forgot my admin password when I was on Mac OS 10.1. It's the one that starts with cmd + s, right?
Aside from old tales, this is the name rescue ... but after all it's booted with / dev / sda so you can't xfs_repair the root partition, right? (Someone tell me) Isn't it completely different from rescue that starts with DVD or pxe? Is it okay to use the same words? Do you have different words?
It doesn't matter, but I couldn't rescue at all for a while because I typed res ** q ** ue.target. Reflection typo.
Simply put, it's the one that's cool when emergency mode can't mount the root partition (probably the one that just boots with / boot or initramfs), and rescue.target is the one that forces it to boot with / def / sda. So I think that rescue.target cannot go if the root partition is bad in / etc / fstab. It seems that / dev / sdb cannot be mounted. (Tell me if anyone is right or wrong) No, wait, you're reading from the initramfs disk. Where is he?
Enter the main subject of a sloppy article.
I had 30GB of vm in my virtual box disk For the time being, I thought I should copy this in practice ...
Just fill it with 0 anyway, 8GB is fine, right? Add a disk with virtual box default = 8GB to the VM and make it / dev / sdb. I think I need a partition, so I create / dev / sdb1 with parted. After all xfs? That is, mkfs.xfs is already a habit here.
When you hit the dd command, that? Where are you copying? Is os running? Is it okay to have / dev / sda1 and / dev / sda2 and the important root partition under sda2, / dev / mapper / centos-root? that?
This is absolutely different, it's fundamentally wrong, but for the time being, I think this is also an experience
After dd if = / dev / mapper / centos-root of = / dev / sdb1, the mac became so heavy that it suddenly rebooted after a while.
Install centos7 with an 8GB disk that is easy to copy obediently. Obedient. Attach another 8GB disk and start rescue.target. Make sure it looks like / dev / sdb. And this simple and clear command.
dd if=/dev/sda of=/dev/sdb
You don't need to prepare a partition. Physical disk space? I'm going to do it. copy finished smoothly and shut down once. Detouch the original disk from the VM. Start with only the additional disk. You can use os normally. It means that all the partitions were duplicated together perfectly. Awesome. Is this dd? Awesome. Thank you for being able to imagine yourself from the first failure.
No, I learned a lot. dd It's really convenient! !!
You can see if you're still doing your best on iotop for the time being.
yum install -y iotop strace
# -Show only those running on o
iotop -o
Such kanji ↓
If it is strace, you can see what you are writing. However, if it is 100GB, a character string of 100GB or more will flow, so it is quite difficult to go over the NW. I saw that it would be nice to connect the tail, but it didn't work in my environment.
ps aux | grep dd #Get pid
strace -p 4458 #With pid as an argument
strace -p $PID | tail -n 5 #Show only last 5 lines (I don't work)