pavement

Talk:RAID1, Software, How to setup

From FreeBSDwiki
Revision as of 09:16, 3 October 2005 by Dave (Talk | contribs)
Jump to: navigation, search

good article....might wanna drop it in the FBSD for Servers section too

--Dave 20:27, 23 Jul 2005 (EDT)



we have one of those? --Jimbo 00:21, 24 Jul 2005 (EDT)



we do now --Dave 01:53, 24 Jul 2005 (EDT)

Contents

also,

shouldn't the sed line be "sed s/ad0/mirror\/gm0/g /mnt/etc/fstab > /mnt/etc/fstab.new" instead? (i'd also recommend doing a diff between the fstabs before just switching them, but if you're doing software raid, i guess it can be assumed that you're smart enough to do it or accept the risks)

Now we need to fix fstab to refer to the mirror, not to /dev/ad0 itself. You can either manually edit it using ee or vi and change 
all references to /dev/ad0? to /dev/mirror/gm0? - ie /dev/ad0s1b becomes /dev/mirror/gm0s1b - or you can use a sed command to do it 
for you:

# sed "s%ad0%mirror/gm0%" /mnt/etc/fstab > /mnt/etc/fstab.new
# mv /mnt/etc/fstab /mnt/etc/fstab.old
# mv /mnt/etc/fstab.new /mnt/etc/fstab

why?

Why SHOULD the sed command be that instead of the other? --Jimbo 10:23, 1 Oct 2005 (EDT)

for the global change isntead of just "first change"

because the sed command i gave makes the changes globally, and the other doesn't? I want to say the syntax is wrong but am too lazy to ssh into my freebsd box to verify. the doublequotes make the / and \/ be equivalent but what's the piont of the %'s?--Dave 14:53, 1 Oct 2005 (EDT)

ok, my brain fart moment is over

so you're using the % as a delimiter instead of escaping the /'s with \ and since there will (usually) only be one /dev/ entry for each line, the /g isn't strictly necessary. Adding this comment for anyone else who runs across this entry and has my same stupid question. --Dave 10:16, 3 Oct 2005 (EDT)

Personal tools