Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Transfering Single Disk installation to RAID 0 setup(SB600)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64
View previous topic :: View next topic  
Author Message
thigobr
n00b
n00b


Joined: 31 Aug 2007
Posts: 31

PostPosted: Sat Nov 29, 2008 1:52 pm    Post subject: Transfering Single Disk installation to RAID 0 setup(SB600) Reply with quote

Hi people. I bought 2 Samsung sata drives to make a RAID 0 setup, using AMD SB600 controller(fakeraid I guess). I have Gentoo amd64 installed in a single hard disk usign AHCI mode and working very well. How can I clone an image of my installation to a new partition on the RAID setup?
My kernel is gentoo-sources 2.6.26-r3.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54028
Location: 56N 3W

PostPosted: Sat Nov 29, 2008 4:12 pm    Post subject: Reply with quote

thigobr,

Don't use the fakeraid option unless you need to share the raid with Windows.
If you use kernel raid, and can fit all three drives at the same time, its fairly easy.

Update your existing kernel to support raid0 and raid1 as /boot must be raid1 or not raided.
Partition your new drives identically and mark the ones that will be donated to raid as type 0xfd

Using mdadm create your raid sets from the underlying partitions,
You may need to use mknod to create /dev/mdX
Put filesystems on the /dev/mdX devices.
Mount the partitions at temporary mount points
Copy things over from your current install, being careful not to copy /dev, /proc and /sys
Take care to preserve file permissions.
Its often safer to do the copy step from a liveCD.

Install Grub to the MBR of both new drives
Fix grub.conf to point to the raid1 /boot drives and so /dev/mdX is mounted as your root
Fix /etc/fstab in the raid

You now hove your single drive install unharmed and an identical raid install.
Reboot into the raid install to test.

Boot the single install to fix it if it fails on the first attempt
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
palettentreter
Tux's lil' helper
Tux's lil' helper


Joined: 06 Feb 2006
Posts: 104

PostPosted: Sat Nov 29, 2008 4:31 pm    Post subject: Reply with quote

there's a million ways to do this, but the simplest one is surely by using cp -a.
You need to get your root fs mounted somewhere with only those filesystems mounted that you actually wanna copy, ie. without /proc, /sys, /dev or any network filesystem mounted. The simplest way to do that is by using mount -o bind:

mount -o bind / /mnt/OLDROOT

then mount all your sub-partitions in there like so: mount -o bind /usr /mnt/OLDROOT/usr or whatever you may have.
Do the same thing for your new RAID fs at a different mount point.
then you only need to:

cp -a /mnt/OLDROOT/* /mnt/NEWROOT/

but keep in mind that * won't select files and folders beginning with a dot. So if you have any of those in your root directory, you need to copy them separately. The -a option to cp is vital. If you want to see what's being copied, add -v to cp's options. Oh and if you need to cancel the copy process for some reason you can resume it later with rsync -a. But DO read the manpage first.
Back to top
View user's profile Send private message
thigobr
n00b
n00b


Joined: 31 Aug 2007
Posts: 31

PostPosted: Sat Nov 29, 2008 9:06 pm    Post subject: Reply with quote

Thanks for the replies. About the fake raid, I need a Windows install along with a Linux install...
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54028
Location: 56N 3W

PostPosted: Sat Nov 29, 2008 9:47 pm    Post subject: Reply with quote

thigobr,

Yuck. Disregard my first post. You need an initrd that includes dm-raid, thats the fakeraid driver.
Make the raid set in the BIOS. When dmraid is loaded, the raid set will appear as /dev/mapper/...
You can boot from this normally as the BIOS hides the physical structure of the raid from grub

The kernel may or may not show you the underlying drives. You must not use them - ever.

Running fdisk is harmless but the results will be a bit odd.

You may be operating around the limit for a MS-DOS partition table. If your raid set will be bigger than 2TB you need to use
GPT partition tables which is in the kernel. However fdisk does not support that.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
thigobr
n00b
n00b


Joined: 31 Aug 2007
Posts: 31

PostPosted: Sun Dec 14, 2008 10:05 pm    Post subject: Reply with quote

Hi again! I made the transfer of all the files. I installed grub and Windows is already working. But my Linux cannot boot. I followed this guide:
http://en.gentoo-wiki.com/wiki/RAID/NVRAID_with_dmraid
The script generated a linuxrc file and a initrd file. I put them in /boot folder. My grub.conf is:
Code:

# Boot automatically after 30 secs.
timeout 15

# By default, boot the first entry.
default 2

# Fallback to the second entry.
fallback 1

# Splash image to show behind grub.
splashimage=(hd0,1)/boot/grub/splash.xpm.gz

title  Gentoo Linux 2008.0 2.6.26-r3
root (hd0,1)
kernel /boot/kernel-2.6.26-r3 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/mapper/pdc_bccbefg2 dodmraid video=vesafb:1024x768-32@60
initrd /boot/initrd

# For booting Windows NT or Windows95
title Windows Vista/XP
rootnoverify (hd0,0)
makeactive
chainloader  +1


My partitions are:
partition 1 - primary FAT32
partition 2 - primary JFS Linux
partition 3 - primary NTFS
partition 4 - logical FAT32
partition 5 - logical NTFS

When I try to boot I receive a kernel panic message: unpacking initramfs...<0>Kernel panic - not syncing: no cpio magic

Could be something wrong with the kernel ramdisk config?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54028
Location: 56N 3W

PostPosted: Sun Dec 14, 2008 10:34 pm    Post subject: Reply with quote

thigobr,

It looks very much like the kernel is missing initramfs support.
Your initrd is a cpio archive composed of other cpio archives. the kernel has to decompress these for itself.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
thigobr
n00b
n00b


Joined: 31 Aug 2007
Posts: 31

PostPosted: Sun Dec 14, 2008 11:22 pm    Post subject: Reply with quote

I checked the kernel config and the ramdisk is enabled:
Code:
(*) Initial RAM filesystem and RAM disk (initramfs/initrd) support
    ()initramfs source file(s)


I don't know what is the second option. When I press ENTER it ask me to supply a path to the source files...

Do you think that grub.conf is right?
Back to top
View user's profile Send private message
suhesz
n00b
n00b


Joined: 09 May 2007
Posts: 4
Location: Subotica, Backa/Vojvodina/Serbia

PostPosted: Sat Dec 20, 2008 11:12 am    Post subject: Reply with quote

You have your boot and root partition on JFS file sistem,
so check for the compiled kernel options that
the JFS file sistem support is compiled inside the kernel,
and not as a modul.
Back to top
View user's profile Send private message
thigobr
n00b
n00b


Joined: 31 Aug 2007
Posts: 31

PostPosted: Mon Dec 22, 2008 2:09 pm    Post subject: Reply with quote

I solved the RAMDISK problem, it was not properly configured. Now dmraid is not recognizing my raid controller, the system is seeing all the disks alone not in a RAID array.
The root filesystem is not mounted and then happens a kernel panic:
http://img518.imageshack.us/my.php?image=img5006qv7.jpg

suhesz jfs support is already built into the kernel.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54028
Location: 56N 3W

PostPosted: Mon Dec 22, 2008 3:58 pm    Post subject: Reply with quote

thigobr,

You need dmraid support in the initrd and an init script that starts it.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
thigobr
n00b
n00b


Joined: 31 Aug 2007
Posts: 31

PostPosted: Mon Dec 22, 2008 5:05 pm    Post subject: Reply with quote

I am using the initrd built by the wiki script that I indicated ( http://en.gentoo-wiki.com/wiki/RAID/NVRAID_with_dmraid ). But I don't know how to make this init script. Do you have some tutorial containing the commands that should I use to start dmraid?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54028
Location: 56N 3W

PostPosted: Sat May 21, 2011 12:56 pm    Post subject: Reply with quote

thigobr,

I've just answered your fakeraid initrd question here

The kernel will see your drives separately and your raid sets in /dev/mapper/ too.
You must not use the underlying single drives or partitions or your raid will be damaged.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64 All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum