You are not logged in.

#1 2012-04-23 14:09:59

fettouhi
Member
Registered: 2007-05-07
Posts: 775

[SOLVED] Buying a new machine reusing HDDs

I have DELL Studio PC with a quad core CPU and a Nvidia GT520 gpu card. I am in the process of building a new machine with an i7 core cpu and a Nvidia 580gtx gpu card. On my old machine I have 2 500 GB HDD's I run in RAID 0 mode using software raid (lvm2). My question is now can I reuse my HDD's in the new machine without reinstalling or antyhing? Would that be possible with breaking the RAID setup and etc.

Last edited by fettouhi (2012-05-04 08:20:27)

Offline

#2 2012-04-23 14:17:31

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: [SOLVED] Buying a new machine reusing HDDs

Raid 0 and lvm2? Or just lvm2? Is there a hardware raid involved? If not, plug the disks into the new machine and boot the little devil. Make sure you remove all mainboard relevant hooks from the mkinitcpio.conf and rebuild the kernel image (that's what I had recently).

Offline

#3 2012-04-23 16:24:27

fettouhi
Member
Registered: 2007-05-07
Posts: 775

Re: [SOLVED] Buying a new machine reusing HDDs

Awebb wrote:

Raid 0 and lvm2? Or just lvm2? Is there a hardware raid involved? If not, plug the disks into the new machine and boot the little devil. Make sure you remove all mainboard relevant hooks from the mkinitcpio.conf and rebuild the kernel image (that's what I had recently).

No hardware raid at all. I'm using software raid only to run my 2 disks as one disk (e.g. RAID 0).

Offline

#4 2012-04-23 16:30:09

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: [SOLVED] Buying a new machine reusing HDDs

Shouldn't be an issue to simply pop the disks into your new system in that case (and perhaps add/remove hooks/modules and regen your initramfs as Awebb mentioned).


Burninate!

Offline

#5 2012-04-26 08:29:56

fettouhi
Member
Registered: 2007-05-07
Posts: 775

Re: [SOLVED] Buying a new machine reusing HDDs

Here is my mkinitcpio.conf. I don't see anything that I need to remove. The new motherboard has usb3 additionally.

# vim:set ft=sh
# MODULES
# The following modules are loaded before any boot hooks are
# run.  Advanced users may wish to specify all system modules
# in this array.  For instance:
#     MODULES="piix ide_disk reiserfs"
MODULES="ata_piix ehci-hcd uhci-hcd ext4 vfat dm_mod"

# BINARIES
# This setting includes any additional binaries a given user may
# wish into the CPIO image.  This is run first, so it may be used to
# override the actual binaries used in a given hook.
# (Existing files are NOT overwritten if already added)
# BINARIES are dependency parsed, so you may safely ignore libraries
BINARIES=""

# FILES
# This setting is similar to BINARIES above, however, files are added
# as-is and are not parsed in any way.  This is useful for config files.
# Some users may wish to include modprobe.conf for custom module options
# like so:
#    FILES="/etc/modprobe.d/modprobe.conf"
FILES=""

# HOOKS
# This is the most important setting in this file.  The HOOKS control the
# modules and scripts added to the image, and what happens at boot time.
# Order is important, and it is recommended that you do not change the
# order in which HOOKS are added.  Run 'mkinitcpio -H <hook name>' for
# help on a given hook.
# 'base' is _required_ unless you know precisely what you are doing.
# 'udev' is _required_ in order to automatically load modules
# 'filesystems' is _required_ unless you specify your fs modules in MODULES
# Examples:
##   This setup specifies all modules in the MODULES setting above.
##   No raid, lvm2, or encrypted root is needed.
#    HOOKS="base"
#
##   This setup will autodetect all modules for your system and should
##   work as a sane default
#    HOOKS="base udev autodetect pata scsi sata filesystems"
#
##   This is identical to the above, except the old ide subsystem is
##   used for IDE devices instead of the new pata subsystem.
#    HOOKS="base udev autodetect ide scsi sata filesystems"
#
##   This setup will generate a 'full' image which supports most systems.
##   No autodetection is done.
#    HOOKS="base udev pata scsi sata usb filesystems"
#
##   This setup assembles a pata mdadm array with an encrypted root FS.
##   Note: See 'mkinitcpio -H mdadm' for more information on raid devices.
#    HOOKS="base udev pata mdadm encrypt filesystems"
#
##   This setup loads an lvm2 volume group on a usb device.
#    HOOKS="base udev usb lvm2 filesystems"
HOOKS="base udev keymap autodetect pata scsi sata usb usbinput mdadm lvm2 filesystems"

# COMPRESSION
# Use this to compress the initramfs image. With kernels earlier than
# 2.6.30, only gzip is supported, which is also the default. Newer kernels
# support gzip, bzip2 and lzma. Kernels 2.6.38 and later support xz
# compression.
#COMPRESSION="gzip"
#COMPRESSION="bzip2"
#COMPRESSION="lzma"
#COMPRESSION="xz"
#COMPRESSION="lzop"

# COMPRESSION_OPTIONS
# Additional options for the compressor
#COMPRESSION_OPTIONS=""

Offline

#6 2012-04-26 08:57:04

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: [SOLVED] Buying a new machine reusing HDDs

Don't see anything there that would pose big problems.


Burninate!

Offline

#7 2012-04-27 18:38:34

fettouhi
Member
Registered: 2007-05-07
Posts: 775

Re: [SOLVED] Buying a new machine reusing HDDs

Gcool wrote:

Don't see anything there that would pose big problems.

Many thanks! I bought all the parts for my new rig, should be getting them next week if all goes well.

Offline

#8 2012-05-03 09:41:09

fettouhi
Member
Registered: 2007-05-07
Posts: 775

Re: [SOLVED] Buying a new machine reusing HDDs

I've just installed my old HDD's in the new machine and loads fine after grub I get an error saying "no volumes found". Please help, what am I missing?

EDIT: It also writes "Unable to find root device: '/dev/mapper/vg0-root'"

Last edited by fettouhi (2012-05-03 10:00:15)

Offline

#9 2012-05-03 10:36:13

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: [SOLVED] Buying a new machine reusing HDDs

Try booting from a livecd, activate your lvm volumes, chroot in and regen your initramfs.


Burninate!

Offline

#10 2012-05-03 10:44:28

fettouhi
Member
Registered: 2007-05-07
Posts: 775

Re: [SOLVED] Buying a new machine reusing HDDs

With regen your initramfs you mean run

mkinitcpio -p linux

after I have activated the lvm volumes?

Offline

#11 2012-05-03 10:48:11

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: [SOLVED] Buying a new machine reusing HDDs

Yes, indeed.


Burninate!

Offline

#12 2012-05-03 11:13:07

fettouhi
Member
Registered: 2007-05-07
Posts: 775

Re: [SOLVED] Buying a new machine reusing HDDs

Gcool wrote:

Try booting from a livecd, activate your lvm volumes, chroot in and regen your initramfs.

It has been so long since I reinstalled my machine so I am bit rusty on doing the chroot in to my partitions. I am bit unsure now what my partitions are now with lvm2 and raid 0. Under /dev/mapper I have vg0-home, vg0-root and vg0-boot.

Offline

#13 2012-05-03 11:35:19

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: [SOLVED] Buying a new machine reusing HDDs

Once you've activated the lvm volumes, you should be able to simply mount them. So the procedure would be something among the lines of:

# vgchange -ay <volgroup> (activate the LVM volumes)
# mkdir /mnt/arch
# mount /dev/mapper/vg0-root /mnt/arch
# cd /mnt/arch
# mount -t proc proc proc/
# mount -t sysfs sys sys/
# mount -o bind /dev dev/
# mount /dev/mapper/vg0-boot boot/
# chroot . /bin/bash
# pacman -Syu udev mkinitcpio
# mkinitcpio -p linux

This is off the top of my head (no access to an Arch machine atm), so don't shoot me if I missed something.

Last edited by Gcool (2012-05-03 11:36:28)


Burninate!

Offline

#14 2012-05-03 11:35:25

fettouhi
Member
Registered: 2007-05-07
Posts: 775

Re: [SOLVED] Buying a new machine reusing HDDs

I just tried to chroot the my old installation in my old machine using archboot as a live cd (usbstick). I

modprobe dm_mod
lvm pvdisplay

and then vgscan

but I get an error saying that it can't find any logical volumes.

Offline

#15 2012-05-03 11:59:49

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,392

Re: [SOLVED] Buying a new machine reusing HDDs

try running

vgchange -ay

  first, this should activate all LVM Volume groups.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#16 2012-05-03 12:00:47

foutrelis
Developer
From: Athens, Greece
Registered: 2008-07-28
Posts: 705
Website

Re: [SOLVED] Buying a new machine reusing HDDs

Did you try booting with the fallback initrd in grub?

As for using the chroot method, you might need to assemble your RAID array first before you can access your LVM volumes.

Offline

#17 2012-05-03 12:06:20

fettouhi
Member
Registered: 2007-05-07
Posts: 775

Re: [SOLVED] Buying a new machine reusing HDDs

Lone_Wolf wrote:

try running

vgchange -ay

  first, this should activate all LVM Volume groups.

Tried that but it says that there are no volumes present and this on my old machine so I don't understand why machine boots the volumes just fine but when I try to mount them via the live cd it doesn't find them at all.

Last edited by fettouhi (2012-05-03 12:09:35)

Offline

#18 2012-05-03 12:06:59

fettouhi
Member
Registered: 2007-05-07
Posts: 775

Re: [SOLVED] Buying a new machine reusing HDDs

foutrelis wrote:

Did you try booting with the fallback initrd in grub?

As for using the chroot method, you might need to assemble your RAID array first before you can access your LVM volumes.

Yep tried the fallback as well and it still won't boot.

Offline

#19 2012-05-03 12:14:12

foutrelis
Developer
From: Athens, Greece
Registered: 2008-07-28
Posts: 705
Website

Re: [SOLVED] Buying a new machine reusing HDDs

fettouhi wrote:

Tried that but it says that there are no volumes present and this on my old machine so I don't understand why machine boots the volumes just fine but when I try to mount them via the live cd it doesn't find them at all.

Is the RAID array assembled when you tell it to search for the LVM volumes?

Perhaps you need to do something like this: https://wiki.archlinux.org/index.php/RA … _a_Live_CD

Offline

#20 2012-05-03 12:49:09

fettouhi
Member
Registered: 2007-05-07
Posts: 775

Re: [SOLVED] Buying a new machine reusing HDDs

Yes I forgot that. My mdadm.conf says:

[af@andre ~]$ cat /etc/mdadm.conf
ARRAY /dev/md1 UUID=b3c14b64:8029834a:e89251aa:fb27db36
ARRAY /dev/md/0 metadata=1.2 UUID=75bada9c:3d6016a3:5492ab6d:52fc3be1 name=archboot:0

Offline

#21 2012-05-03 13:06:39

fettouhi
Member
Registered: 2007-05-07
Posts: 775

Re: [SOLVED] Buying a new machine reusing HDDs

foutrelis wrote:
fettouhi wrote:

Tried that but it says that there are no volumes present and this on my old machine so I don't understand why machine boots the volumes just fine but when I try to mount them via the live cd it doesn't find them at all.

Is the RAID array assembled when you tell it to search for the LVM volumes?

Perhaps you need to do something like this: https://wiki.archlinux.org/index.php/RA … _a_Live_CD

Yes you where absolutely right. I run my two 500 GB disks in RAID 0 with mdadm and lvm2. I just assembled the partitions with

mdadm --assemble /dev/md0 /dev/sdh1 /dev/sdi1 and so forth and I could activate the lvm volumes. Strange thing though fdisk for some reason reported after doing fdisk -l that my two drives where named sdh and sdi instead of the standard sda and sdb.

Last edited by fettouhi (2012-05-03 13:06:48)

Offline

#22 2012-05-04 08:25:33

fettouhi
Member
Registered: 2007-05-07
Posts: 775

Re: [SOLVED] Buying a new machine reusing HDDs

I finally got it to work last night!!! I discovered that when I tried to run fdisk -l on the new machine with the old HDD's installed via the archboot installer cd it couldn't see the drives at all. The BIOS had found them, so we tried to put in slot 1 and 2 master (we had accidently put them in 6& 7 slave) and then it booted the whole OS :-D. AWESOME! I am surprised how well everything works on this installation with all this new hardware (Sandy Bridge CPU, Nvidia 580 GTX etc).

Offline

Board footer

Powered by FluxBB