LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-08-2014, 10:15 AM   #1
scoob8000
Member
 
Registered: Jun 2003
Distribution: Redhat 8, Redhat 9, Win2k, WinXP
Posts: 64

Rep: Reputation: 15
Move LVM to new hardware hda is now sda


So I'm trying to migrate a Centos install using LVM to some new hardware. I can't just move the disk because the old hardware is using /dev/hda and the new is /dev/sda.

I've been down this road before years ago but forget the solution. I am using LVM labels, so there is nothing useful in grub.conf or fstab to simply change.

I can access everything from the old hardware before moving the disk over..



--- Physical volume ---
PV Name /dev/hda2
VG Name VolGroup01
PV Size 1.77 GB / not usable 25.16 MB
Allocatable yes (but full)
PE Size (KByte) 32768
Total PE 56
Free PE 0
Allocated PE 56
PV UUID OZaZh5-DZ19-W2AA-5a3G-lijO-mmip-Lz1hm2

--- Physical volume ---
PV Name /dev/hda3
VG Name VolGroup01
PV Size 1.61 GB / not usable 21.00 MB
Allocatable yes (but full)
PE Size (KByte) 32768
Total PE 51
Free PE 0
Allocated PE 51
PV UUID 9fXQDX-3Zod-mZHX-5AYv-05bE-Je6G-thzjY9[root@redirector etc]# pvs
PV VG Fmt Attr PSize PFree
/dev/hda2 VolGroup01 lvm2 a- 1.75G 0
/dev/hda3 VolGroup01 lvm2 a- 1.59G 0

[root@redirector etc]# vgs
VG #PV #LV #SN Attr VSize VFree
VolGroup01 2 1 0 wz--n- 3.34G 0

[root@redirector etc]# lvs
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
LogVol00 VolGroup01 -wi-ao 3.34G

Last edited by scoob8000; 07-08-2014 at 11:38 AM.
 
Old 07-08-2014, 11:50 AM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,784

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
You might need to delete /etc/lvm/cache/.cache to force a rescan of the devices. The default filter rule in /etc/lvm/lvm.conf accepts every block device, so you shouldn't need to do anything there unless you've changed that filter rule.
 
Old 07-08-2014, 12:33 PM   #3
scoob8000
Member
 
Registered: Jun 2003
Distribution: Redhat 8, Redhat 9, Win2k, WinXP
Posts: 64

Original Poster
Rep: Reputation: 15
I got my hopes up it would be that simple, but no dice. Judging by this, it did rescan since I rm'ed .cache...


Scanning logical volumes
Reading all physical volumes. This may take a while...
No volume groups found
Activating logical volumes
Volume group "VolGroup01" not found
Creating root device.
Mounting root filesystem.
mount: could not find filesystem '/dev/root'
 
Old 07-08-2014, 01:56 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,781

Rep: Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935
Not sure exactly what you are trying to accomplish.

What is the version of the old install? The latest kernels use the SCSI subsystem for everything so all drives are sdx even IDE (PATA). If you configure the BIOS for SATA legacy support (PATA emulation) the old kernel should assign the drives as hdx.

However, if there isn't legacy software you are trying to maintain then you should really think about installing the current version of CentOS (6.5). As always, make sure you have good backups.
 
Old 07-08-2014, 02:05 PM   #5
scoob8000
Member
 
Registered: Jun 2003
Distribution: Redhat 8, Redhat 9, Win2k, WinXP
Posts: 64

Original Poster
Rep: Reputation: 15
I run a couple embedded systems that run off a CF card here, had a piece of hardware fail and replaced it with slightly newer hardware.

Even with my rescue media, the old hardware detects the CF card as hdx, and the new hardware as sdx. As I've been digging a little deeper it seems I may need to remake a new initrd with scsi/ata modules built in..

Here's what I was looking at:
http://www.pantz.org/software/mkinit...amkinitrd.html

Attempting it now

Last edited by scoob8000; 07-08-2014 at 02:20 PM.
 
Old 07-08-2014, 02:27 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,781

Rep: Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935
Looks like you are on the right path.
 
Old 07-08-2014, 03:13 PM   #7
scoob8000
Member
 
Registered: Jun 2003
Distribution: Redhat 8, Redhat 9, Win2k, WinXP
Posts: 64

Original Poster
Rep: Reputation: 15
So I feel like I took a step backwards on that ones. I made a new initrd like the above link discussed, using the same module options. Added a grub entry for it and rm'ed /etc/lvm/cache/.cache again and tried it..

Here's a few lines from the bootup that caught my eye. Did I miss some sort of option with mkinitrd perhaps?


checking if image is initramfs...it isn't (invalid compressed format (err=2)); looks like an initrd


RAMDISK: Compressed image found at block 0
invalid compressed format (err=2)
VFS: Cannot open root device "VolGroup01/LogVol00" or unknown-block(0,0)
Please append a correct "root=" boot option
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
 
Old 07-08-2014, 03:57 PM   #8
Doc CPU
Senior Member
 
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Hi there,

Quote:
Originally Posted by scoob8000 View Post
I can't just move the disk because the old hardware is using /dev/hda and the new is /dev/sda.
I'm sorry this post of mine isn't helpful - but I'll hang in here because there's a detail that makes me wonder.
It's about the naming convention of HDDs.

Actually, I know that HDDs used to be named /dev/hdX in the past, but all systems I used myself had them as /dev/sdX. Some years ago, a friend of mine told me that this changed from kernel 2.4 to 2.6 - in other words: Kernels up to 2.4 named the HDDs as hdX, while later kernels named them sdX.

I don't know if this explanation is accurate, but if it is, it would mean that you're migrating from a pretty old system.

Could somebody shed some light on this particular issue?
Thanks for any clarification to come.

[X] Doc CPU
 
Old 07-08-2014, 06:08 PM   #9
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,784

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
What version of CentOS is this?

At this stage of booting, /etc/lvm/cache/.cache in the not-yet-mounted root filesystem is irrelevant. (Sorry, but in your original post it wasn't apparent that this was a boot failure looking for the root filesystem.)
 
Old 07-08-2014, 07:01 PM   #10
scoob8000
Member
 
Registered: Jun 2003
Distribution: Redhat 8, Redhat 9, Win2k, WinXP
Posts: 64

Original Poster
Rep: Reputation: 15
Doc CPU, This install is using a 2.6 kernel. I'm still feeling like this had to do with what hardware was present when we did the original install. IDE vs SATA devices, etc.

rknichols, It's running Centos 5
 
Old 07-08-2014, 08:54 PM   #11
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,151

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
Libata was merged around 2.6.15 - and that may explain why the posted link didn't solve the issue (completely).
In that link, the kernel is 2.6.18 - so that (initial) initrd was built using /dev/sda - hence the inclusion of the module(s) solved the issue.
I think the OP may have to unroll the initrd and look to see if /dev/hda is used explicitly - and modify to suit. Link here will give an idea of what's required to do that.
 
Old 07-09-2014, 07:37 AM   #12
scoob8000
Member
 
Registered: Jun 2003
Distribution: Redhat 8, Redhat 9, Win2k, WinXP
Posts: 64

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by syg00 View Post
Libata was merged around 2.6.15 - and that may explain why the posted link didn't solve the issue (completely).
In that link, the kernel is 2.6.18 - so that (initial) initrd was built using /dev/sda - hence the inclusion of the module(s) solved the issue.
I think the OP may have to unroll the initrd and look to see if /dev/hda is used explicitly - and modify to suit. Link here will give an idea of what's required to do that.

Makes sense..

I just unrolled both initrds. The "stock" one and the one that I made with extra modules. The "stock" one is indeed missing the libata and scsi stuff.

I grepped the contents of them both and can't find any matches to hda.


I'm going to try a fresh install on the new hardware and start fresh, but I'd still like to figure this out for my own piece of mind. I always seem to have issues when it comes to LVM.
 
Old 07-09-2014, 03:12 PM   #13
scoob8000
Member
 
Registered: Jun 2003
Distribution: Redhat 8, Redhat 9, Win2k, WinXP
Posts: 64

Original Poster
Rep: Reputation: 15
Okay, so update. I'm thinking the naming convention of hda and sda isn't my problem.

I built a fresh Centos 5.1 image in vmware, copied the image over to my embedded device and back to the same no-boot situation. Hangs soon as it tries to mount / but cannot find it. Seems like the kernel doesn't have the module needed to access the storage device.

Perhaps if I could install directly to the embedded device all modules needed would get installed. But is it possible to do a full install without a monitor? (All I have is a console port).

If anyone is curious, this is the hardware:
http://www.pcengines.ch/apu1c4.htm

I realize at this point I better start a new thread in the proper forum.

Last edited by scoob8000; 07-09-2014 at 03:14 PM.
 
  


Reply

Tags
centos, hda, lvm, sda



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sda-> hda linuxgentoo Linux - Kernel 2 04-22-2008 05:06 AM
Why sda* and not hda* ? hepburnenthorpe Arch 9 06-27-2007 04:18 PM
SDA is Now HDA carlosinfl Linux - Hardware 6 06-05-2007 09:00 PM
/hda to /sda - help! dodgydodgy Linux - General 9 10-20-2006 06:07 PM
Do I use hda or sda? jumico Linux - General 2 02-12-2006 05:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration