Cloning CentOS Problem - "Could Not Boot"
Hey,
I'm fairly new to the Linux world, and I'm in the process of setting up a web server. I'm running CentOS 7 on an older machine, and have gotten most of it figured out. When the original hard drive was cloned onto another drive as a backup, problems began to arise. Currently, I have the backup in the machine, and when I boot it up, I get the following error: Code:
[ OK ] Started File System Check on /dev/mapper/centos-root. Once that is complete, system is booted up fine. I understand that the issue is related to the cloned backup, but fail to understand why, or how to fix it. Any advice would be greatly appreciated. |
Hi:
It looks like your system can not find the swap partition. https://www.centos.org/forums/viewto...p?f=47&t=52140 Is there a chance that you have a CentOS Live CD? (to chroot) |
It looks like you were able to successfully copy the data over to the new (backup) drive, but it looks like the swap partition was not copied over.
You can look at the partitioning of the original disk with "fdisk -l". From you description, you will need to create a swap partition on the new disk using "fdisk". If you're not familiar with it, be sure to read up on it, as you can inadvertently overwrite data. Alternatively, you can make a swap file: Create New Swap Partition: - mkdir /swapfile - cd /swapfile - dd if=/dev/zero of=/swapfile/swap01 bs=1M count=4096 - mkswap /swapfile/swap01 - chmod 0600 /swapfile/swap01 - vi /etc/fstab > /swapfile/swap01 swap swap defaults 0 0 - mount -a - swapon -a - swapon -s |
Thank you both for the quick replies.
Quote:
https://www.digitalocean.com/communi...ap-on-centos-7 |
Your Welcome.
That article in the link you posted, the instructions are similar. I would just follow SpudMan13 instruction in post #3 and create a swap file. (it's up to you though) |
Quote:
With that being said, and after a little reading as to why each step is taken, I'm following SpudMan13's steps. I'm currently in vi editor, and I'm not sure what the next step is in adding an fstab entry. Am I to hit 'i', to get into insert mode, then type "> /swapfile/swap01 swap swap defaults 0 0" without the quotes, on the first line? this is what I understand it as. |
Quote:
Yes, w/o the quotes. Put this in that fstab file: Code:
>/swapfile/swap01 swap swap defaults 0 0 That should save your changes. If not you can use nano to edit that file.:) -::-Whatever you did in that tutorial can be undone.-::- |
I'm still getting that error prompt.
After adding the fstab entry, and going to the following steps (swapon -a), I got an invalid entry. I imagined this may be due to the fact that I created a previous swapfile entry in fstab from the previous tutorial. I then went back into the fstab file, and added an hashtag in front of the initial /swapfile entry from the previous tutorial. My fstab file looks like this currently: Code:
/dev/mapper/centos-root / xfs defaults 0 0 EDIT: I ran the fdisk -l command, and there is no /swap entry as compared to my original disk. And in regards to undoing what I did in the previous tutorial, I imagine I have to do the following, and please, correct me if I'm wrong: Delete the fstab entry completely Then, as root, Code:
rm /swapfile |
Quote:
Copy and paste those last 4 lines and add them to your file. No, don't delete or remove the swapfile. Running fdisk -l is not going to show you a swap partition because your creating a swap file instead. If you want to create a swap partition you would have to have at least 1 GB to do so and use gparted to do it. |
If editing that file is hard to understand you could download Gparted Live and use it to create a swap partition.
http://gparted.org/livecd.php If I remember correctly you don't have much in the way of free space left over to use, do you? |
So I'm changing my fstab file to look exactly as follows?
Code:
/dev/mapper/centos-root / xfs defaults 0 0 I'm only using 50 of my root partition, and 1 of my home partition, so plenty of space. I'd actually prefer to do it this way, as to better familiarise myself with the process, and to learn as much as possible. |
Yes just like that but you spelled "defailts" wrong in this line. (*defaults*)
Code:
/swapfiles/swap01 swap swap defailts 0 0 Quote:
-::-Take your time when you edit your files.-::- |
Quote:
With that being said, my fstab file looks EXACTLY like how I've posted above (without the error), yet on reboot, I've gotten the exact same error... |
Please post the exact error message.
|
"When I exit out of emergency mode by typing "exit" the system boots normally after sometime, with "A start job is running for dev-mapper-centos\x2dswap.device".
Once that is complete, system is booted up fine." I've still been wondering about this. I almost can't believe it would work like that. Wonder if looking at dmsetup is a way to proceed also. |
All times are GMT -5. The time now is 12:51 AM. |