LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Cloning CentOS Problem - "Could Not Boot" (https://www.linuxquestions.org/questions/linux-newbie-8/cloning-centos-problem-could-not-boot-4175549835/)

Ztcoracat 08-05-2015 08:59 PM

Sorry- I went back and re-read your first post.

Is this what your still getting?

Code:

dracut-initqueue[257]: Warning: Could not boot.
dracut-initqueue[257]: Warning: /dev/centos/swap does not exist
        Starting Dracut Emergency Shell...
Warning: /dev/centos/swap does not exist

Generating "/run/initramfs/rdsosreport.txt"


Ztcoracat 08-05-2015 09:06 PM

Quote:

Originally Posted by jefro (Post 5401589)
"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.

Thank you for joining the thread.-:)

I'm pondering on this:
https://www.centos.org/docs/5/html/5...etup-info.html

hamprop 08-06-2015 08:23 AM

Quote:

Originally Posted by Ztcoracat (Post 5401628)
Sorry- I went back and re-read your first post.

Is this what your still getting?

Code:

dracut-initqueue[257]: Warning: Could not boot.
dracut-initqueue[257]: Warning: /dev/centos/swap does not exist
        Starting Dracut Emergency Shell...
Warning: /dev/centos/swap does not exist

Generating "/run/initramfs/rdsosreport.txt"


Yup. I've taken a photo of the boot error message:

http://i.imgur.com/nh5V3rc.jpg


Quote:

Originally Posted by jefro (Post 5401589)
"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.

Is the swap partition truly needed, though? As I understand it, it's a space on the drive for the memory to dump recently unused files, and then swap them out when needed again. Pretty much like the pagefile in windows, and if I remember correctly, you can flatout disable that or limit it to a unpractical size, and the computer would run without a problem (well..if you've got enough memory). So with that being said, could that not be the issue here. I.e., the system is notifying me that no swap partition exists, where one should exist - as a warning, to so speak - and that I can continue as normal beyond that point. Regardless, I've taken a photo of the dmsetup info, and it shows the swap file/partition as "SUSPENDED"

http://i.imgur.com/9VyjSl6.jpg

EDIT:
As a reminder, I did follow a few steps in the tutorial I linked. Perhaps that may have something to do with it? In the tutorial I linked (https://www.digitalocean.com/communi...ap-on-centos-7), I was unable to move past the following step:

"Our swap file is now ready to be used as a swap space. We can begin using it by typing:

Code:

sudo swapon /swapfile
At this step, I got the following error, as mentioned before:

Code:

swapon: /swapfile: swapon failed: Invalid argument

Ztcoracat 08-06-2015 02:47 PM

ASAIK the swap holds the tmp memory pages.
A server can boot w/o a swap partition as long as there is enough RAM.-:)

If you continue to have this problem you may want to consider using gparted live and create a swap partition.
I can walk you through that if need be.

Did you do all of these steps?
Code:

- mkdir /swapfile
- cd /swapfile
- dd if=/dev/zero of=/swapfile/swap01 bs=1M count=4096
- mkswap /swapfile/swap01
- chmod 0600 /swapfile/swap01

If you did all those steps than it could be a permissions issue:-

I'm not sure why the swap file/partition is in a suspended state and I don't know how to get it out of the suspended state that it's in; sorry.
http://www.linux.com/community/forum...argument/22674

Maybe our Guru; jefro will know.

jefro 08-06-2015 04:16 PM

Ztcoracat finds things that I can never figure out.

These are the thoughts I have however.

Cloning was always a non-useful way to make a new system. It really still has a number of drawbacks. The general statement is you need to make things generic before you move otherwise you will have to fix any specific reference later.

An issue here seems to be that you cloned a raid of some kind. Is that right? (or LVM I mean)


No, most people don't need a swap file/partition just to get it running. Current notion is that it can't hurt to have it.

Be sure you understand file and partition in the use of swap by the way.

Look at it more with dmsetup. https://access.redhat.com/documentat...n/dmsetup.html Keep reading each page and next 10 or so.

hamprop 08-06-2015 04:30 PM

Quote:

Originally Posted by Ztcoracat (Post 5402025)
ASAIK the swap holds the tmp memory pages.
A server can boot w/o a swap partition as long as there is enough RAM.-:)

If you continue to have this problem you may want to consider using gparted live and create a swap partition.
I can walk you through that if need be.

Did you do all of these steps?
Code:

- mkdir /swapfile
- cd /swapfile
- dd if=/dev/zero of=/swapfile/swap01 bs=1M count=4096
- mkswap /swapfile/swap01
- chmod 0600 /swapfile/swap01

If you did all those steps than it could be a permissions issue:-

I'm not sure why the swap file/partition is in a suspended state and I don't know how to get it out of the suspended state that it's in; sorry.
http://www.linux.com/community/forum...argument/22674

Maybe our Guru; jefro will know.

Yup, followed the steps above. I will take you up on your offer for making a swapfile using gparted; I figure if all else fails and I get frustrated beyond reason, the gparted method will be a last resort.

Quote:

Originally Posted by jefro (Post 5402061)
Ztcoracat finds things that I can never figure out.

These are the thoughts I have however.

Cloning was always a non-useful way to make a new system. It really still has a number of drawbacks. The general statement is you need to make things generic before you move otherwise you will have to fix any specific reference later.

An issue here seems to be that you cloned a raid of some kind. Is that right? (or LVM I mean)


No, most people don't need a swap file/partition just to get it running. Current notion is that it can't hurt to have it.

Be sure you understand file and partition in the use of swap by the way.

Look at it more with dmsetup. https://access.redhat.com/documentat...n/dmsetup.html Keep reading each page and next 10 or so.

I guess this is the ugly side to Linux, huh.

No, no RAID. Just one lonely 200GB drive.

Will do. I'll keep looking into a solution, and if all else fails, I'll be relying on Ztcoracat's help in using gparted.

Thanks to all 3 of you for all the effort you've put in thus far.

Ztcoracat 08-06-2015 05:14 PM

Your Welcome.

Gparted is a pretty easy partition manager to work with.

-::-If you find that it comes to a last resort I'd be happy to give you the details and help you make a swap partition.-::-

hamprop 08-07-2015 11:14 AM

Quote:

Originally Posted by Ztcoracat (Post 5402089)
Your Welcome.

Gparted is a pretty easy partition manager to work with.

-::-If you find that it comes to a last resort I'd be happy to give you the details and help you make a swap partition.-::-

You're in luck, Ztcoracat...more problems. But this may hint as to why the swap situation from earlier possibly didn't work.

I've installed gparted, and was about to go through the steps of creating a swap partition, but was greeted with this beauty upon firing it up:


http://i.imgur.com/2cts72M.png

EDIT:

Ran a parted -l command, and this is the output:

Code:

sudo parted -l
Error: Can't have a partition outside the disk!
Model: ATA ST3250310AS (scsi)
Disk /dev/sda: 250GB
Sector Size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/centos-home: 85.9GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags:

Number Start  End      Size  File system  Flags
1      0.00B  85.9GB  85.9GB    xfs

Model: Linux device-mapper (linear) (dm)
Dis /dev/mapper/centos-root: 160GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags

Number Start  End      Size  File system  Flags
1      0.00B  160GB  160GB    xfs

The HDD capacity is 250GB...If I understand the output, the system is assuming there are three partitions on this disk, one that's 250GB, another that is 85.9GB, and a third that is 160GB? If that is the case, well, the math simply doesn't make any sense, and clearly something is way off.

jefro 08-07-2015 03:32 PM

It's the ugly side of clones. :)

You used dd command to clone it didn't you?

Still a mapper issue. Must be a newish install if it had xfs.


At this point you could have performed a clean install.

Ztcoracat 08-07-2015 08:26 PM

No, your right the math does not make sense.

If 232 GB is unallocated than that would imply that you have a 18 GB file system of some sort.
245 GB = (85.9 allocated to xfs fs and 160 GB to the centos root) would; based on your 250 GB HDD would indicate that there is 5 GB of unallocated space.

This misconfiguration is most likely (I'm suspicious/suspecting) that's why you couldn't create a swap.

Quote:

I've installed gparted, and was about to go through the steps of creating a swap partition
If that is the only operating system on your HDD you can not use gparted while the distribution is mounted.
The only way to manipulate that partition and create a swap partition is to use gparted live.

-::::-Unless you have another os on that HDD that you can use gparted in to manipulate the CentOS partitions.-::::-

Ztcoracat 08-07-2015 08:29 PM

Quote:

Originally Posted by jefro (Post 5402629)
It's the ugly side of clones. :)

You used dd command to clone it didn't you?

Still a mapper issue. Must be a newish install if it had xfs.


At this point you could have performed a clean install.


Ugly indeed:-

I have always performed fresh installations and had complete success.-:)

Ztcoracat 08-08-2015 03:31 PM

It doesn't look like the way thing have gone that the cloning process worked.

-::-Had the cloning process been successful than gparted would reflect what parted -l is showing.-::-

To avoid frustration and more possible errors and boot failure a fresh installation is the best way to go.-:)

hamprop 08-10-2015 08:14 AM

Quote:

Originally Posted by Ztcoracat (Post 5402718)
Ugly indeed:-

I have always performed fresh installations and had complete success.-:)

Quote:

Originally Posted by Ztcoracat (Post 5403057)
It doesn't look like the way thing have gone that the cloning process worked.

-::-Had the cloning process been successful than gparted would reflect what parted -l is showing.-::-

To avoid frustration and more possible errors and boot failure a fresh installation is the best way to go.-:)


So what is done in situations where drives need to be cloned as they are? Say, for example, you are working with multiple machines and want to clone them from a single machine? Or you want a physical backup of a drive? Or simply can't be asked to install every package, codec, etc. every time?

Do you guys have any readings in regards to cloning in linux? I'd like to attempt to reclone this drive from the original, and get a handle on that process.

Ztcoracat 08-10-2015 03:49 PM

There might be some articles about cloning in our "Tutorials" section take a look there when you have the time.


https://www.linux.com/learn/tutorial...ith-clonezilla

http://www.tecmint.com/linux-disk-cloning-tools/

https://wiki.archlinux.org/index.php/Disk_cloning

Read here where it says Falls Short so you can be aware of what Clonezilla does. (doesn't have a partition mgr)
http://lifehacker.com/5891933/the-be...-app-for-linux

Hope that helps.

hamprop 08-17-2015 04:45 PM

I'm back - stubborn as ever.

So I attempted to clone the disk once more using gparted, and it worked fine.

Code:

sudo dd if=/dev/sda of=/dev/sdc bs=4K conv=sync,noerror
But still the same issue with the swap partition. I realised, as jefro suggested, this is an LVM. (Although I don't know how this was created, given that I'm running a single disk and followed a basic initial install of CentOS on the original hard drive). I then went to look at how exactly the volume was structured/info using the lvs -a command, only to find out the swap partition is inactive/suspended yet again.

Code:

lvs -a
 LV    VG        Attr      Lsize
vert
home  centos  -wi-ao----    80.00g

root  centos  -wi-ao----    149.02g

swap  centos  -wi-s-----    3.37g

Where 's' in the attributes is for suspended.

So now, the logical next step would be looking into trying to activate the swap.

I've already attempted to activate it with the following command. and got the consequent output:

Code:

lvchange -a y centos
device-mapper: resume ioctl on failed: Invalid Argument
Unable to resume centos-swap (253:1)

I've searched around with no luck as to what could be causing the issue. Any advice, help, information, or simply where to go for further reading to look into the problem would be greatly appreciated.


All times are GMT -5. The time now is 06:55 PM.