sysreccd quick

174
8/12/2019 SysRecCD Quick http://slidepdf.com/reader/full/sysreccd-quick 1/174 Quick-start-guide EN From SystemRescueCd Jump to: navigation, search Contents [hide  ! " #$out  ! % &o'n(oad and )riting a C&  ! * +ooting rom SystemRescueCd  o *" .ain $oot images  o *% .ain $oot options  o ** #dditiona( /rograms  ! 0 )orking in the conso(e mode  ! 1 )orking in the graphica( environment  ! 2 Setting up your net'ork #$out 3his Quick Start 4uide discusses things you need to kno' to use SystemRescueC& Read the 5n(ine .anua( &o'n(oad and )riting a C& First do'n(oad the 6S5 i(e or your architecture .ost peop(e use the 782 edition that supports  $oth *%$it 96#*% and 20$it 9#.&20 ; E.203 processors 3he S/#RC edition is avai(a$(e i you have an hard'are $ased on the Sun architecture 5nce you have do'n(oaded the 6S5 image i(e, check the md1sum Ne7t 'rite a C&R5. using the 6S5 i(e as a C& image 9c(ick <+urn 6mage< in  Nero, or use cdrecord under =inu7 &o not to copy the 6S5 i(e to the disc Read &o'n(oading and $urning or more detai(s +ooting rom SystemRescueCd 6nsert the SystemRescueCd and $oot your system /ress F%;F*;F0;F1;F2 and read advanced $oot instructions /ress Enter to $oot 'ith the deau(t options 3here are t'o parts in the $oot command: >$oot-image? >$oot-options? For e7amp(e you may 'ant to $oot 'ith rescue20 as $oot-image and docache setkmap@uk as $oot-options Ase spaces  $et'een options #dditiona( options are at +ooting the C&-R5. .ain $oot images 3here are our main $oot images 'ith SystemRescueCd 3he dierences are detai(ed in the kerne(  page  ! rescuecd 3he deau(t or *%$it systems, you can use it $y deau(t or most things  ! rescue20 &eau(t 20 $it kerne( Bou can use it i you have a 20$it capa$(e processor  ! a(tker*% 3his is an a(ternative kerne( or *%$it systems +oot this kerne( i you have pro$(ems 'ith the standard kerne( "

Upload: vasilei5

Post on 03-Jun-2018

229 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 1/174

Quick-start-guide ENFrom SystemRescueCd

Jump to: navigation, search

Contents[hide

  ! " #$out  ! % &o'n(oad and )riting a C&

  ! * +ooting rom SystemRescueCd

  o *" .ain $oot images  o *% .ain $oot options

  o ** #dditiona( /rograms

  ! 0 )orking in the conso(e mode

  ! 1 )orking in the graphica( environment  ! 2 Setting up your net'ork 

#$out

3his Quick Start 4uide discusses things you need to kno' to use SystemRescueC& Read the5n(ine .anua(&o'n(oad and )riting a C&

First do'n(oad the 6S5 i(e or your architecture .ost peop(e use the 782 edition that supports

 $oth *%$it 96#*% and 20$it 9#.&20 ; E.203 processors 3he S/#RC edition is avai(a$(e i youhave an hard'are $ased on the Sun architecture 5nce you have do'n(oaded the 6S5 image i(e,

check the md1sum Ne7t 'rite a C&R5. using the 6S5 i(e as a C& image 9c(ick <+urn 6mage< in

 Nero, or use cdrecord under =inu7 &o not to copy the 6S5 i(e to the disc Read &o'n(oadingand $urning or more detai(s

+ooting rom SystemRescueCd

6nsert the SystemRescueCd and $oot your system

/ress F%;F*;F0;F1;F2 and read advanced $oot instructions

/ress Enter to $oot 'ith the deau(t options

3here are t'o parts in the $oot command: >$oot-image? >$oot-options? For e7amp(e you may'ant to $oot 'ith rescue20 as $oot-image and docache setkmap@uk as $oot-options Ase spaces

 $et'een options #dditiona( options are at +ooting the C&-R5.

.ain $oot images

3here are our main $oot images 'ith SystemRescueCd 3he dierences are detai(ed in the kerne(

 page

  ! rescuecd 3he deau(t or *%$it systems, you can use it $y deau(t or most things

  ! rescue20 &eau(t 20 $it kerne( Bou can use it i you have a 20$it capa$(e processor

  ! a(tker*% 3his is an a(ternative kerne( or *%$it systems +oot this kerne( i you have pro$(ems'ith the standard kerne(

"

Page 2: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 2/174

  ! a(tker20 3his is an a(ternative kerne( or 20$it systems +oot 'ith this kerne( in case you have pro$(ems 'ith rescue20

.ain $oot options

ere are the most common $oot options:

  ! docache: copy the i(es to R#.s permits the SysRescueC& to $e eDected and another disc

inserted /rograms (oad aster

  ! setkmap@cc: Speciy key$oard: us or AS#, uk or $ritish, de or german,   ! root@;dev;id7n: the root@>device? option $oots an e7isting (inu7 system For e7amp(e, i you

have a (inu7 4entoo insta((ed on ;dev;sda2, use rescuecd root@;dev;sda2 See or more detai(s

  ! ide@nodma or a((-generic-ide: i the kerne( $oot process hangs on a driver re(ated to storage

  ! do7detect or orcevesa: use these options i you cannot get the graphica( environment to 'ork   ! acpi-o ; noapic ; irpoo(: use these options i you have pro$(em 'hen the kerne( $oots:See:

+ooting the C&R5. 9kerne(s and $oot options

#dditiona( /rograms

  ! Some programs inc(uded are norma((y $ooted rom their o'n (oppy /ress F% to disp(ay the(ist o (oppy disk images

)orking in the conso(e mode

.ount partitions in order to trou$(eshoot a =inu7 or a )indo's system insta((ed on your disk Bou

can mount (inu7 i(esystems 9e7t%s, e7t*s, reisers, reiser0, Ds, 7s and F#3 and N3FS partitions

used $y .S )indo's nts-*g 9eg: nts-*g ;dev;sda" ;mnt;'indo's Bou can $ackup;restore dataor operating system i(es

.idnight Commander 9type mc is a$(e to copy;move;de(ete;edit i(es and directories 3he vim andemacs editors can $e used to edit i(es Read the (ist o the main system too(s you can use and the

documentation re(ated to these programs

Si7 virtua( conso(es are avai(a$(e /ress #(tGF" or the irst virtua( conso(e, #(tGF% or the secondone,

)orking in the graphica( environment

6 you need graphica( too(s 9such as 4/arted start the graphica( environment $y typing 'iHard

3here are t'o graphica( environments: Iorg and Ivesa Bou shou(d try Iorg irst 6 Iorg ai(s to

start, run 'iHard again and choose Ivesa 'hich shou(d a('ays 'ork, the dra'$ack is that its not

optimiHed or your hard'are and it reuires a *%$it kerne( 9rescuecd or a(tker*%, not on 20$itkerne(s 9rescue20 and a(tker20

3he graphica( environment a((o's you to 'ork 'ith 4/arted 9partition manager, to use graphica(

editors 94eany or 4im, to $ro'se the 'e$ 'ith Fireo7 and use termina(s (ike 7ce-termina( or

mr7vt

Setting up your net'ork 

%

Page 3: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 3/174

)ith SystemRescueCd you can use the net'ork 6ts useu( to make a $ackup over the net'ork,do'n(oad i(es, 'ork remote(y using ssh, te(net or access i(es that are shared on a Ani7 server

9'ith NFS or on a .S )indo's system 9'ith Sam$a

3he most convenient 'ay to conigure your net'ork is to use the Net'ork-.anager service 'hich

has $een added in SystemRescueCd-"1 6t provides a very user riend(y graphica( too( to conigure

the net'ork 6t makes the net'ork coniguration much easier especia((y i you are attempting toconnect to 'ire(ess net'orks 3his too( is avai(a$(e as a sma(( icon in the task $ar net to the c(ock

'hen you are in the graphica( environment

6 you 'ant to conigure the net'ork $y hand using either the standard iconig command or net-

setup then you have to stop the Net'ork-.anager service irst: ;etc;initd;Net'ork.anager stop

3o conigure the net'ork $y hand rom the te7t mode, you can e7ecute net-setup at she(( promptBou can a(so use the o((o'ing command (ines to conigure a net'ork interace $y hand:

6 your system has supported hard'are, the net'ork interace card 9N6C 'as auto-detected, andthe driver (oaded 3he interace needs to $e assigned an 6/ address and a deau(t gate'ay 3o use

use dynamic coniguration, dhcpcd ethK Ase iconig -a to disp(ay the 6/ address the &C/ server(eased to the interace

3o assign a speciic static 6/ address, enter something (ike that: iconig ethK "L%"28"K"M Ne7t

the deau(t route is conigured For e7amp(e, or an interace at address "L%"28"K"M connected to

a gate'ay at "L%"28"K% enter: route add deau(t g' "L%"28"K%

.ore inormation is at chapter a$out the net'ork

*

Page 4: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 4/174

Sysresccd-manual-en Overview

From SystemRescueCd

Jump to: navigation, search

Description

SystemRescueCd is a =inu7 system avai(a$(e on a $oota$(e C&-R5. in order to repair your

system and your data ater a crash 6t a(so aims to provide an easy 'ay to do admin tasks on your

computer, such as creating and editing the partitions o the hard disk 6t contains a (ot o systemuti(ities 9parted, partimage, stoo(s, and $asic ones 9editors, midnight commander, net'ork

too(s 6t aims to $e very easy to use: Dust $oot rom the C&-R5., and you can do everything 3he

kerne( o the system supports most important i(e systems 9e7t%;e7t*, reisers, reiser0, 7s, Ds, vat,nts, isoL22K, and net'ork ones 9sam$a and ns

You can use SystemRescueCd for many tasks: 

• 3he irst time you use the computer, 'hen no operating system is insta((ed 3he irst task is

creating partitions on the hard disk, and insta((ing the operating system )ith this C&-R5., you can make partitions easi(y 'ith the graphica( partition too( 4/arted, and you can

insta(( 4entoo =inu7

• #ter a crash, or a mistake, you may have pro$(ems $ooting For e7amp(e, ater insta((ing

)indo's, your $oot(oader 9=6=5, 4ru$ may have $een erased rom the .+R )ith thisC&-R5., you have a(( you need or reinsta((ing 4ru$ or =i(o

• For 'indo's users that dont have =inu7 insta((ed, it provides a tiny =inu7 System 'ith

most important system too(s For e7amp(e, )indo's users can $ackup their system partition using /artimage 3hey need =inu7 to run partimage

Contents

ere is a short (ist that descri$es 'hat you 'i(( ind on this C&-R5.:

• # recent =inu7 kerne(, that supports most important i(e systems, and the most important

hard'are Supported i(e systems: E7t%;E7t*, Reisers, Reiser0, Fat"2;Fat*%, IFS, JFS,

 N3FS, 3he kerne( supports NFS and Sam$a

• 4raphica( partition too(s, that aim to $e ree partition-magic c(ones or =inu7 Bou can use

4/arted

• .ost important conso(e system too(s or =inu7 5 course, you have 4NA /arted 9partition

editor, /artimage 9drive image c(one or $acking up partitions to an image i(e, Fi(esystem too(s 9e%sprogs or e7t%;e7t*, reisersprogs or ReiserFS, reiser0progs or reiser0,

7sprogs or IFS, Dsuti(s or JFS, dosstoo(s or F#3, Nts/rogs or N3FS Bou can use

dump;restore or $acking up an e7t%;e7t* partition

•  Nts-*g 9Nts driver third generation provides a u(( read-'rite support or N3FS partitions

rom =inu7

• C(am-#ntiirus 3his is a ree #ntiirus sot'are

0

Page 5: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 5/174

• Asua( too(s or =inu7 users: tar;gHip;$Hip% or archiving i(es 3he same too(s or )indo's

users: Hip;unHip, rar;unrar, pMHip are provided 3his means that you are a$(e to

 $ackup;restore your 'indo's data )e have added &#R 9&isk #rchiver 3his is a

 program (ike tar, $ut more po'eru(

• .idnight-Commander 9type <mc< on the conso(e command (ine is a ree Norton

Commander c(one or =inu7 )ith mc, its easy to $ro'se, copy, move, edit a(( i(es on

your computer 6 you dont kno' a(( the (inu7 she(( commands 'e((, you can start 'ith mc

• Bou can use (yn7 or (inks +oth are (ight'eight 'e$ $ro'sers Ander Frame+uer mode,

you can pass parameters to the command (ine o the (inks program 6t 'i(( a((o' you to

ena$(e the graphica( mode 6t 'ou(d sho' images, and you get a nice interace

• 5 course, editors are important 'hen you have pro$(ems Nano 9easy editor,vim 9vi

improved and emacs 9emacs c(one are provided or the te7t mode• 3he I5rg ; Ivesa graphica( environments and the )indo'.aker 'indo' manager 6t

a((o's you to use graphica( programs such as 4/arted, editors 9gvim and (eapad, and

Fireo7-%K 9you may need he(p rom internet

Website

/(ease, visit the oicia( homepage 'hen you have pro$(ems

• Bou shou(d read the F#Q 9Freuent(y #sked Questions $eore sending uestions to the

author

• /ost ideas, contri$utions, pro$(ems in the orum: http:;;'''sysresccdorg;orums; 

• 6 you encounter a $ug 9crash, or another kind o error that is rea((y re(ated to this C&-

R5., p(ease, post a detai(ed message in our orums &ont su$mit $ug reports that are

re(ated to sot'are provided $y SystemRescueCd, such as /artimage, 5n(y $ug reports

re(ated to this C&-R5. are va(id 9missing modu(e in the kerne(, a $oot script thatcrashes,

• /(ease, do'n(oad the (atest version avai(a$(e $eore su$mitting $ugs or ideas Bour reuestmay have $een a(ready processed

1

Page 6: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 6/174

Downloadin

SystemRescueCd is provided as an 6S5 image i(e to $e $urned to a C& and 'i(( produce a

 $oota$(e C& SystemRescueCd is not sot'are that can $e run 'ith an e7isting operating system

Bou can do'n(oad the 6S5 image i(e 'ith your avourite $ro'ser Sometimes, the i(e is sho'n inthe navigators main 'indo' instead o $eing do'n(oaded 6 you have pro$(ems, do'n(oad thei(e 'ith 'get oten insta((ed $y deau(t under =inu7, and a 'in*% version o 'get  &o'n(oading

'ith 'get is easy: 'get >address-o-the-iso-i(e?

5nce the i(e is do'n(oaded, check that there 'as no error 'ith md1sum Run md1sum on the iso

i(e 3he output must match the .&1 num$er that is given on this 'e$site

!urnin

Bou can $urn the 6S5 image i(e 'ith most $urning sot'are Ander )indo's, Nero does this very

'e(( Ander =inu7, you can use 'odim 9a(ternative to cdrecord

+urning 'ith 'odim is easy First, type wodim --devices in order to get the identiier or your

device

3hen, type the o((o'ing to actua((y $urn an iso image:

wodim dev=/dev/scXX -v systemrescuecd-x86-x.y.z.iso in a console.

For instance:

wodim dev=/dev/sr0 speed=8 -v sysresccd-x.y.z.iso

ysresccd-manual-en !ootin t"e CD-RO#

From SystemRescueCd

Jump to: navigation, search

Contents

[hide

• " Ena$(e the +65S option

• % Choosing a kerne(

• * +oot options

o *" 4enera( $oot options

o *% ard'are, drivers and trou$(eshooting options

o ** Net'ork coniguration and remote access

• 0 Net'ork $oot using /IE

• 1 5ptions provided or autorun

2

Page 7: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 7/174

• 2 o' to change the deau(t $oot options

• M erne(s provided on SystemRescueC&

o M" standard-kerne(s: 9rescuecd and rescue20

o M% a(ternative-kerne(s: 9a(tker*% and a(tker20

o M* *% $it kerne(s

o M0 20 $it kerne(s

8 +ooting rom the C&-R5.• L +ooting rom the net'ork via /IE

• "K +ooting 'ith an o(d computer

• "" +ooting rom a irtua( .achine

• "% +ooting rom the )indo's partition

$nable t"e !%OS option

3o $oot rom a C&-R5. insure that the +65S is conigured to $oot rom a C& drive $eore thehard disk

3o start SystemRescueCd, insert the C& in the drive, and po'er on or reset your computer

C"oosin a kernel

See Screenshots

/ressing [Enter $oots SystemRescueC& 'ith deau(ts that are a good starting point

3hese kerne(s are avai(a$(e:

• rescuecd &eau(t or *%$it systems, 'ith Frame$uer disa$(ed, $est choice

• rescue&' &eau(t 20 $it kerne( Ase it i you 'ant to chroot to a 20$it (inu7 system

insta((ed on your hard disk, or i you have to run 20 $its programs 3his kerne( is a$(e to

 $oot 'ith *%$it programs, and it reuires a processor 'ith 20$it instructions 9amd20 ;em20t

• altker() an a(ternative kerne( or *%$it systems +oot 'ith this kerne( i you have pro$(ems

'ith rescuecd 

• altker&' an a(ternative kerne( or 20$it systems +oot 'ith this kerne( in case you have

 pro$(ems 'ith rescue&'

!oot options

*eneral boot options

/ress >3#+? to add additiona( options 9in SystemRescueCd-"1 and more recent

• docac"e: causes the C&-R5. 'i(( $e u((y (oaded into memory # s(o'er start $ut once

comp(ete, programs start aster and the C& drive 'i(( $e re(eased a((o'ing norma( access to

other C&s 3his reuires 0KK.+ o memory to cache everything 9inc(uding the bootdisks 

M

Page 8: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 8/174

and isolinux directories #dd lowmem i you have (ess that 0KK.+ o memory o to

 prevent these directories to $e copied

• setkmap+kk : 'hich deines the keymap to (oad 'here kk 9e7amp(e: setkmap=de or

4erman key$oards 3his 'ay you 'ont $e prompted or the key$oard conigurationduring the $oot

• root+,dev,dnp: the root@>device? option $oots an e7isting (inu7 system For e7amp(e, i

you have (inu7 4entoo insta((ed on /dev/sda6, use rescuecd root=/dev/sda6 to start it

eep in mind that you must use a 20$it kerne( i your system is made o 20$it programs

3his option 'orks 'ith =. vo(umes Ase rescuecd

root=/dev/Volroup00/!o"Vol00 Support is a(so provided or root=auto, 'hich scans

a(( the $(ock devices tor a (inu7 system 3he irst (inu7 system ound 'i(( $e started So

'ith root=auto (et you start the system insta((ed rom the C&-R5. in case you have

 pro$(em 'ith your $oot (oader or kerne( 6ts a(so possi$(e to speciy a partition using its

#ilesystem label or #ilesystem uuid 6 the (a$e( o the partition 'here (inu7 is

insta((ed is mylinux, then $oot it using rescuecd root=!$%&!=mylinux Simi(ar(y

root=''()=b*d*bec+-,,a-*e-8,-0d0ecccba See more detai(s

• initscript+service:action : 3his options a((o's start;stop a service at $oot time For

instance i you need the sam$a service to $e started, you can $oot 'ith:initscript=sambastart 3his does the same thing as /etc/init.d/samba start Ase

this option mu(tip(e times or dierent services #(( the actions that are supported $y an

initscript can $e used

• backstore+: SystemRescueCd comes 'ith support or the $acking-stores # $acking-

store saves a(( the changes you can make so that you keep these changes the ne7t time you $oot it +y deau(t, sysresccd automatica((y scan remova$(e devices 9eg: AS+ sticks at

 $oot time and uses the irst $acking-store it inds # $acking-store is not mandatory and it

the scan ai(s it 'i(( store the i(es 'hich change in memory 3o disa$(e the disks scan at $oot time speciy backstore=o## on the $oot command (ine 6 you 'ant to save your

 $acking-store i(e on an harddisk, $oot 'ith backstore=alldev to scan a(( devices 9not

 Dust remova$(e devices 3he deau(t (ocation or $acking-stores i(e is any i(e namedsysrcd.bs (ocated at the root o a disk 'hich is oten an AS+ stick Change the path $y

using backstore=/sysrcd/mybackstore.bs See $acking-stores

• isoloop+: 4ru$% 9current(y in deve(opment: gru$-"L8 provides a ne' eature to $oot

rom an 6S5 image 'hich is stored rom the hard disk 6 you put a copy o

systemrescuecd-x86-x.y.z.iso on a partition that 4ru$% can read then you can $oot

SystemRescueCd direct(y rom the 6S5 image stored on your hard drive 3his is veryconvenient i you reuent(y update SystemRescueCd and you 'ant to $oot it direct(y rom

4ru$% 4ru$% kno's 'hat an 6S5 image is and it 'i(( (oad the kerne( image

9rescuecd;rescue20 and the initrams 9initramigH rom the 6S5 into memory 6t 'i(( then

do its norma( Do$ and e7ecute the kerne( 3he SystemRescueCd init script must then $e

a'are that its sysrcd.dat i(e is in an 6S5 and not direct(y on the partition For thatreason, this isoloop=xxx $oot option is reuired so you must use it in your "rub.c#" 3his

option is on(y supported in SystemRescueCd-"0K and more recent 3his option speciiesthe path o the 6S5 image in the partition that gru$ considers as its root partition 6ts

important to understand that the path o the 6S5 image may $e dierent rom the path on

your (inu7 system 6 you have a separate $oot partition mounted on /boot and i you copy

this 6S5 image to /boot/sysrcd/systemrescuecd-x86-x.y.z.iso  then the option has to

 $e isoloop=/sysrcd/systemrescuecd-x86-x.y.z.iso 3his is $ecause the $oot

 partition is 'hat 4ru$% 'i(( consider as its root partition during the $oot process /(easeread the section a$out iso(oop or more detai(s

8

Page 9: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 9/174

.ardware/ drivers and troubles"ootin options

• dodebu: Ena$(es ver$ose messages in (inu7rc

• doload+: (oads needed kerne( modu(es, mu(tip(e comma separated occurrences are

 permitted 9e7amp(e: doload=*c+,x1e000

noload+: prevents (oading kerne( modu(es, mu(tip(e comma separated occurrences are permitted 9e7amp(e: noload=*c+,x1e000 Ase this option i you have a pro$(em 'hen

the system (oads a particu(ar modu(e

• nonet: this 'i(( disa$(e the net'ork auto detection at startup

• scandelay+: pauses 7 seconds during the startup to a((o' s(o' devices to initia(iHe 3his

is reuired 'hen you $oot an AS+ device # de(ay o on(y e' seconds shou(d $e enough

• dodetect: Since version K*1 the auto-coniguration is done in I5rg itse(,

mk782conig is disa$(ed $y deau(t 3his option orces the system to run the mk782conigstartup script and to run the hard'are auto-detection rom this script Ase this option i you

have pro$(ems 'ith the graphica( environment coniguration 3his option rep(aces theoption noxdetect that 'as useu( in previous versions

• nodetect: prevents generic hard'are auto-detection Ase this option i you have pro$(ems

'ith the hard'are auto-detection

• dostart: (oad the I5rg graphica( environment

• forcevesa: Forces I5rg to use the sae ES# driver instead o the $est video driver

detected or your video card Ase this option i you cannot get the graphica( environment'orking 'ith the deau(t options

• forcevesa+: 3he startx command 'i(( (oad the Xvesa server instead o Xor", and use

the screen reso(ution given as parameter 9eg: 02x68, 280x02x*2

• all-eneric-ide: 6n case o pro$(ems re(ated to your hard disk, try to ena$(e this option 9eg

rescuecd all-"eneric-ide

• nodmraid: &isa$(e dmraid, or some mother$oards 'ith $ui(t-in R#6& contro((er

• nomdadm: &isa$(e mdadm, or sot'are R#6&

• acpi-off  ; noapic ; ir0pool: use these options i you have pro$(em 'hen the kerne( $oots: i

it hangs on a driver or i it crashes,

• lowmem: For systems 'ith sma((er memory, some daemons are not started inc(uding sshd

and nsd

• skipmount+,dev,: 3he system mounts a(( the storage devices at $oot time to ind the

sysrcddat i(e 6 your hard disk is $roken it shou(d $e mounted +oot 'ith

skipmount=/dev/sda skipmount=/dev/sda2 to ignore these t'o partitions

1etwork confiuration and remote access

• nonm: to disa$(e the Net'ork-.anager service that con(icts 'ith the standard net'ork

command (ine too(s such as i#con#i" and ip Bou can use this option i you 'ant to

L

Page 10: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 10/174

conigure the net'ork using these commands 3his option is not necessary 'henSystemRescueCd is $ooting rom the net'ork since the service is automatica((y stopped in

that case 3his option reuires SystemRescueCd-"11 or more recent

• dod"cp: to reuest a &C/ server provide net'ork attri$utes inc(uding an 6/ address,

gate'ay• nod"cp: never run the dhcp c(ient in the initrams $oot script .ay $e useu( i you use

/IE $oot on a computer 'ith severa( ethernet interaces Support or this option is

avai(a$(e in SystemRescueCd-"11-$eta% and more recent

• et"+ipaddr,cidr: Sets the static 6/ address o a(( the ethernet interaces on the system

3he /cidr e7tension is optiona( For instance, i you use option et3x=,2.68.0. on a

machine 'ith t'o ethernet adapters, $oth et30 and et3 'i(( $e conigured 'ith

,2.68.0. Bou can use the ormat et3x=0.0.0./2 9using the cidr notation i you

dont use the deau(t netmask

• et"2+ipaddr,cidr: 3his option is simi(ar to et3x=ipaddr/cidr $ut it conigures on(y one

interace at a time 3o conigure the net'ork on a server that has t'o interaces, use:

et30=,2.68.0./2 et3=,2.68.20.

• dns+ipaddr: Sets the static 6/ address o the &NS nameserver you 'ant to use to reso(ve

the names For instance dns=,2.68.0.2+ means that you 'ant to use ,2.68.0.2+ as the &NS server

• ateway+ipaddr: Sets the static 6/ address o the deau(t route on your net'ork For

instance "ateway=,2.68.0.2+ means that the computer can connect to a computer

outside o the (oca( net'ork via ,2.68.0.2+

• d"cp"ostname+my"ost: Sets the hostname that the &C/ c(ient 'i(( send to the &C/

server 3his may $e reuired i the deau(t hostname cannot $e used 'ith your &C/coniguration 3his option has $een introduced in SystemRescueCd-"*1

• rootpass+3)('4&: Sets the root pass'ord o the system running on the (ivecd to 2* 3hat

'ay you can connect rom the net'ork and ssh on the (ivecd and give 2*+6 pass'ord as

the root pass'ord

vncserver+:3)('4&: 3he vncserver $oot option has $een introduced in SystemRescueCd-"K% 3his options orces the system to conigure the NC-server and to start it

automatica((y at $oot time Bou have to rep(ace x 'ith the num$er o disp(ays you 'ant,

and 2*+6 'ith your pass'ord 3he pass'ord must $e $et'een 1 and 8 characters, e(se the

 $oot option 'i(( $e ignored 6n other 'ords the vncserver=24y5as7d option 'i(( give

you access to t'o disp(ays 9disp(ay@" on tcp;1LK" and disp(ay@% on tcp;1LK% &isp(ay K isreserved or I5rg since SystemRescueCd-""K

• nameif+: Bou can can speciy 'hat interace name to give to a particu(ar interace

using the mac address Bou need SystemRescueCd-""K or ne'er to do that ere is ho'you can speciy 'hich interace is using 'hich mac address on a machine 'ith t'o

net'ork interaces: namei#=et3000092,+)06&1et300092,+)06 +e

careu(, you have to respect the separator 9comma $et'een the interaces and e7c(amationmarks $et'een the name and the mac address Bou can a(so use the magic key'ord

+5536F 'ith SystemRescueCd-"10 and more recent 'hen you $oot rom p7e(inu7 3he

 p7e$oot (oader 'i(( set +5536F to the name o the interace used to $oot Bou can thenuse something (ike namei#=et30%::;(< i you 'ant the $oot interace to $e ca((ed et30 

on a computer 'ith severa( Ethernet interaces

1etwork boot usin 56$

"K

Page 11: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 11/174

SystemRescueCd provides severa( options or $ooting rom the net'ork using /IE 3hese optionscan $e com$ined 'ith other net'ork $oot options such as et3x 9c previous section See /IE

net'ork $ooting to get a g(o$a( overvie' o SystemRescueCd and /IE and .anage remote

servers using /IE

3he second stage do'n(oads the kerne( G initrams using &C/;3F3/

3he third stage o the /IE $oot process acuires the root i(es system

Severa( protoco(s are avai(a$(e

• netboot+ttp:,,ip,pat",sysrcd7dat: rom a 3F3/ server 3he i(esystem is (oaded into

memory #s a conseuence computers 'ith (ess than 0KK.+ o memory 'ont $e a$(e to

 $oot this 'ay 3he system 'i(( continue to 'ork i the net'ork is disconnected ater the $oot process

• netboot+http:,,ip:port,pat",sysrcd7dat : rom a )e$ server 3he i(e system is (oaded into

memory Computers 'ith sma((er memory 'ont $e a$(e to $oot this 'ay 3he the systemcontinues to 'ork i the net'ork is disconnected ater the $oot process

• netboot+ns:,,ip:,pat": mount an NFSv* directory 3he NFS ur( must $e the path o the

directory that contains sysrcd.dat 5n(y NFSv* can $e used, NFSv0 is not supported

 NFS it a((o's computers 'ith sma((er memory to $oot SystemRescueCd rom the net'ork#ter the $oot process, the connection is reuired or you 'i(( (oose the access to the root

i(e system

• netboot+n$d:,,ip:port: connect to an N+& server conigured 'ith sysrcd.dat on ip:port

 N+& is easier to conigure than NFS 9on(y one 3C/ port invo(ved and it a((o's computers

'ith sma((er memort to $oot SystemRescueCd rom the net'ork #ter the $oot process,

the connection is reuired the access to the root system

For inormation on activating speakup, see the speakup ino page

Options provided for autorun

• ar8source+: p(ace 'here the autorun are stored 6t may $e the root directory o a

 partition 9/dev/sda, an ns share 9n#s//,2.68../pat3/to/scripts, a sam$a

share 9smb//,2.68../pat3/to/scripts, or an http directory

93ttp//,2.68../pat3/to/scripts

• autoruns+92-;: comma separated (ist o the autorun scrip to $e run For e7amp(e

autoruns=0121 the autorun sc autorun0, autorun2, autorun are run Ase

autoruns=no to disa$(e a(( the autorun scripts 'ith a num$er

• ar8inorefail: continue to e7ecute the scripts chain even i a script ai(ed 9returned a non-Hero status

• ar8nodel: do not de(ete the temporary copy o the autorun scripts (ocated in

/var/autorun/tmp ater e7ecution

• ar8disable: comp(ete(y disa$(e autorun, the simp(e autorun script 'i(( not $e e7ecuted

• ar8nowait: do not 'ait or a keypress ater the autorun script have $een e7ecuted

For more detai(s, p(ease read the chapter a$out autorun 

""

Page 12: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 12/174

.ow to c"ane t"e default boot options

6 you oten use the same options create your o'n persona(iHed SystemRescueCd and edit

syslinux.c#" to add your options Fo((o' this instruction  Ase the sysresccd-custom script to

e7tract the current i(es o the (ivecd, edit isolinux.c#" 9syslinux.c#" 'ith AS+ keys, and

recreate the 6S5 image

6 you use the net'ork $ooting via /IE eature edit pxelinux.c#"/de#ault on your /IE $oot

server

<ernels provided on SystemRescueCD

standard-kernels: =rescuecd and rescue&'>

• recent (inu7 version 'ith its patches: (inu7-%2*%L

• kerne( sources are $ased on vani((a 9its sta$(e 'ith the sysresccd patchset

 $oth 6&E and S#3# hard disk drivers are $ased on the (i$sata 9a(( disks are sda, sd$, • a(most a(( disk-contro((ers 96&E, S#3#, SCS6 and net'ork drivers are compi(ed as

modu(es 9so that you can use noload-xxx i it hangs

• supports the rame $uer, the rame $uer can $e ena$(ed 'ith the $oot option 9vga@777

• the standard kerne( is preered i you 'ant to use 'ither e7t0 or $trs

alternative-kernels: =altker() and altker&'>

• sta$(e (inu7 version version: (inu7-%2%M01

• kerne( sources are $ased on (inu7-%2%M 9series 'ith (ong term maintenance 'ith the

sysresccd patchset

• the t'o kerne( images are altker() 9*%$it and altker&' 920$it•  $oth 6&E and S#3# hard disk drivers are $ased on the (i$sata 9a(( disks are sda, sd$,

• a(most a(( disk-contro((ers 96&E, S#3#, SCS6 and net'ork drivers are $ui(t-in 9no need to

(oad a modu(e

• no rame $uer support

() bit kernels

• rescuecd and altker*2 are the t'o *%$it kerne(s provided

• any 6nte(;#.&;6# $ased processor shou(d 'ork 'ith the *%$it kerne(

• you can run a *%$it kerne(s even i you have a processor that supports 20$it instructions

9amd20 ; em20t• you can 'ork 9$ackup;restore 20$it programs 'ith a *%$it kerne(

• you cannot c3root on an e7isting (inu7 partition 'ith 20$it programs 'ith a *%$it kerne(

&' bit kernels

• rescue6 and altker6 are the t'o 20$it kerne(s provided

• 20$it kerne(s 'i(( 'ork on(y i your processor supports amd20 9#.& imp(ementation o

782O20 or em20t 96nte( imp(ementation o 782O20 instruction set

"%

Page 13: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 13/174

• 20$it kerne(s do not 'ork on ($6 / (tanium processors

• you must use a 20$it kerne( i you 'ant to c3root to a (inu7 system using 20$it programs

• 20$it kerne(s can e7ecute *%$it programs since the 6#*% instructions support is inc(uded in

the kerne(

!ootin from t"e CD-RO#

5nce you have pressed <Enter< at the prompt, the system 'i(( $egin to (oad First, i you didnt

disa$(e this option, the map or your key$oard 'i(( $e (oaded Bou Dust have to choose the $est one

or you Ne7t, the kerne( 'i(( continue to (oad, and there 'i(( $e many $oot scripts that are run 3hehard'are coniguration 'i(( $e autodetected For e7amp(e, a(( kerne( modu(es reuired or an AS+

mouse 'i(( $e (oaded automatica((y #nd you 'i(( get a she(( prompt Bou have severa( (inu7

conso(es avai(a$(e Bou can change $et'een them $y pressing #(tGF" or the irst one, #(tGF% orthe second,

!ootin from t"e network via 56$

6ts a(so possi$(e to $oot SystemRescueCd rom the net'ork Since the insta((ation is not o$vious,

there is a dedicated chapter to net'ork $ooting via p7e

!ootin wit" an old computer

.any o(d computers cannot $oot a C&-R5. 3he pro$(em may come rom the +ios, rom the C&

drive, 6 you have such a pro$(em, you can try to create a $oot (oppy, that a((o's to to start the

system on the C&-R5. Smart+oot.anager can do such a $oot (oppy or you 6 you have no(oppy, you can insta(( this $oot(oader on the hard disk too Asing this $oot manager is easy Bou

must do'n(oad s$minst, and run the insta((er rom =inu7 ere is the most common insta((

 process:

./sbminst -t us -d /dev/#d0

!ootin from a ?irtual #ac"ine

6ts possi$(e to use SystemRescueCd rom )indo's or =inu7 'ith a comp(ete computer emu(ator,such as .)are and irtua( /C Bou have to dec(are the 6S5 image as the virtua( C&-R5.

drive 6n the virtua( +65S, you must ask the computer to $oot on the C&-R5. 6ts even possi$(e

to use the net'ork 3he virtua( machine 'i(( have a ne' 6/ address

!ootin from t"e Windows partition

6ts no' possi$(e to insta(( SystemRescueCd on an N3FS ; F#3 partition used $y )indo's 6t

means you dont have to partition your disk, and you can even $oot SystemRescueCd i there is no

cdrom drive in your computer

"*

Page 14: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 14/174

Sysresccd-manual-en Startin to use t"e

system

)hen you start, you shou(d read the messages that give you the most important inormation a$outho' to use this system Bou shou(d read the te7t

Bou can (ogin on another conso(e 3he root pass'ord is empty 3ype d3cpcd et30 9or simi(ar to

auto-conigure ethK 3ype net-setup et30 to speciy ethK 6/ address settings $y hand

3o start an ssh server on this system, type /etc/init.d/ss3d start 6 you need to (og in

remote(y as root, type passwd root to reset roots pass'ord to a kno'n va(ue

6 you need graphica( too(s 9such as 4/arted you 'i(( have to enter in the graphica( environment

Check you are using SystemRescueCd-"KK or ne'er, and Dust type wizard in the conso(e Bou

'i(( have the choice $et'een t'o graphica( environments: Iorg and Ivesa Bou shou(d try Iorg

irst 6 Iorg ai(s to start, run 'iHard again and choose Ivesa Ivesa shou(d a('ays 'ork, $ut the

dra'$ack is its not optimiHed or your hard'are Bou must use a *%$its kerne( 9either rescuecd or

a(tker*% in order to use Ivesa 6n other 'ords Ivesa does not 'ork on 20$its kerne(s 9rescue20and a(tker20

Bou may need to use an editor Editors avai(a$(e: vim, nano, emacs in conso(e mode Bou can use

gvim and (eapad in graphica( environment

 Note: Never mount anything on /mnt P 6t 'ou(d reeHe the system Ase mkdir /mnt/mydir and

mount on /mnt/mydir instead

Sysresccd-manual-en 1etwork 

From SystemRescueCd

Jump to: navigation, search

)ith the System Rescue C&, you 'i(( $e a$(e to use the net'ork ere are the mainimportant inormation a$out the net'ork

Contents

[hide

• " Net'ork coniguration too(s

• % Setting up the net'ork $y hand

• * Running an SS Server

• 0 #ccess a Share on a )indo's computer 'ith C6FS

• 1 .ount remote F3/;SS shares as (oca( i(e systems

"0

Page 15: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 15/174

1etwork confiuration tools

6 your system has supported hard'are, the ethernet or 'ii net'ork adapter 9N6C shou(d $e

automatica((y detected, and the driver (oaded 3he interace needs to $e assigned an 6/ address and

a deau(t gate'ay

SystemRescueCd-"1% and more recent versions come 'ith Net'ork-.anager 6t provides a veryuser riend(y graphica( interace to conigure the net'ork 6t makes the coniguration easier

especia((y or 'ire(ess net'orks For instance 'ire(ess net'ork 'i(( $e automatica((y detected and

connecting to them is very easy 3he Net'ork-.anager is avai(a$(e as a sma(( icon in the task$ar Dust ne7t to the c(ock 3he Net'ork-.anager is on(y avai(a$(e in the graphica( environment

Bou can a(so conigure the net'ork 'ith other too(s (ike the standard i#con#i" or ip commands

6n that case you have to stop the Net'ork-.anager irst, e(se it 'i(( con(ict and you 'i(( (ooseyour settings Bou can so that either $y running /etc/init.d/etwork4ana"er stop in the she((

or $y $ooting SystemRescueCd 'ith the nonm $oot option Support or this option has $een added

in SystemRescueCd-"11

6 you are $ooting SystemRescueCd rom the net'ork or i you are using $oot options such as

et3x or dod3cp the Net'ork-.anager service 'i(( automatica((y $e stopped

3he o((o'ing sections o this chapter e7p(ain ho' to use the net'ork using (inu7 commands Bou

dont have to read it i you 'ant to use the Net'ork-.anager

Settin up t"e network by "and

3o use use dynamic coniguration, d3cpcd et30 Ase i#con#i" -a to disp(ay the 6/ address the

&C/ server (eased to the interace

3o assign a speciic static 6/ address, enter something (ike that: i#con#i" et30 ,2.68.0.

Ne7t the deau(t route is conigured For e7amp(e, or an interace at address "L%"28"K"Mconnected to a gate'ay at "L%"28"K% enter that: route add de#ault "w ,2.68.0.2

SystemRescueCd provides net'ork $oot options such as et3x1 dns1 "ateway1 dod3cp that

a((o's you to automatica((y conigure the net'ork 'hen SystemRescueCd starts 6ts very useu( iyou 'ant to $oot SystemRescueCd rom the net'ork using /IE $ut it can $e used in any case 6t

can $e very useu( i you p(an to make a make customiHed versions o the C&

Read the chapter a$out +asic 6/ coniguration too(s on =inu7 or detai(s a$out ho' to conigure

3C/;6/ rom the command (ine on a machine running =inu7

See a(so the o((o'ing F#Q: 6 cannot access other hosts on the net'ork  

Runnin an SS. Server

SS a((o's you to use a she(( on another computer 9as te(net does, and you can copy i(es 9'ith

scp 6 you 'ant to run an SS server, you have to change the root pass'ord Just type passwd 

"1

Page 16: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 16/174

and give a va(id pass'ord Bou can a(so use the rootpass=xxx $oot option $eore

SystemRescueCd starts to deine the root pass'ord

3he ssh server is automatica((y started $ut you can type the o((o'ing command any'ay:

/etc/init.d/ss3d restart Bou can stop it 'ith /etc/init.d/ss3d stop 5 course you can

a(so use SystemRescueCd as an SS c(ient to connect to an SS server: Dust use ss3

lo"in>ss3.server.or" or scp source dest +oth source and dest may $e (oca( or remote Ase

lo"in>ss3.server.or"/pat3/#ilename or remote i(es

@ccess a S"are on a Windows computer wit" C%FS

SystemRescueCd comes 'ith the sm$s;cis c(ient package that a((o's you to connect to a

)indo's machine having shared drives 6n recent kerne(s support or smb#s has $een rep(aced

'ith ci#s so you shou(d not try to use smb#s

3he mount-cis package a((o's you to access a )indo's computer on the net'ork ere is an

e7amp(e to e7p(ain ho' to access )indo's shared o(ders =ets consider the )indo's $o7 is on

"L%"28"K* and has a shared directory ca((ed mydata accessi$(e $y the user ca((ed robert:

mount -t ci#s //,2.68.0.*/mydata /mnt/windows -ousername=robert14y5as7o?d=root -o l#scd /mnt/windows

 No' you shou(d $e a$(e to see i(es in /mnt/windows &ont orget to unmount the directory 'hen

you have inished 'hat you are doing in the shared directory

umount /mnt/windows

6ts important not to orget option <(s< 9=arge Fi(e Support, $ecause it a((o's to hand(e i(es that

are (arger than % 4+ +ig i(e are oten used 'hen making a $ackup or an image i(e )ithout thisoption, the copy 'ou(d ai(, 'ith an error

#ount remote FA5,SS. s"ares as local file systems

6 you 'ant to access i(es (ocated on an F3/ server, there is a ne' very po'eru( 'ay to do this

3he <Aser(and Fi(eSystem< a((o's you to mount the share, and 'ork on the remote i(es Dust asyou 'ou(d 'ork on any (oca( i(es )ith a(( these i(e systems, you can umount the share 'ith the

standard umount command ere is an e7amp(e o ho' to mount an F3/ i(e system in /mnt/#tp 

as anonymous 9read on(y

mkdir /mnt/#tplu#is #s=#tp#s13ost=#tp.kernel.or" /mnt/#tp -scd /mnt/#tpumount /mnt/#tp

ere is an e7amp(e o ho' to mount an SS i(e system in /mnt/ss3 as anonymous 9read on(y

mkdir /mnt/ss3passwd rootss3#s lo"in>ss3.server.or"/pat3/to/dir /mnt/ss3

"2

Page 17: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 17/174

cd /mnt/ss3umount /mnt/ss3

Sysresccd-manual-en System software

From SystemRescueCd

Jump to: navigation, search

3his C& aims to provide a(( the important pieces o sot'are or system recovery andadministration 3his page sho's the most important tasks

Contents

[hide• " +acking up the partition ta$(e

• % +acking up the contents o a partition

• * #rchivers

• 0 C(am #ntiirus

• 1 4raphica( /artition 3oo(s

!ackin up t"e partition table

sdisk is a tiny program 'hich saves the partition ta$(e to a regu(ar i(e and on(y takes a e'

seconds #s an initia( step or system recovery before making things 'orse &o it nowP For

e7amp(e

s#disk -d /dev/3da @ 3da.082*.2*+,.part;able 'i(( make a $ackup

Copy the $ackup to another hard disk, remova$(e media 9thum$ disk, (oppy or C& or tp it toanother computer

cat 3da.082*.2*+,.part;able A s#disk /dev/3da 'i(( restore partition ta$(e 3his

command is very dangerous, $ecause it over'rites the e7isting partition ta$(ePPP

+eore restoring, you shou(d $ack up the current version, even i it seems to $e damaged 3his'ou(d a((o' you to undo the restoration

&o it nowP

!ackin up t"e contents of a partition

"M

Page 18: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 18/174

/artimage 9c(ient and server are provided /artimage a((o's you to save an e7isting partition intoan image i(e 6 something goes 'rong, you can restore the partition rom the image # semi-te7t

interace is provided, and this shou(d not $e very hard to use Bou need a partition 'ith a (ot o

ree space in order to store the image i(e

Since version K%"0 o SysRescCd, t'o partimage versions are provided:

• 3he deau(t version is compi(ed 'ithout SS= and 'ithout (ogin support 3he c(ient is

avai(a$(e $y typing <partimage<, and the server 'ith <partimaged< Bou shou(d use this

c(ient in most cases, and 'hen you connect a partimaged server that does not support SS=

• 3he secured version is compi(ed 'ith SS= and (ogin support 3he c(ient is avai(a$(e $y

typing <partimagess(<, and the server 'ith <partimagedss(< Bou shou(d use this c(ient 'hen

you connect a partimaged server that e7pects and SS= encrypted connection 'ith (ogin

@rc"ivers

SystemRescueCd comes 'ith a (ot o archive programs Bou can use Hip;unHip or the 6/ ormat,

and rar;unrar or the R#R ormat Even the ne' MHip is supported 'ith the pzip command

&ar is an archiver (ike tar +ut its more po'eru( Even using compression dar does not have to

read the 'ho(e $ackup to e7tract one i(e 3his 'ay i you Dust 'ant to restore one i(e rom a huge $ackup, the process 'i(( $e much aster than using tar &ar irst reads the cata(ogue 9ie the

contents o the $ackup, then it goes direct(y to the (ocation o the saved i(e9s you 'ant to restore

and then proceed to restoration 6n particu(ar using s(ices dar 'i(( ask on(y or the s(ice9s

containing the i(e9s to restore +ut you can a(so restore a(( i(es rom an archive, dar 'i(( thenread seuentia((y 'ithout seeking into the i(e, e7cept or the irst and (ast s(ice, dar 'i(( not ask

t'ice or the same s(ice

Clam @nti?irus

C(am #ntiirus is a ree anti-virus sot'are provided since version K%* o SystemRescueCd 6t provides severa( important commands:

• freshclam  3his command updates the virus deinitions 5 course, you need to $e

connected to internet or updating

• clamscan -r /path/to/dir 6t scans a(( i(es o this directory an search or viruses

+eore scanning or virus, you have to update virus deinitions +ecause this is run rom a C&-

R5., you may have read-on(y re(ated pro$(ems 3hats 'hy you have to speciy a read-'rite

directory or deinitions ere is ho' to update deinitions and make a scan:

• Step-K": ensure you are connected to the internet

• Step-K%: &o'n(oad the (atest virus deinitions $y running the o((o'ing commands:

c3own clamavclamav /var/lib/clamavc3own clamavclamav /var/lib/clamav/B#res3clam

• Step-K*: .ount the partition to $e scanned

"8

Page 19: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 19/174

mkdir -p /mnt/testpartmount /dev/3da /mnt/testpart

• Step-K1: /erorm the scan on the i(es

clamscan -r /mnt/testpart

6 you rea((y dont have any internet connection, you can scan or virus 'ithout updating virus

deinitions 5 course, its (ess sae, and on(y o(d virus can $e detected

*rap"ical 5artition Aools

3his C& provides a /artition-.agic c(one, 'hich aims to $e very easy to use, and very po'eru(

Running this too( is very easy, $ut you need to have the I5rg graphica( environment 'orking

/(ease reer to the $oot process i you dont kno' ho' to 'ork in I5rg Bou can run 4/arted $ytyping this command: "parted, or rom the conte7tua( menu on the desk

Sysresccd-manual-en #ountin an 1AFS

partition wit" full Read-Write support

From SystemRescueCd

Jump to: navigation, search

%ntroduction

 N3FS 9Ne' 3echno(ogy Fi(e System is a very po'eru( i(e system provided 'ith N3 versions o

)indo's 9)indo's-N3, )indo's-%KKK, )indo's-I/ Even i )indo's sti(( supports F#3, the)indo's system disk is oten ormatted in the N3FS ormat =inu7 oers a u(( read support or

 N3FS partitions or a (ong time +ut the N3FS 'rite support that comes 'ith the kerne( is sti((

 partia( 3he 'rite support 'as improved in (inu7-%2"1 6 you 'ant a u(( read-'rite support or

 N3FS disks, you 'i(( have to use Nts-*g 9Nts third generation driver, that is a userspace program )ith c(amav and Nts-*g, you can check and repair viruses on your 'indo's system

Read only support

6 you Dust 'ant a read support on N3FS disks, you Dust have to mount it 'ith the o((o'ingcommand 9you have to rep(ace 777 'ith the device name o your disk:

mount -t nt#s /dev/xxx /mnt/windows -o ro

3his read-on(y support is sae 9you cannot a(ter or damage your data and may $e used or e7amp(ei you Dust 'ant to $ackup severa( i(es, or read a document

Full Read-Write support"L

Page 20: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 20/174

6 you rea((y need a comp(ete N3FS )rite support, you 'i(( have to use Nts-*g 6ts very easy touse:

nt#s-*" /dev/sda /mnt/windows

6n this e7amp(e, 'e suppose the device name o the N3FS partition is /dev/sda and the mount

 point is /mnt/windows 6 you dont kno' the device name, you shou(d (ist partitions 'ith cat

/proc/partitions or use 4/arted

Sysresccd-manual-en System boot floppy disks

From SystemRescueCd

Jump to: navigation, search

Contents

[hide• " 6ntroduction

• % 5vervie' o the $oot (oppy disks

o %" 5(ine N3 /ass'ord and Registry editor

o %% Free&os

o %* .em3estG

o %0 4#4: 4raphica(-+oot-.anager

o %1 Ranish /artition .anager

o %2 &$an 9&ariks +oot and Nuke

o %M #ida

%ntroduction

5 course, the most important eature o SystemRescueCd is the =inu7 system that is run rom theC&Rom, and that a((o's to do many administration tasks Since version K%L, SystemRescueCd

a((o's to 'ork rom virtua( $oota$(e (oppy disks 3hese virtua( (oppies oers the same eature

you cou(d have 'ith a physica( (oppy disk you $oot on 'hen you start your computer Fore7amp(e, severa( users need system &5S programs 3hey start rom a &5S (oppy disk, and they

can run these too(s SystemRescueCd comes 'ith severa( system (oppy disks 3he (oppy (ist

appears 'hen you press F% in the very irst prompt 3his page sho's many option on the top, and

(oppy disks images at the $ottom 6n the ne7t section, 'e 'i(( have an overvie' o each o them

Overview of t"e boot floppy disks

Offline 1A 5assword and Reistry editor

Just type this image name at prompt:

ntpass

%K

Page 21: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 21/174

3his program a((o's to change system inormations 'ritten in the )indo's settings 3he mostinteresting one is the a$i(ity to change the pass'ord o a user account No', you 'ont have to

reinsta(( )indo's i you orget the pass'ord o the administrator account Bou Dust have to edit

the pass'ord 'ith this uti(ity 3his program a(so a((o's to edit the )indo's registry 6t 'ork even'hen )indo's is insta((ed on an N3FS disk

FreeDos

Just type this image name at prompt:

#reedos

Free&os is a ree operating system compati$(e 'ith .S-&5S 6t a((o's to run &5S programs suchas /artition .agic or &rive 6mage 'ithout any .S-&5s (icense

#emAestB

Just type this image name at prompt:

memtest

.emtestG "K is an update o .emtest-782 *K 6ts a memory tester 3his program 'i(( te(( you iyour physica( memory is damaged or not

*@*: *rap"ical-!oot-#anaer

Just type this image name at prompt:

"a"

4#4 is a $oot manager, such as =i(o, 4ru$, or +oot-.agic 6t aims to $e very nice and easy touse

Ranis" 5artition #anaer

Just type this image name at prompt:

ranis3

Ranish /artition .anager is a (o' (eve( partition manager such as Fdisk, $ut its more po'eru(

Dban =Dariks !oot and 1uke>

Just type this image name at prompt:

dban

&$an is a $ootdisk that a((o's to destroy a(( data o a computer +e a'are its dangerous to use

Bou can use d$an i you 'ant to $e sure no$ody can $e a$(e to read data o a computer For

%"

Page 22: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 22/174

e7amp(e, i you 'ant to give your computer to someone, and your computer had important data,you can use d$an $eore giving the computer 6t 'i(( 'ipe a(( data rom a(( hard disks

@ida

Just type this image name at prompt:

aida

#ida is an advanced diagnostic system program 6t 'i(( detect many pieces o hard'are o yourcomputer, such as the /rocessor, chipset, main$oard, net'ork card, 6ts very useu( 'hen you

'ant to do'n(oad a driver and you dont kno' 'hich one to take

Sysresccd-manual-en .ow to personalie

SystemRescueCd

From SystemRescueCd

Jump to: navigation, search

Contents

[hide

• " 6ntroduction

• % Asage

• * Step-K": .ount the 'orking partition

• 0 Step-K%: E7tract the current i(es rom the sysrcddat image

• 1 Step-K*: CustomiHe 9optiona(• 2 Step-K0: #dd your o'n packages 9optiona(

o 2" Step-K0a: Reuirements to compi(e programs

o 2% Step-K0$: &o'n(oad and e7tract a recent portage snapshot

o 2* Step-K0c: Chroot in the sysresccd environment

o 20 Step-K0d: o' to insta(( a ne' package

o 21 Step-K0e: 3rou$(eshooting compi(ation pro$(ems

o 22 Step-K0: Summary o the 4entoo commands

o 2M Step-K0g: States o the packages in gentoo

• M Step-K1: Remove unneeded deve(oment too(s rom the system 9optiona(

• 8 Step-K2: Create the ne' suashs image

• L Step-KM: #dd i(es to the 6S5 image 9optiona(

• "K Step-K8: Se(ect your keymap 9optiona(

• "" Step-KL: Edit $oot options 9optiona(

• "% Step-"K: Create the ne' 6S5 image

• "* Step-"": +urn the 6S5 image

• "0 Step-"%: SynchroniHe your disks

• "1 Resu(t o your changes

%%

Page 23: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 23/174

%ntroduction

+eing a$(e to make ones o'n version o SystemRescueCd is a reuent(y reuested eature +y

com$ining the restoration sot'are and your $ackups you can make your own system and data

recovery disk  3he recovery sot'are is a(ready part o the standard SystemRescueCd so the mostimportant thing to add is your $ackups and you may a(so add your o'n scripts to make the

recovery procedure automatic #(( you need is a recent SystemRescueCd 9version ""K or ne'er isreuired, and some space on your hard drive

3his means you can add i(es to the sysrcd.dat compressed image i(e, 'hich is the i(e system o

SystemRescueCd For e7amp(e, you can add script i(es that make a u(( $ackup o a server, or a

 $inary program that you need 6ts a(so possi$(e to add data i(es, in order to have everything on the

C&Rom 9data and system i(es 'hich a((o' you to restore data For no', its not possi$(e tochange the kerne( 6 you need a kerne( improvement, p(ease su$mit reuests in the orums

3he goa( is to produce a ne' 6S5 image i(e, 'ith an updated sysrcd.dat Bou 'i(( need a recent

oicia( version o the SystemRescueCd C&Rom, and a partition 'ith read-'rite access rom

'ithin (inu7, 'ith at (east 81K .+ 6 you add additiona( items you may need more space

3his operation reuires a (arge amount o memory 9$oth R#. and space on the hard disk 6 you

dont have "%8 .+ o R#., and at (east 81K .+ ree on your hard disk, it 'i(( ai( Bou can

create a s'ap partition in order to avoid pro$(ems 'ith the suashs step in the script

Bou may a(so $e interested in a procedure 'hich e7p(ains ho' to  $ui(d a SystemRescueCd 'ithyour o'n kerne( +asica((y, you irst compi(es a ne' kerne(, and then you make a customiHed C&

using the ne' kerne( and its modu(es

Esae

/ersona(iHation is processed rom the C&Rom system 'ith a script 3his means you must $urn anoicia( SystemRescueCd version, $oot rom an oicia( version, and then make your o'n version

3he script runs rom the C&Rom system #(( necessary i(es are inc(uded

#ssume that the /dev/sda partition is ormatted or (inu7 9e7t%, e7t*, reisers, Ds, , and that it

has at (east 81K.+ ree

6t must be a linu filesystem, $ecause other i(esystem, such as F#3, N3FS dont supports

sym$o(ic (inks and i(es permissions

6 you on(y have a F#3 partition avai(a$(e, create a virtua( (inu7 i(esystem image inside the F#3

 partition:

mkdir /mnt/#atmount /dev/sda /mnt/#atcd /mnt/#atdd i#=/dev/zero o#=#sima"e bs=4 count=8+0mke2#s -< -C #sima"emount -t ext2 -o loop #sima"e /mnt/custom

%*

Page 24: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 24/174

6 you used the docac3e $oot option, the origina( SystemRescueCd disc must $e mounted 'hen

you run the irst step 9e7tract o the script

3his procedure makes the directory customcd at the root o this partition Fi(es (ocated in other

directories 'ont $e aected $y this script 6 you have an o(d version o a persona(iHed C&Rom inthis directory, make a $ackup #(( i(es o /dev/sda/customcd/ 'i(( $e (ostP Bou must use the

name /mnt/customcd since the script e7pects that 3o add ne' packages to your customiHed

rescuecd, you need sysresccd-""K or ne'er

/ost uestions a$out the customiHation in this section o the orums:http:;;'''sysresccdorg;orums;vie'orumphp@%1 

Step-23: #ount t"e workin partition

D mkdir /mnt/customD mount /dev/sdan /mnt/custom

6 you dont 'ant the main temporary directory to $e 'ritten to the root o ;mnt;custom, chooseanother directory For e7amp(e, i the ree space is on an NFS share, use:

D mount -o bind /mnt/n#s/remote-directory /mnt/custom

Step-2): $tract t"e current files from t"e sysrcd7dat imae

D /usr/sbin/sysresccd-custom extract

/mnt/custom is mounted -@ ok

t3ere is enou"3 estimated #ree space 3ere E.... 4%F -@ ok

Bou might 'ant press G$ltHG<H to s'itch to another virtua( conso(e and run d# to see that it is

sti(( running 9 3his has $een kno'n to take over "1 minutes rom a cached sysresccd P

6 there are no errors, the i(es have $een copied to /mnt/custom/customcd/#iles/ 'ith isoroot

containing a$out 0*.+ and #iles containing a$out 8*1.+

D du --max-dept3= -3

Step-2(: Customie =optional> No' customiHe

Bou can do this rom the SystemRescueCd, or restart and do it rom another insta((ed (inu7 system

6 you choose to restart, you must restart rom the SystemRescueCd, and mount custom partition

again 9step-K" #(( the changes must $e made in /mnt/custom/customcd/#iles/ 3his is the

root o the ne' i(esystem

%0

Page 25: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 25/174

Page 26: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 26/174

E7tract the $Hip% version 9good compression:

D tar x#Ip /pat3/to/porta"e-YYYYMMDD .tar.bz2 -9 /mnt/custom/customcd/#iles/usr/

-or- the (Hma version 9very good compression:

D tar x#p /pat3/to/porta"e-YYYYMMDD .tar.lzma -9 /mnt/custom/customcd/#iles/usr/

--lzma

3o veriy portage has $een uncompressed at the right p(ace, check

D du -s /mnt/custom/customcd/#iles/usr/porta"e/sys-kernel/vanilla-sources

Step-2'c: C"root in t"e sysresccd environment

3he insta((ation commands have to $e e7ecuted rom the temporary SystemRescueCd For thatreason, 'e have to run in a chrooted environment:

D mkdir -p /mnt/custom/customcd/#iles/procD mount -o bind /proc /mnt/custom/customcd/#iles/procD c3root /mnt/custom/customcd/#iles /bin/zs3D "cc-con#i" JE"cc-con#i" -cF

Bou can check that you are in the chrooted environment $y (isting the e$ui(d or the vani((a

sources:

D ls -l /usr/porta"e/sys-kernel/vanilla-sources

3o (eave the chrooted environment, type exit rom the she(( 9dont do that no', and

D unmount /mnt/custom/customcd/#iles/proc.

Step-2'd: .ow to install a new packae

 No', (ets insta(( a ne' package Bou can see a(( the supported packages in

/usr/porta"e/pro#iles /ackages are in categories such as app-editor and each supported

version is imp(emented in a separated e$ui(d i(e #s an e7amp(e 'e 'i(( insta(( (eapad

(ight'eight te7t editor $ased on 43

Bou can see the o((o'ing e$ui(d script:

/usr/porta"e/app-editors/lea#pad/lea#pad-0.8..ebuild

3his is the script 'hich 'i(( $e used 'hen 'e insta(( this package

First, 'e run emer"e 'ith -p and -v to see 'hat other packages are needed and ho' it 'ou(d

compi(e:

K emer"e -pv app-editors/lea#pad;3ese are t3e packa"es t3at would be mer"ed1 in order9alculatin" dependencies... done

%2

Page 27: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 27/174

Gebuild H app-editors/lea#pad-0.8. '&=L-emacsL 26 k%;otal packa"e E newF1 ize o# downloads 26 k%

6t means that this is a ne' package 9(ag N, and a(( the dependencies are a(ready insta((ed

Bou can no' do'n(oad a(( the sources i(es 'hich are reuired to compi(e this program:

K emer"e -# app-editors/lea#pad7$?( repository at /mnt/sysresccd/sysresccd-0/porta"e-overlay is missin"a repoMname entry9alculatin" dependencies... done@@@ <etc3in" E o# F app-editors/lea#pad-0.8. #or /@@@ )ownloadin" N3ttp//dist#iles."entoo.or"/dist#iles/lea#pad-0.8..tar."zN--2008-0-2 +22**-- 3ttp//dist#iles."entoo.or"/dist#iles/lea#pad-0.8..tar."z?esolvin" dist#iles."entoo.or"... 26.6+.2,.*+1 +6.+6.2.,+10.2.66.*1 ...9onnectin" to dist#iles."entoo.or"A26.6+.2,.*+A80... connected.O;;5 reCuest sent1 awaitin" response... 200 :P!en"t3 26,,6 E26*PF Gapplication/x-"zipHavin" to Q/usr/porta"e/dist#iles/lea#pad-0.8..tar."zN00D G===============================================@H 26,1,6 22*P/s in.2s2008-0-2 +22* E22* P%/sF - Q/usr/porta"e/dist#iles/lea#pad-0.8..tar."zNsaved G26,,6/26,,6HB lea#pad-0.8..tar."z ?4)60 O$ O$2+6 size R-F ...

6 you have no internet access on this machine, the do'n(oad 'i(( ai( Bou can Dust copy the AR=,do'n(oad it on another machine, and copy the i(e in /usr/porta"e/dist#iles/ 9(ocation in the

chrooted environment Bou dont have to run emer"e -# $eore you insta(( a ne' package, in that

case emerge 'i(( do'n(oad it at insta(( time

3o insta(( the package, Dust run emerge on that package 'ith no option:

K emer"e app-editors/lea#pad9alculatin" dependencies... done@@@ Veri#yin" ebuild mani#ests@@@ %uildin" E o# F app-editors/lea#pad-0.8. #or /B lea#pad-0.8..tar."z ?4)60 O$ O$2+6 size R-F G ok HB c3eckin" ebuild c3ecksums R-F G ok HB c3eckin" aux#ile c3ecksums R-F G ok HB c3eckin" misc#ile c3ecksums R-F G ok H@@@ 'npackin" source...@@@ 'npackin" lea#pad-0.8..tar."z to /var/tmp/porta"e/app-editors/lea#pad-0.8./work@@@ ource unpacked.@@@ 9ompilin" source in /var/tmp/porta"e/app-editors/lea#pad-0.8./work/lea#pad-0.8..........

Step-2'e: Aroubles"ootin compilation problems

# (ot o i(es have $een removed rom SystemRescueCd so that the system is sma((er For instance,

many header i(es have $een removed since they are not reuired to run the sot'are 3he pro$(em

%M

Page 28: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 28/174

is these i(es may $e necessary to compi(e ne' programs 3hats 'hy 'e kept important headeri(es 9such as the 43 header i(es $ecause many programs that you 'ant to insta(( reuires these

headers +ut sometimes you may have compi(ation errors $ecause o that For instance, i you try

to upgrade moHi((a-ireo7, it 'i(( pro$a$(y comp(ain a$out a missing header i(e such as

prtypes.3 and the compi(ation 'i(( ai( 3his header i(e $e(ongs to dev-(i$s;nspr, 'hich is a

dependency o moHi((a-ireo7 3his kind o header i(e has $een removed $ecause not many ne'

 programs may need dev-(i$s;nspr and these i(es 'ere using too much space on the system

#s a conseuence, a(( you have to do is to reinsta(( the dependencies using emerge, so that theseheaders i(es are reinsta((ed on your system 3o see 'hat are the dependencies o a package, you

can run emer"e -epv Spacka"e-name@ 6t 'i(( (ist a(( the dependencies o a program:

K emer"e -epv sys-devel/binutils  ;3ese are t3e packa"es t3at would be mer"ed1 in order  9alculatin" dependencies... done  Gebuild ? H sys-devel/"nucon#i"-200802* 0 k%  Gebuild ? H sys-apps/#indutils-.*.* '&=L-nls E-selinuxF -staticL 0 k%  Gebuild ? H sys-devel/binutils-con#i"-.,-r 0 k%  Gebuild ? H sys-devel/binutils-2.8-r* '&=L-multislot -multitar"et -nls

-test -vanillaL k%  ;otal packa"es E reinstallsF1 ize o# downloads k%

Step-2'f: Summary of t"e *entoo commands

4entoo provides a very po'eru( management system and high(y customiHa$(e packages 6t is not

 possi$(e to descri$e everything here, here are the most important things you may 'ant to do:

• check ho' a package 'i(( $e insta((ed and 'hat are its dependencies:

emer"e -pv Spacka"e-name@ 

• do'n(oad the sources o a package and a(( the dependencies:

emer"e -# Spacka"e-name@ 

• (ist the addresses o the i(es reuired to insta(( a package:

emer"e -p# Spacka"e-name@ 

• insta(( a package and a(( its dependencies:

emer"e Spacka"e-name@ 

• uninsta(( a package $ut keep its dependencies:

emer"e -9 Spacka"e-name@ 

• ask 'hat package a i(e $e(ongs to:

eCuery belon"s /pat3/to/a/#ile 

%8

Page 29: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 29/174

• see a(( the i(es that $e(ongs to a package:

eCuery #iles Spacka"e-name@ 

• see the (ist o the packages insta((ed:

eCuery list 

Step-2': States of t"e packaes in entoo

ere are some useu( things to kno' a$out the state o the packages 6t may $e reuired in case a

 package you need is marked as unsta$(e

• 6n case you 'ant to insta(( a package marked as sta$(e 9it has the key'ord 782 there

shou(d $e no pro$(em

• 6 you 'ant to insta(( a package 'hich is not marked as sta$(e 9it has the key'ord 782,

you 'i(( have to add the package name 9and possi$(y its dependencies in

/etc/porta"e/packa"e.keywords ere is an e7amp(e:

ec3o Lwww-client/mozilla-#ire#ox Tx86L @@ /etc/porta"e/packa"e.keywords

• 6 the package you need is masked, you 'i(( have to add it to

/etc/porta"e/packa"e.unmask

• 3o insta(( an o(d version o a package, you can mask the ne' versions in/etc/porta"e/packa"e.mask 

ec3o L@=www-client/mozilla-#ire#ox-*.0L @@ /etc/porta"e/packa"e.mask

Step-24: Remove unneeded develoment tools from t"e system

=optional>SystemRescueC& comes 'ith deve(opment too(s 9gcc, automake, autocon, cmake, these too(s

are necessary to compi(e ne' programs 3hey are on(y useu( 'hen you insta(( ne' packages, theycan $e removed i you are sure that you 'i(( not customiHe your SystemRescueC& (ater Bou may

a(so remove other packages that you consider unneeded to make your rescuecd sma((er

#(( the commands discussed in this section have to $e e7ecuted rom the chrooted environment9read the previous sections to kno' ho' to chroot

Aninsta(( packages using unmer"e -9 Spk"@ Spk"2@ Spk"*@ ...

+e careu(, its possi$(e to $reak the system 'ith this command Bou can uninsta(( the gentoo

commands themse(ves such as emer"e using emer"e -9 $ut you must uninsta(( a(( the packages at

once: the command 'i(( $e uninsta(( $y itse(, so it 'ont $e avai(a$(e (ater

6 you have e7tracted a portage archive 9such as portage-BBBB..&&tar$H%, remove the

 portage i(es since they use a (ot o space and are on(y necessary to insta(( ne' packages:

rm -r# /usr/porta"e/B

%L

Page 30: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 30/174

)e have created t'o categories o i(es that you may 'ant to remove: devtools and xtools

3he devtools contains a(( the deve(opment stu and the gentoo commands 3he xtoolsS/code

contains all t3e "rap3ical packa"es. 'ninstall Scode@xtools i you 'ant to use

SystemRescueCd or conso(e programs on(y, and i you 'ant the C& to $e sma((er or, aster to

 $oot rom the net'ork or to cache to memory 'ith the docac3e option

3o de(ete devtools:

sysresccd-cleansys devtools

rom the chrooted environment 9un(ike sysresccd-custom 'hich is run rom the main

environment

3o remove $oth devtools and xtools rom the system, uninsta(( xtools irst, or $oth in the

same time:

sysresccd-cleansys devtools xtools

Consider removing /var/cac3e/edb/dep/ 9i it is present 'hich is the cache that makes emer"e aster:

rm -r# /var/cac3e/edb/dep/

Step-2&: Create t"e new s0uas"fs imae

6 you have insta((ed ne' packages using the chrooted environment,

umount /mnt/custom/customcd/#iles/proc

 No' i(es rom /mnt/custom/customcd/#iles/ are read, and put inside the ne' suashs image

and copied to /mnt/custom/customcd/isoroot/sysrcd.dat

# suash i(esystem is compressed 'ith either gHip or (Hma

• 4Hip is very ast 9compress and uncompress $ut has a poorer compression ratio 9the i(e is

 $igger

• =Hma has $etter ratio than $Hip%, $ut its very s(o' to compress 6t decompresses aster so

the system 'i(( $e aster 'hi(e you are using the C&R5. =Hma is the deau(t suashsa(gorithm in SystemRescueCd 6 you dont 'ant to use (Hma, edit /usr/sbin/sysresccd-

custom and add -nolzma to the (ine 'hich e7ecutes mksCuas3#s

3o create the ne' suashs i(esystem:

/usr/sbin/sysresccd-custom sCuas3#s

3his 'i(( take (onger than the e7tract took 9or e7amp(e "M minutes 'ith gHip and 11 minutes 'ith

(Hma

Step-2: @dd files to t"e %SO imae =optional>*K

Page 31: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 31/174

5n(y the $ig suashs image i(e and the iso(inu7 directory are reuired

Bou may add other i(es to the 6S5 image, outside o the suashs image For e7amp(e, you can put

 $ig $ackup i(es on the C&R5., and outside the suashs image, to avoid over(oading the

suashs Copy the i(es a(ong 'ith the sysrcddat, in this directory:/mnt/custom/customcd/isoroot 

D cp -a my-#iles /mnt/custom/customcd/isoroot

Bou may add an autorun script to the root o the C&R5., outside o the suashs image to $e run

at startup 6t a((o's automation o tasks, such as doing a $ackup See the autorun section or more

detai(s

D cp autorun /mnt/custom/customcd/isorootD c3mod ++ /mnt/custom/customcd/isoroot/autorun

.ake sure the siHe o the isoroot directory is not too $ig or the C&R5. 9usua((y MKK .+

D du -s3 /mnt/custom/customcd/

Step-2G: Select your keymap =optional>

6n the oicia( version, SystemRescueCd asks you to se(ect a keymap at startup 6 you 'ant to

avoid seeing this menu and deine a permanent keymap, you can run this command:

/usr/sbin/sysresccd-custom setkmap Syour-keymap@

3he second parameter is the name or the num$er o your keymap in the menu For e7amp(e,French users 'i(( use this:

/usr/sbin/sysresccd-custom setkmap #r

Step-2: $dit boot options =optional>

Bou may 'ant to edit $oot options 9options such as docac3e or dod3cp in the o((o'ing i(e:

/mnt/custom/customcd/isoroot/isolinux/isolinux.c#"  

Bou might 'ant to modiy the sp(ash screen at:

/mnt/custom/customcd/isoroot/isolinux/#boot.ms"  

6t might $e nice to inc(ude a notice (ike

Based on SystemRescueCd from SysRescCd.org

*"

Page 32: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 32/174

Page 33: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 33/174

Sysresccd-manual-en .ow to install

SystemRescueCd on an ES!-stick 

From SystemRescueCd

Jump to: navigation, search

Contents

[hide

• " 6ntroduction

• % # Recommended AS+ insta((ation method rom =inu7

o %" 5vervie'

o %% .ount the C&Rom 6S5 image

o %* /(ug the AS+ stick

o %0 E7ecute the insta((ero %1 Anmount the 6S5 image

• * + Recommended AS+ insta((ation method rom )indo's

o *" SystemRescueCd AS+ insta((er program 9recommended

o *% #(ternative: Fedora (iveus$-creator 9deprecated

• 0 C #(ternative AS+ insta((ation method rom the C&Rom

o 0" 5vervie'

o 0% 6nstructions or manua( insta((ation

o 0* E7amp(e o manua( insta((ation

• 1 & 6nsta((ation rom =inu7 using an e7t*;e7t0 i(esystem

• 2 E .anua( insta((ation method rom )indo's 9deprecated

o 2" overvie'

o 2% step-K": Find the device (etter

o 2* step-K%: Format the AS+-stick as F#3

o 20 step-K*: Copy i(es rom the C&Rom

o 21 step-K0: .ake the disk $oota$(e

• M F .anua( insta((ation rom =inu7 using cp 9deprecated

o M" step-K": Find the device name

o M% step-K%: Reinitia(iHation o the stick

o M* step-K*: Copy i(es rom the C&Rom

o M0 step-K0: .ake the disk $oota$(e

• 8 AS+ keys mode(s kno'n to 'ork

%ntroduction

3his chapter e7p(ains ho' to manua((y insta(( SystemRescueCd on an AS+-stick 6t a((o's to usethis system rom an AS+ stick 9mini hard disk instead o using a C&Rom Bou need a recent

SystemResuceCd, and an AS+ stick 'ith enough space Bou need at (east 1"% .+ e7cept i you

**

Page 34: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 34/174

Page 35: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 35/174

 No' you Dust have to e7ecute the insta((ation script 'hich is at the root o the C&Rom 3his scriptreuires severa( commands to run $ut it 'ont $e a pro$(em 3o $e sure the script 'i(( a('ays

'ork, these commands are part o the C&Rom:

cd /tmp/cdrombas3 ./usbMinst.s3

3his script 'i(( sho' you a (ist o AS+ sticks detected on your system 5n(y remova$(e medias arein the (ist 3his 'ay its not possi$(e to destroy a persistent device $y accident

Enmount t"e %SO imae

 No' you can unmount the 6S5 image

cd Tumount /tmp/cdrom

!> Recommended ES! installation met"od from Windows

6 you are running )indo's on your computer you can do'n(oad and e7ecute a graphica(

insta((ation program that 'i(( insta(( SystemRescueCd on a remova$(e device Bou have to

do'n(oad the 6S5 image o SystemRescueCd-"17 since the insta((er needs it 6t 'i(( e7tract a((i(es rom the 6S5 image to your AS+ stick and it 'i(( a(so insta(( the $oot (oader on the AS+

device 3he AS+ stick must contain a F#3*% i(esystem, 'hich is the case in genera( i you use

your AS+ stick rom computers running )indo's 6 its not the case you can Dust ormat the AS+device again rom the )indo's e7p(orer 9it 'i(( remove a(( i(es it contains Bou have to run this

 program 'ith the )indo's administrator privi(eges since the insta((er has to run sys(inu7 to make

the remova$(e device $oota$(e

SystemRescueCd ES! installer proram =recommended>

+y deau(t you shou(d use the SystemRescueCd AS+ insta((er or )indo's 3his is a uitecompact EIE program that you can e7ecute direct(y 'ith no insta((ation on the hard disk

" Download the most recent SystemRescueCd 6S5 image rom the &o'n(oad page 

% Download SystemRescueCd AS+ insta((er or )indo's 

* 5lu your ES!-stick  and 'ait 1 seconds to (eave enough time or the system to detect it0 $ecute t"e installer that you have Dust do'n(oaded

1 Select t"e %SO imae that you have do'n(oaded previous(y

2 Select t"e ES! stick  in the remova$(e device drop-do'n (ist

M Click on t"e Install button to run the insta((ation

@lternative: Fedora liveusb-creator =deprecated>

6 you have pro$(ems 'ith the SystemRescueCd AS+ insta((er or )indo's you can try the(iveus$-creator rom Fedora 'hich provide the same sort o service, and that is kno'n to 'ork

'e(( 'ith SystemRescueCd-"17:

" Download the most recent SystemRescueCd 6S5 image rom the &o'n(oad page 

*1

Page 36: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 36/174

% Download the 'indo's version o the (iveus$-creator or Fedora =inu7 * $ecute t"e liveusb-creator setup proram 'hich 'i(( insta(( the (iveus$-creator on your

)indo's system

0 $ecute t"e liveusb-creator proram rom the Start menu Dust (ike any other norma()indo's app(ication

1 5lu your ES!-stick  and 'ait 1 seconds to (eave enough time or the system to detect it

2 Click !rowse and se(ect the SystemRescueCd 6S5 image you have do'n(oaded previous(yM Select t"e ES! stick  in the target device

8 Click on t"e Create Live SB button to run the insta((ation

#nother a(ternative insta((ation program is (inu7(iveus$-%1 'hich 'orks 'e(( 'ith

SystemRescueCd-"17

C> @lternative ES! installation met"od from t"e CDRom

Overview

6 you $oot the cdrom edition o SystemRescueCd 9""0 or more recent, you can use it to insta((SystemRescueCd on an AS+ stick 6 you have a (inu7 system on your computer you can a(so use

the irst method 'hich does not reuire to $oot rom a C&Rom at a((

SystemRescueCd comes 'ith a script to he(p you to detect the right AS+ device and to insta((

SystemRescueCd on it Formatting the AS+-stick 'i(( remove a(( its content, so make sure youdont need it or make a $ackup irst

" Download the most recent SystemRescueCd 6S5 image rom the &o'n(oad page 

% !urn it on a cdrom Bou can use sot'are such as Nero or  6mg+urn on )indo's orcdrecord;'odim;k*$ under =inu7

* !oot on t"at cdrom 'ith the deau(t $oot options0 5lu your ES!-stick  and 'ait 1 seconds to (eave enough time or the system to detect it

1 Aype sysresccd-usbstic! dialog in a s"ell then se(ect the correct AS+ device and

 press 5;Enter

%nstructions for manual installation

6nstead o sysresccd-usbstick dialo" you can a(so run the o((o'ing commands $y hand:

" Run sysresccd-usbstic! listdev to see 'hich devices are seen as AS+-sticks

% Run sysresccd-usbstic! "ritembr #### 'here xxx is the name o the us$ device

* Run sysresccd-usbstic! format ### 'here xxx is the name o the partition on yourdevice

0 Run sysresccd-usbstic! copyfiles ### 'here xxx is the name o the partition on your

device

1 Run sysresccd-usbstic! syslinu# ### 'here xxx is the name o the partition on your

device

$ample of manual installation

*2

Page 37: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 37/174

root>sysresccd D sysresccd-usbstick listdev)evice G/dev/sdbH detected as GPin"ston )ata;raveler '* H is removable andsize=,+4%)evice G/dev/sdbH is not mounted)evice G/dev/sdbH 3as one partition /dev/sdb

root>sysresccd D sysresccd-usbstick writembr /dev/sdb;3e device G/dev/sdbH seems to be bi" enou"3 ,+ 4%.

--@ install-mbr /dev/sdb --#orce--@ parted -s /dev/sdb mklabel msdos--@ parted -s /dev/sdb mkpart#s primary #at*2 0 00D--@ parted -s /dev/sdb set boot on

root>sysresccd D sysresccd-usbstick #ormat /dev/sdb;3e device G/dev/sdbH seems to be bi" enou"3 ,+6 4%.mk#s.v#at 2. E2 4ar 200+F5artition /dev/sdb 3as been success#ully #ormatted

root>sysresccd D sysresccd-usbstick copy#iles /dev/sdb;3e device G/dev/sdbH seems to be bi" enou"3 ,+6 4%./dev/sdb success#ully mounted on /mnt/usbstick<ree space on /mnt/usbstick is ,+64%<iles 3ave been success#ully copied to /dev/sdb

root>sysresccd D sysresccd-usbstick syslinux /dev/sdbsyslinux 3as success#ully prepared /dev/sdb

D> %nstallation from Hinu usin an et(,et' filesystem

6 you are a (inu7 user, you may preer having a (inu7 i(esystem such as e7t*;e7t0 instead o vat

on your us$ stick 6t shou(d 'ork 'ith any i(esystem supported $y gru$ such as e7t*, reisers, 6nthat case you can use gru$ instead o sys(inu7 to $oot 3hanks or Christian esse 'ho suggested

these instructions

• Format the us$ stick rom (inu7 using the norma( mks too( that comes 'ith your avourite

i(esystem

6 you are using SystemRescueCd-"% or more recent, its recommended to use an e7t0 i(esystem

'ith the Dourna( turned o 9its possi$(e 'ith (inu7 ?@ %2%L AS+ sticks are (ash i(esystems sothe memory on(y supports a (imited num$er o 'rites 3o preserve the (iespan o the memory 'e

shou(d then (imit the num$er o 'rites and Dourna((ing i(esystems 'i(( make many 'rites access at

the same (ocation 9'here the Dourna( is stored ere is ho' to use e7t0 'ith the Dourna((ing turnedo:

mke2#s -t ext -: U3asMIournal /dev/sd#

Bou cou(d a(so use e7t% $ut it does not support e7tents, and then it reuires more accesses to

read;'rite (arge i(es to the disk

• .ount this i(esystem to ;media;us$stick and copy the i(es rom your rescue cd into this

directory 9c norma( instructions

• Copy gru$ staging i(es rom an e7isting gru$ insta((ation: mkdir -p/media/usbstick/boot/"rub R cp -a /boot/"rub/B /media/usbstick/boot/"rub 

*M

Page 38: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 38/174

• Run "rub-install --root-directory=/media/usbstick/ /dev/sd# 9rep(ace

/dev/sd# 'ith the name o your us$stick

• Create a menu(st in /media/usbstick/boot/"rub/ Bou have to rep(ace E3d01F 'ith

the gru$ name o your us$ partition

timeout +color li"3t-"ray/black li"3t-blue/black

title ystem?escue9d *2bitkernel E3d01F/isolinux/rescuecdinitrd E3d01F/isolinux/initram.i"z

title ystem?escue9d 6bitkernel E3d01F/isolinux/rescue6initrd E3d01F/isolinux/initram.i"z

Bou shou(d no' $e a$(e to $oot rom this us$stick

$> #anual installation met"od from Windows =deprecated>

overview

3his method a((o's to insta(( SystemRescueCd rom a running )indo's system 6ts a $it

comp(icated so you shou(d consider the recommended the previous recommended methods i its possi$(e 6ts Dust reuires $ooting the C&Rom edition o SystemRescueCd on a desktop 'ith a

C&Rom drive and its (ess comp(icated

step-23: Find t"e device letter

Bou have to p(ug your AS+ stick 'hi(e )indo's is running 6n the e7p(orer, a ne' drive (etter

'i(( appear, and you can access the i(e o this AS+ stick 6n this manua(, 'e 'i(( suppose yourAS+ stick (etter is & &ont orget to change this (etter in the commands i reuired

step-2): Format t"e ES!-stick as F@A

First, ormat the device Bou can Dust right-c(ick on the AS+-device in the E7p(orer, and thense(ect <Format<, and choose a F#3 i(esystem 9it 'ont 'ork 'ith N3FS

step-2(: Copy files from t"e CDRom

 No', you have to copy the most important i(es rom the C&Rom 6 you dont 'ant to $urn theC&Rom, you can read the i(es rom the 6S5 $y mounting the disc 'ith a too( such as &aemon-

too(s

" Copy a(( the i(es o the cdrom edition o SystemRescueCd to the root o the AS+ device% Rename the i(e in isolinux 'hich is ca((ed isolinux.c#" to syslinux.c#" 

* Remove the o(d syslinux directory i it e7ists 9it has $een removed in sysresccd-""0

0 Rename the directory ca((ed isolinux to syslinux 

step-2': #ake t"e disk bootable

*8

Page 39: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 39/174

 No', you have to make your stick $oota$(e 'ith sys(inu7 Bou 'i(( have to run this program roma prompt conso(e 9cmde7e &ont orget to change this (etter in the commands i reuired

syslinux -ma &

Bou can ind the sys(inu7 program on the C&Rom /(ease, check you have sys(inu7 version *M0or ne'er 3he )indo's version is provided as a 6/ archive Bou Dust need sys(inu7e7e rom the

archive

Asers have reported that the option ma may $e necessary 'ith sys(inu7 to get it to 'ork 3hats 'hy

'e provides these options in that hand$ook 6t 'orks on(y on )indo's:

• -m means 'rite m$r

• -a means make drive partition active 9aka $oota$(e

F> #anual installation from Hinu usin cp =deprecated>

3his method is a $it comp(icated so you shou(d rea((y consider using the automated insta((ationscript i you are running =inu7 Bou can o((o' it any'ay i you kno' 'hat you are doing, or i

you 'ant to make e7tra customiHations

step-23: Find t"e device name

Bou need the device o the AS+ stick 6n most cases, =inu7 detects this device as an SCS6 hard

disk 6n other 'ords, it is detected as /dev/sda 9irst partition o irst SCS6 device, or

/dev/sdb i you have another SCS6 device Since kerne( %28 AS+ sticks may $e seen as

/dev/uba, /dev/ubb,

ere is ho' you can kno' the device name First, start your computer under =inu7 'ith the AS+stick unp(ugged 3hen, (oad a(( AS+ modu(es 9you may need to (oad other AS+ modu(es irst3his command shou(d not $e reuired i the AS+ storage support is $ui(d-in the kerne( 6

modpro$e cant ind this modu(e, it might $e norma(

modprobe usb-stora"e

 No', you have to p(ug your AS+ stick, and have a (ook at the kerne( messages Bou may ind the

device name using either dmes" A tail -n +0 or #sarc3iver probe 

ere is a e7amp(e o report rom the kerne(:

local3ost kernel usb - new 3i"3 speed '% device usin" e3ciM3cd and address+local3ost kernel usb - ew '% device #ound1 idVendor=+61 id5roduct=2*local3ost kernel usb - ew '% device strin"s 4#r=1 5roduct=21erialumber=*local3ost kernel usb - 5roduct )(P 2.0local3ost kernel usb - 4anu#acturer '%local3ost kernel usb - erialumber 008<*28&6$,90)29<86$local3ost kernel usb - con#i"uration K c3osen #rom c3oicelocal3ost kernel scsi6 9( emulation #or '% 4ass tora"e devices

*L

Page 40: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 40/174

local3ost kernel scsi 6000 )irect-$ccess '% )(P 2.0.00 5 0 $( 2local3ost kernel sd 6000 $ttac3ed scsi "eneric s"6 type 0local3ost kernel sd 6000 Gsd#H 60*+80 +2-byte lo"ical blocks E8.2%/.6 i%Flocal3ost kernel sd 6000 Gsd#H 7rite 5rotect is o##local3ost kernel sd 6000 Gsd#H $ssumin" drive cac3e write t3rou"3local3ost kernel sd 6000 Gsd#H $ssumin" drive cac3e write t3rou"3

local3ost kernel sd# sd#local3ost kernel sd 6000 Gsd#H $ssumin" drive cac3e write t3rou"3local3ost kernel sd 6000 Gsd#H $ttac3ed 9( removable disk

ere you can see that #sarc3iver probe reports a(( devices and partitions ound on your system:

K #sarc3iver probeG======)(P======H G=============$4&==============H G====(W&====H G4$H G4(HGsda H G;*8080$ H G .+* %H G 8H G 0HGsd# H G)(P 2.0 H G .6+ %H G 8H G 80H

G=====)&V(9&=====H G==<(!&Y==H G======!$%&!======H G====(W&====H G4$H G4(HGsda H Gext* H Gboot H G 68.0 4%H G 8H G H

Gsda2 H G!V42MmemberH GSunknown@ H G 6+.8 %H G 8H G 2HGsda* H Gext* H Gspare H G 8.00 %H G 8H G *HGsd# H Gext H Gusb8"b H G .6 %H G 8H G 8H

3hen, you shou(d try to mount the device:

mkdir /mnt/usbstickmount -t v#at /dev/sd# /mnt/usbstick

6 there is no space enough (et on the device 9a$out %*K .+, you 'i(( have to erase the current

i(es 9a(( data 'i(( $e (ost:

rm -r# /mnt/usbstick/B

6n the ne7t sections 'e 'i(( assume your stick is /dev/sd# 6ts rea((y important that you use the

right device name

step-2): Reinitialiation of t"e stick 

3he o((o'ing instructions may not $e reuired, it depends on ho' your AS+ stick is coniguredSo you can try to skip it the irst time #ny'ay in case o pro$(em to get the AS+ stick to $oot,

you shou(d rea((y try that Check you have a $ackup o the data that are on your stick $eore you

do this 3hanks to DadDay in the orums or this addition to the instructions )e assume your device

is /dev/sd# $ut you have to rep(ace it 'ith the device name o your o'n AS+ stick +e rea((y surethis is the right device P

First, run c#disk to check that the partition has the right 6& in the partition ta$(e o your AS+

stick Se(ect type !%$ <$;*2 may $e K+ or KC, to make it $oota$(e

c#disk /dev/sd#

0K

Page 41: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 41/174

Ase mksvat to ormat the partition #(( data 'i(( $e erased, so make sure you dont need the data'hich are on it

mk#s.v#at -< *2 -n Y?&9 /dev/sd#

3he dd command 'i(( over'rite the irst 0K0 $ytes o the .+R  o your stick 6t 'i(( erase the previous $oot instructions 'ith the deau(t ones to make sure that it 'i(( 'ork 6t does not changes

anything to the partition ta$(e since the partition ta$(e is starting at oset 002 in the .+R

dd i#=/usr/s3are/syslinux/mbr.bin o#=/dev/sd#

SynchroniHes to make sure the a(( the changes have $een (ushed to the disk

sync

step-2(: Copy files from t"e CDRom

 No', you have to copy the most important i(es 3he SystemRescueCd disc must $e mounted

on ;mnt;cdrom Bou can mount the 6S5 i(e too, in order to avoid $urning a C&-R 3he stick ismounted on ;mnt;us$stick +e careu(, according to an user in the orums the order matters:

Bou shou(d check that you are using sys(inu7-*M0 or ne'er

cp -a# /mnt/cdrom/B /mnt/usbstick/rm -r# /mnt/usbstick/syslinuxmv /mnt/usbstick/isolinux/isolinux.c#" /mnt/usbstick/isolinux/syslinux.c#"sed -i -e Ns/scandelay=/scandelay=+/"N /mnt/usbstick/isolinux/syslinux.c#"mv /mnt/usbstick/isolinux /mnt/usbstick/syslinux

step-2': #ake t"e disk bootable

 No', you have to unmount the AS+ stick, and make it $oota$(e 'ith sys(inu7 5 course, you haveto rep(ace /dev/sd# 'ith the device name o your stick:

umount /mnt/usbsticksyslinux /dev/sd#sync

#n user reported that ms-sys -s /dev/sdX he(ps in case o pro$(ems So you may think a$out it

i it does not 'ork

ES! keys models known to work 

6ts sometimes a pain to get sys(inu7 to 'ork on an AS+ key ere are some mode(s reported $y

users that are kno'n to 'ork 'e(( 'ith sys(inu7, and on 'hich you must $e a$(e to insta((

SystemRescueCd:

• ingston &ata3rave(er "4+

• C5SEB Si(ver 9e7ists in %4+ or 04+ or 84+

• /Q6, A*"K, " 4o

0"

Page 42: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 42/174

• %4+ CruHer 3itanium 9San&isk A* 3itanium *%M /Q: K #NS6: %

Sysresccd-manual-en $asy installSystemRescueCd on "arddisk 

From SystemRescueCd

Jump to: navigation, search

Contents

[hide

• " 6ntroduction• % First step: copy important i(es

• * Second step: update the gru$;(i(o $ootmanager 9i ou insta(( on =inu7

o *" E7amp(e or =6=5 $ootmanager

o *% E7amp(e or 4RA+ $ootmanager

• 0 Second step: update the gru$0dos $ootmanager 9i you insta(( on )indo's

o 0" a insta(( gru$0dos

o 0% $ update the 'indo's $oot (oader

0%" update your $ootini: )indo's N30;%KKK;%KK*;I/

0%% update your $oot (oader: )indo's ista;%KK8

o 0* c create the C:Tmenu(st i(e

o 00 d check the SystemRescueCd i(eso 01 e re$oot

• 1 +oot the 6S5 image rom the disk using 4ru$%

%ntroduction

Since SystemRescueCd version K07, there is an easy 'ay to $oot SystemRescueCd rom theharddisk 3his method a((o's to use SystemRescueCd as you do 'ith the C&Rom version +ut this

method does not reuire to insert the disc in the drive each time you need it 6t a(so a((o's to $oot

SystemRescueCd i you dont have a C&;&& drive in your computer Bou can use anotheroperating system to process the insta((ation o SystemRescueCd, and ena$(e it 3hus, this method

is recommended i you oten use SystemRescueCd and you 'ant to avoid having to insert the disc

in the drive each time

6t has $een possi$(e to insta(( SystemRescueCd on your hard disk or a (ong time using the the o(dinsta((ation method 6t 'as necessary to have a (inu7 i(e system 9a i(esystem supported $y (i(o or

gru$ 3he insta((ation process 'as done $y e7tracting the main i(esystem rom sysrcddat to a

dedicated (inu7 partition )ith the ne' insta((ation method, you dont have to create a ne' partition on your hard disk Bou can copy these i(es on a a(ready e7isting (inu7 or )indo's

0%

Page 43: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 43/174

 partition o your hard disk Asing gru$0dos you can even insta(( SystemRescueCd on a )indo's partition ormatted in N3FS #(( you have to do is to insta(( the i(es that are on the

SystemRescueCd disc on an e7isting partition o your hard disk, that can $e either a (inu7 partition

9e7t*, reiser, 7s, or a )indo's one 9N3FS 3hat 'ay you can $oot SystemRescueCd romyour )indo's partition, and using the docac3e option you can even use it to trou$(eshoot

)indo's itse( using ntpass to reset the administrator pass'ord or nt#s*" to 'ork on the

i(esystem

3his chapter has $een updated to support the SystemRescueCd-"KK version, so it 'i(( 'ork 'i((

a(( versions ne'er than that

3here are t'o steps in this insta((ation: irst you 'i(( have to copy main SysRescCd i(es on a

 partition o your disk 3hen, you 'i(( have to conigure your $oot (oader 3he insta((ation processreuires a partition 'ith a$out %KK .+ ree space Bou must have a 'orking (inu7 $oot (oader

insta((ed such as =i(o or 4ru$ i you 'ant to insta(( the SystemRescueCd i(es on a =inu7 partition

Four kerne(s are provided 'ith SystemRescueCd: rescuecd, rescue6, altker*2, altker6 6n

this chapter 'e 'i(( consider you are using rescuecd $ut you can Dust do the same thing 'ith any

other kerne( that is provided 'ith SystemRescueCd

3he (ast section e7p(ains ho' to $oot SystemRescueCd rom the hard disk as an 6S5 image Bou

can do that i you have =inu7 insta((ed on your disk 'ith 4ru$% as the $oot (oader 3his a(ternative

method is more convenient that the other one i you 'ant to reuent(y update SystemRescueCd onyour disk #(( you 'i(( have to do is to update the copy o the 6S5 image on your disk i you

o((o' this method

First step: copy important files

3his step is very trivia(: you Dust have to copy the SysRescCd main i(es to the partition 6 thats aF#3"2;F#3*% or N3FS partition, you can perorm the copy 'ith any operating system 5 course,

i you choose a =inu7 native partition, you 'i(( have to copy rom =inu7 9you can copy rom

SystemRescueCd itse(

Bou must create a directory /sysrcd/ and this directory must $e in the root o the partition 9not a

su$directory

 No', take the disc 'ith the (atest SystemRescueCd version 9you may preer to mount the 6S5

image 'ith mount under =inu7 9eg: mount -o loop systemrescuecd-x86-x.y.z.iso

/mnt/cdrom or you can use a sot'are such as &aemon3oo(s under )indo's i you did not $urn

the disc, in order to have the main i(es

Fina((y, Dust copy sysrcd.dat, sysrcd.md+, initram.i"z, rescuecd, rescue6, altker*2,

altker6 rom the C&Rom to the directory you made 9/sysrcd/ Some o these i(es are (ocated

in isolinux inside o the C&Rom Bou must not keep the directory structure #(( the i(es must $e

copied to the rescuecd directory

0*

Page 44: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 44/174

Second step: update t"e rub,lilo bootmanaer =if ou install

on Hinu>

 No', you must update your $ootmanager 9=i(o or 4ru$ 3his section descri$e ho' to update a $oot manager $ased on (inu7 9(i(o or gru$ 6 you are using an N3FS partition, p(ease read the ne7t

section instead

)e 'i(( have to add severa( (ines to the coniguration i(e o the $ootmanager 9usua((y

/etc/lilo.con# or =i(o, and /boot/"rub/menu.lst or /boot/"rub/"rub.con# or gru$ Bou

have to persona(iHe the coniguration given there )ith gru$, you 'i(( have to give the gru$ device

name or the partition you have chosen 6ts usua((y a name (ike E3d010F instead o 3da or

E3d01F instead o 3da2, 3hen, you may update severa( options re(ated to your key$oard

9setkmap=xx Bou may have a (ook at isolinux.c#" thats in the C&Rom, i you dont kno' the

va(ues you can use or these options

$ample for H%HO bootmanaer

First, here is an e7amp(e o the =i(o coniguration 9edit /etc/lilo.con# 3he path /mount-

point/ must $e rep(aced 'ith the mount point or the partition at the time you run lilo

ima"e=/mount-point/sysrcd/rescuecdinitrd=/mount-point/sysrcd/initram.i"zlabel=ys?esc9dappend=Lsubdir=sysrcd setkmap=usL

" &ont orget to run lilo ater lilo.con# 'as edited

% Bou must rep(ace setkmap=us 'ith your o'n key$oard type

$ample for *RE! bootmanaer

ere is an e7amp(e o 4ru$ coniguration 9edit menu.lst or "rub.con# in /boot/"rub/ 6n this

e7amp(e, i(es are (ocated in /dev/3da8 3he gru$ device name is E3d01F 9you must su$tract "

rom the (inu7 device name, then 8-"@M

title ystem?escue9d #rom 3ard-diskroot E3d01Fkernel /sysrcd/rescuecd subdir=sysrcd setkmap=usinitrd /sysrcd/initram.i"zboot

" Remem$er: in gru$, 6&E, S#3# and SCS6 devices 9/dev/3da and /dev/sda have the

same name E3d0F Bou must not 'rite Esd0F or SCS6 and AS+ devices

% Bou must rep(ace setkmap=us 'ith your o'n key$oard type

Second step: update t"e rub'dos bootmanaer =if you install

on Windows>

 No', you must update your $ootmanager using gru$0dos that is the gru$ port to 'indo's 3his

section descri$e ho' to insta(( the gru$0dos $oot manager i you insta((ed the SystemRescueCd

00

Page 45: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 45/174

i(es on an N3FS partition running )indo's 6 you are using a =inu7 partition, p(ease read the previous section instead

5ne o the most interesting things you can do 'ith the sysresccd nts insta((ation is to trou$(eshoot

'indo's 'hen it has pro$(ems 3his 'ay you can mount the 'indo's partition 'ith nts-*g andrepair your 'indo's 9rep(ace a $ackup o the registry, 3he on(y pro$(em is you cannot mount

the 'indo's disk read-'rite 'ith nts-*g $ecause it 'as a(ready mounted read-on(y during the

 $oot process 3he so(ution to this pro$(em is to use the docac3e option at $oot time )hen this

option is ena$(ed, sysresccd 'i(( cache its o'n i(es 9ound on the nts disk into memory duringthe $oot process, and the nts disk 'i(( $e unmounted So it a((o's you to mount it again 'ith nts-

*g So you have to add docac3e to the menu.lst $oot options i you 'ant to $e a$(e to mount your

'indo's disk 'ith nts-*g ater $ooting rom the nts disk itse(

6nsta((ation is rea((y straightor'ard 6n this mini tutoria(, 6 assume )indo's in insta((ed on an

 N3FS disk 9&isk-C and you copied the SystemRescueCd main i(es in 9Zsysrcd 

a> install rub'dos

gru$0dos is provided on the disc 'ith SystemRescueCd-"KK and ne'er version Bou can a(so

do'n(oad gru$0dos, e7tract the Hip i(e in a temporary directory, and copy "rldr to 9Z 3his

insta((ation has $een tested using the "rldr i(e provided 'ith "rubdos-0..*-200-08-2.zip

b> update t"e windows boot loader

update your boot7ini: Windows 1A',)222,)22(,65

3hese instructions shou(d 'ork on )indo's N30;%KKK;%KK*;I/ Edit 9Zboot.ini 9'ith a te7t

editor such as NotepadGG, dont use )ord P, and add a (ine that $oots the "rldr at the $ottom o

that i(e +e(o' is an e7amp(e o a boot.ini i(e +e careu(: dont rep(ace your boot.ini 'ith theversion given there 6ts very important that you keep the current (ines as they are on your

boot.ini Bou must Dust add the (ast (ine to your boot.ini

Gboot loaderHtimeout=de#ault=multiE0FdiskE0FrdiskE0FpartitionEFZ7():7Goperatin" systemsHmultiE0FdiskE0FrdiskE0FpartitionEFZ7():7=L7indowsL /noexecute=optin/#astdetect9Z"rldr=Lystem?escue9dL

update your boot loader: Windows ?ista,)22G

3hanks to userMKK1"% here are the instruction that shou(d 'ork on )indo's ista;%KK8 3ogether

'ith "rldr you need to copy "rldr.mbr 9part o the archive to the root o the ista $oot

 partition 3hen you need to type severa( commands in a command prompt 9run cmd.exe 'ith an

administrator user account

6n the command prompt 'indo' 99@ is a dummy su$stitute or the cmd prompt do the o((o'ing:

9@ bcdedit /create /d Lystem?escue9d G?'%):HL /application bootsector

01

Page 46: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 46/174

Bou get in return the $oot entry [id\ - use it 9copy;paste or type in the o((o'ing steps

9@ bcdedit /set [id\ device boot9@ bcdedit /set [id\ pat3 Z"rldr.mbr9@ bcdedit /displayorder [id\ /addlast

Bou can a(so investigate urther i you need more detai(s a$out gru$0dos under ista 

c> create t"e C$%menu.lst file

Bou have to create a 9Zmenu.lst that is the "rubdos coniguration i(e ere is an e7amp(e:

K ;3is is a sample menu.lst #ile #or ystem?escue9dtitle ystem?escue9d #rom t3e ;< diskroot E3d010Fkernel /sysrcd/rescuecd subdir=sysrcd setkmap=us docac3einitrd /sysrcd/initram.i"z

6n menu.lst you 'i(( have to rep(ace the setkmap 'ith the code that matches your key$oard

coniguration 6n this e7amp(e, i(es are (ocated on the N3FS partition that is the irst partition othe irst hard disk 3hen the gru$ device name is E3d010F 6t 'ou(d $e E3d10F or the irst

 partition o the %nd hard-disk, E3d01F or the second partition o the irst hard-disk, Bou have

to rep(ace root E3d010F 'ith the gru$ name o your N3FS partition

d> c"eck t"e SystemRescueCd files

Check the SystemRescueCd i(es are insta((ed in 9Zsysrcd 

e> reboot

Just re$oot and choose "rldr, then ystem?escue9d in the $oot menus disp(ayed $y the )indo's

 N3-=oader

!oot t"e %SO imae from t"e disk usin *rub)

4ru$% 9current(y in deve(opment: gru$-"L8 provides a ne' eature to $oot rom an 6S5 image'hich is stored rom the hard disk 6 you put a copy o systemrescuecd-x86-x.y.z.iso on a

 partition that 4ru$% can read then you can $oot SystemRescueCd direct(y rom the 6S5 image

stored on your hard drive 3his is very convenient i you reuent(y update SystemRescueCd andyou 'ant to $oot it direct(y rom 4ru$%

4ru$% kno's 'hat an 6S5 image is and it 'i(( (oad the kerne( image 9rescuecd;rescue20 and the

initrams 9initramigH rom the 6S5 into memory 6t 'i(( then do its norma( Do$ and e7ecute the

kerne( 3he SystemRescueCd init script must then $e a'are that its sysrcd.dat i(e is in an 6S5

and not direct(y on the partition For that reason, this isoloop=xxx $oot option is reuired so you

must use it in your "rub.c#"

3his option is on(y supported in SystemRescueCd-"0K and more recent 3his option speciies the path o the 6S5 image in the partition that gru$ considers as its root partition 6ts important to

02

Page 47: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 47/174

understand that the path o the 6S5 image may $e dierent rom the path on your (inu7 system 6you have a separate $oot partition mounted on /boot and i you copy this 6S5 image to

/boot/sysrcd/systemrescuecd-x86-x.y.z.iso  then the option has to $e

isoloop=/sysrcd/systemrescuecd-x86-x.y.z.iso 3his is $ecause the $oot partition is 'hat

4ru$% 'i(( consider as its root partition during the $oot process

ere is an e7amp(e o a /boot/"rub/"rub.c#" coniguration i(e:

set de#ault=0set timeout=+set root=E3d01F

menuentry L)ebian-!enny-2.6.*2-*-amd6 Ev"raidFL [  linux /boot/vmlinuz-2.6.*2-*-amd6 root=/dev/mapper/v"raid-lenny ro  initrd /boot/initrd.im"-2.6.*2-*-amd6\

menuentry Lystem?escue9d EisoloopFL [  loopback loop /systemrescuecd-x86-x.y.z.iso  linux EloopF/isolinux/rescuecd isoloop=systemrescuecd-x86-x.y.z.iso

  initrd EloopF/isolinux/initram.i"z\

)hat happens 'hen 4ru$% $oots is that:

• 4ru$% reads the partition that its considers as it root partition 'hich is 9hdK," in that

e7amp(e

• 4ru$% searches or a i(e ca((ed /systemrescuecd-x86-x.y.z.iso at the root o that

 partition

• 4ru$% (oads $oth isolinux/rescuecd and isolinux/initram.i"zScode@ #rom t3e(: ima"e

4ru$% e7ecutes the kerne( image 9rescuecd• 3he kerne( $oots, then it e7ecutes the >code?;init script rom the initrams

• 3he /init $oot script 'i(( see the isoloop=systemrescuecd-x86-x.y.z.iso  option has

 $een used

• 3his script tries to ind systemrescuecd-x86-x.y.z.iso on any partition and device

• 3his script mounts the 6S5 image and reads the root i(esystem image 9sysrcddat and

 $oots norma((y

Sysresccd-manual-en .ow to install

SystemRescueCd on "arddisk From SystemRescueCd

Jump to: navigation, search

Contents

[hide

• " 6ntroduction

0M

Page 48: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 48/174

• % Asage

• * procedure

o *" step-K": Create a ne' partition

o *% step-K%: .ount the ne' partition

o ** step-K*: E7tract the current i(es rom the c(oop image

o *0 step-K0: Copy the SystemRescueC& kerne(

o *1 step-K1: CustomiHe setup to your hard disko *2 step-K2: Run (i(o

o *M step-KM: Amount the ne' partition

• 0 Changes as $oot time

%ntroduction

3he idea is to insta(( SystemRescueCd too(s onto a =inu7 partition to easi(y recover your system incase something goes 'rong Bou 'i(( have an insta((ed system that 'orks (ike other (inu7 systems

insta((ed $y other distri$utions 6 you Dust 'ant to $e a$(e to run SystemRescueCd rom your hard

disk, and have an entry in your $ootmanager 9=i(o or 4ru$, there is an easier method, that ise7p(ained in the ne7t chapter

)#RN6N4: +e a'are that this operation may give you an use(ess system i you dont strict(y

o((o' instructions $e(o'

Esae

#(( the Do$ is processed rom the oicia( SystemRescueCd C&Rom 3his means you have to $urnthe oicia( version and $oot your computer rom it

procedure

step-23: Create a new partition

Bou have to resiHe an e7isting partition and then create an empty e7t%s partition Note: on(y e7t%s

is supported at the moment

"parted

6 'i(( suppose you no' have an N3FS partition ;dev;hda" and an e7t% partition ;dev;hda% Bou

have to update this to your setup

step-2): #ount t"e new partition

mount /dev/3da2 /mnt/custom

step-2(: $tract t"e current files from t"e cloop imae

sysresccd-custom extract-nosizec3eckrm -r# /mnt/custom/customcd/isoroot

08

Page 49: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 49/174

mv /mnt/custom/customcd/#iles/B /mnt/customcp /etc/inittab /mnt/custom/etc/rm -r# /mnt/custom/customcd

step-2': Copy t"e SystemRescueCD kernel

cp /mnt/cdrom/isolinux/rescuecd /mnt/custom/boot

step-24: Customie setup to your "ard disk 

#dd this (ine to ;mnt;custom;etc;sta$ i(e

/dev/3da2 / ext2 errors=remount-ro 0

Copy this i(e rom ;usr;share;sysresccd;hdinsta((;(i(oconin to ;mnt;custom;etc;(i(ocon

lba*2boot = /dev/3damap = /boot/.map

promptinstall = /boot/boot-menu.bdelay = +0v"a = normalde#ault=winima"e = /boot/rescuecd  root = /dev/3da2  label = sysrcd  read-only  nocdrootot3er = /dev/3da  label = win  table = /dev/3da

)#RN6N4: do not orget to rep(ace ;dev;hda" and ;dev;hda% 'ith your va(ues i you 'ant yoursystem to $oot

step-2&: Run lilo

mount -t dev#s none /mnt/custom/devc3root /mnt/custom liloumount /mnt/custom/dev

step-2: Emount t"e new partition

umount /mnt/custom

C"anes as boot time

#t $oot time, you shou(d no' have a prompt (ike this one:

=6=5 %%1" 3his means that =6=5 is insta((ed and running 6 you (et the timer going do'n 9a$out

1 seconds, your deau(t target 'i(( $e (aunched )ith previous (i(ocon i(e, it 'i(( $e )indo's 6

you 'ish to test your ne' SystemRescue partition, press (et shit key Bou 'i(( get

0L

Page 50: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 50/174

!(!: 22.+. boot

3hen enter <sysrcd< 6 you do not remem$er your target (ist, hit ta$u(ation key and =6=5 'i((

sho' you

!(!: 22.+. bootwin sysrcd

Sysresccd-manual-en 56$ network bootin

From SystemRescueCd

Jump to: navigation, search

Contents

[hide

• " #$out

• % Reuirements

• * o' the /IE $oot process 'orks

o *" 3he /IE $oot server

o *% 3he /IE $oot process

o ** 3he p7e$ootsrv service

• 0 Setup the /IE-$oot-server on a typica( coniguration

o 0" #$out

o 0% 5vervie'

o 0* Steps to conigure /IE on the server• 1 Setup the /IE-$oot-server on a custom coniguration

o 1" #$out

o 1% CustomiHation o the p7e$ootsrv service

o 1* CustomiHation o the $oot command (ine

• 2 Steps to $oot the c(ient 'ith /IE

• M #(ternative methods: $oot rom NFS or N+&

o M" #$out N+&

o M% #$out NFS

@bout

3he /IE environment a((o's you to $oot a computer 'ith SystemRescueCd even i this computer

has no C&Rom driver or AS+ socket 6t a((o's to $oot SystemRescueCd rom the net'ork, andthen its aster to trou$(eshoot computers o your net'ork once a /IE-$oot-server is insta((ed 6ts

a(so useu( i you 'ant to $oot a computer that has no optica( drive 9C& or && or to

trou$(eshoot a remote computer on 'hich you have no physica( access to insert the disc For themoment, SystemRescueCd supports on(y /IE $ooting on the 782 architecture 9a(( /C computers:

i*82 and amd20

1K

Page 51: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 51/174

Re0uirements

• @ computer or a virtual mac"ine that can $oot SystemRescueCd rom a C&;AS+;&&

to act as a /IE server

• @ client computer 'ith a /IE a$(e net'ork card on the same net'ork

• SystemRescueCd version "0K or ne'er

.ow t"e 56$ boot process works

A"e 56$ boot server

3he /IE $oot server is made o three stages:

• stae3: the &C/ server sends an 6/ address to the c(ient 'ith e7tra ino such as the

address o the 3F3/ server

• stae): the 3F3/ server sends the irst $oot i(es 9$oot (oader G kerne( G initramigH to the

c(ient• stae(: the 33/ or 3F3/ or NFSv* or N+& server sends the root i(esystem image

9sysrcddat to the c(ient

3hese three parts can $e insta((ed either on a sing(e machine or on severa( computers

SystemRescueCd provides a u(( /IE-$oot-server out o the $o7 that you can run on a sing(ecomputer 3he pxebootsrv service manages these three services or you

A"e 56$ boot process

Bou may need to understand 'hat happens 'hen you $oot SystemRescueCd rom the net'ork

Bou 'i(( need this kno'(edge or trou$(eshooting in case o pro$(ems ere are the most importantsteps o the /IE $oot process:

" )hen the c(ient computer try to $oot 'ith /IE, it irst emits a &C/ reuest on thenet'ork to get an 6/ address

% 3hen a &C/ server rep(y 'ith a &C/ oer that contains a ne' 6/ address that 'as not

a(ready a((ocated and some speciic options 9&NS, deau(t route and the 6/ address o the3F3/ server

* 3he c(ient receives this &C/ oer and accept it 6t connects to the 3F3/ server 9it

received its 6/ address in the previous stage to get the $oot (oader i(es0 3he 3F3/ server sends the $oot (oader i(es 9pxelinux and the te7t i(es disp(ayed on the

screen $y pxelinux1 3he c(ient disp(ays the p7e(inu7 prompt, and the user can choose the $oot options 6t then

reuests the 3F3/ server the kerne( and initrams i(es necessary to $oot the system

2 3he 3F3/ server sends the kerne( and initrams i(es 9rescuecd G rescuecd.i"z to the

c(ientM 3he c(ient $oots on this kerne( and e7ecutes the /init scripts that comes 'ith the

initrams

8 &uring its initia(iHation the kerne( makes a &C/ reuest again $ecause o the ip=d3cp 

kerne( $oot parameters 6n deed the kerne( does not kno' the 6/ address used $y the

computer at the p7e(inu7 stage

1"

Page 52: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 52/174

L 3he c(ient needs the sysrcd.dat i(e 6 you use 33/ or 3F3/ or the third stage, then

sysrcd.dat 'i(( $e do'n(oaded into R#. so the c(ient has to have enough memory

9estimated reuirement: 0KK.+ 6 you use either NFSv* or N+& then you dont have this

memory reuirement and the c(ient 'i(( make permanent reuests to the server each time itneeds a i(e rom the root i(esystem

"K 3he c(ient mounts sysrcd.dat and it can no' comp(ete the $oot process

"" #t this stage the c(ient ho(ds a(( the i(es in memory i you use 3F3/;33/ or the thirdstage and it does not reuire any $oot server any more 6 you are using NFSv* or N+& the

connection is sti(( reuired

A"e pebootsrv service

6n SystemRescueCd the /IE server setup is done 'ith a sing(e service named pxebootsrv 3his

service is charged o preparing the server coniguration and running the three 'orkers services

invo(ved in the /IE $oot process )hen you run the pxebootsrv 'ith /etc/init.d/pxebootsrv

start this service ana(yses its coniguration settings (ocated in /etc/con#.d/pxebootsrv then it

 prepares the coniguration i(es o the other services and the i(es in /t#tpboot and then it starts

these 'orkers services

3he pxebootsrv service 'as 'ritten to make the p7e $oot process easier to use 3he end user Dust

needs to conigure pxebootsrv instead o three separate services +ut in case you are not happy

'ith this situation, you are ree to conigure these services 9&C/ G 3F3/ G33/;3F3/;NFSv*;N+& $y hand

Setup t"e 56$-boot-server on a typical confiuration

@bout

3his sections e7p(ains ho' to setup a SystemRescueCd /IE $oot server 'ith a(( the services

running on a sing(e machine 6t means the &C/ server and the 3F3/ server and the 33/ serverare running on the sing(e machine o your net'ork 6 you 'ant to run these services on separate

computers p(ease read the ne7t section

Overview

Bou Dust have to start a SystemRescueCd rom the C&;AS+;&& and conigure it to act as a /IE

 $oot server on your (oca( net'ork 33/ 'i(( $e used or the third stage 3he coniguration is very

simp(e, you Dust have to 'rite your settings in a conig i(e and start the p7e$ootsrv service andthats it Bou can then $oot other computer rom the net'ork 'ith /IE

Steps to confiure 56$ on t"e server

• +oot SystemRescueCd rom the C&;AS+;&& on a computer

• Conigure the net'ork settings 'ith ipcon#i" and route ere is a typica( e7amp(e:

o i#con#i" et30 ,2.68..+/2 

o route add de#ault "w ,2.68..2+ 

• Edit your p7e;net'ork settings in /etc/con#.d/pxebootsrv 

1%

Page 53: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 53/174

• Start the service 'ith /etc/init.d/pxebootsrv start 6n case o errors, check the

/var/lo"/messa"es i(e or more detai(s

• 3he computer shou(d $e ready to act as a /IE $oot server

ere is a copy o a typica( /etc/con#.d/pxebootsrv coniguration i(e:

K ------------------------ 9:<('?$;(: -------------------------------

K %y de#ault t3e current systems acts as )O95 and ;<;5 and O;;5 serverK (# you want anot3er mac3ine o# you network to act as one o# t3oseK you will 3ave to turn t3e appropriate option yo LnoL

K et to LyesL i# you want t3is mac3ine to act as a )O95 server5X&%::;?VM):)O95)=LyesLK et to LyesL i# you want t3is mac3ine to act as a ;<;5 server5X&%::;?VM):;<;5)=LyesLK et to LyesL i# you want t3is mac3ine to act as an O;;5 server5X&%::;?VM):O;;5)=LyesL

K Oere is a typical 5X&-%oot con#i"uration --@ update wit3 your settin"s5X&%::;?VM'%&;=L,2.68..0L

5X&%::;?VM&;4$P=L2++.2++.2++.0L5X&%::;?VM)&<?:';&=L,2.68..2+L5X&%::;?VM)=L,2.68..2+L5X&%::;?VM)O95?$&=L,2.68..00 ,2.68..+0L5X&%::;?VM!:9$!(5=L,2.68..+L

K Peep t3ese values to J5X&%::;?VM!:9$!(5 i# t3e current computerK acts as ;<;5 server and O;;5 server as well as )O95 server5X&%::;?VM;<;5&?V&?=LJ5X&%::;?VM!:9$!(5L K (5 address o# t3e ;<;5server5X&%::;?VMO;;5&?V&?=L3ttp//J5X&%::;?VM!:9$!(5/sysrcd.datL K download '?!

Setup t"e 56$-boot-server on a custom confiuration

@bout

6n this section you 'i(( (earn ho' to insta(( a /IE-$oot environment 'ith the three services

9&C/, 3F3/, 33/;3F3/;NFSv0;N+& running on dierent machines .ake sure you

understand ho' to /IE $oot process 'orks $eore you insta(( the /IE $oot server 'ith aconiguration dierent rom the typica( case

Customiation of t"e pebootsrv service

Bou may conigure the p7e$ootsrv service to act on(y as the reuirements you have For e7amp(ei you a(ready have a &C/ server running on your net'ork you may not 'ork to insta(( another

&C/ again 6n that case you can conigure SystemRescueCd p7e$ootsrv to act on(y as

3F3/;33/ servers Bou Dust have to turn o the 5X&%::;?VM):)O95) option in

/etc/con#.d/pxebootsrv:

K ------------------------ 9:<('?$;(: -------------------------------K %y de#ault t3e current systems acts as )O95 and ;<;5 and O;;5 serverK (# you want anot3er mac3ine o# you network to act as one o# t3oseK you will 3ave to turn t3e appropriate option yo LnoL

1*

Page 54: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 54/174

K et to LyesL i# you want t3is mac3ine to act as a )O95 server5X&%::;?VM):)O95)=LnoLK et to LyesL i# you want t3is mac3ine to act as a ;<;5 server5X&%::;?VM):;<;5)=LyesLK et to LyesL i# you want t3is mac3ine to act as an O;;5 server5X&%::;?VM):O;;5)=LyesL

6 you use another &C/ server, you 'i(( have to update the next-server option in the &C/

settings to make sure the &C/ service sends to 6/ address o the 3F3/ server to the c(ient ere

is an e7amp(e o ho' to use that option 'ith the 6SC &C/& server:

next-server ,2.68..+R K (5 addr o# t3e ;<;5 server

ere is an e7amp(e o a typica( su$net coniguration that you can add to the end o your

d3cpd.con#:

subnet ,2.68..0 netmask 2++.2++.2++.0[  ran"e ,2.68..200 ,2.68..20R  ran"e dynamic-bootp ,2.68..2 ,2.68..220R  next-server ,2.68..+R  #ilename Lpxelinux.0LR\

Customiation of t"e boot command line

3he /IE server is made o severa( services 6n the second stage, the server uses 3F3/ to send

mu(tip(e things to the c(ient: $oot (oader 9p7e(inu7K, kerne( image 9rescuecd;rescue20;a(tker77,

initrams 9initramigH 3he $oot (oader is pxelinux.0 and it comes 'ith a coniguration i(e

'hich is sent to the c(ient 3his coniguration i(e contains the $oot command (ine 'hich 'i(( $e

used $y the c(ient to start the (inu7 kerne( 3his command (ine is important since it contains the

SystemRescueCd $oot options that are reuired to run the third stage 3he $oot command (ine can $e used to speciy the net'ork settings and the method that the /IE c(ient 'i(( use in the stage o

the /IE $oot process /(ease reer to Net'ork $oot using /IE and Net'ork coniguration options 

or a detai(ed (ist o options supported on the $oot command (ine ere are t'o e7amp(es o va(idcommand (ines or /IE $oot:

6n the irst e7amp(e the c(ient 'i(( use a static 6/ address 9"L%"28"1M"KK and it 'i(( connect to

an 33/ server to do'n(oad sysrcd.dat in the third stage o the /IE $oot process

label mybootentry  kernel rescuecd  append initrd=initram.i"z et3x=,2.68.+.00netboot=3ttp//,2.68.+.8080/sysrcd.dat

ere is another e7amp(e 'here the c(ient runs a 20$it kerne( 6t uses a dynamic 6/ address and

connects to an N+& server 9"L%"28"1M":%KKK in the third stage:

label mybootentry2  kernel rescue6  append initrd=initram.i"z dod3cp netboot=nbd//,2.68.+.2000

10

Page 55: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 55/174

Steps to boot t"e client wit" 56$

• Check your /IE $oot server is ready to ans'er to the reuests rom the /IE c(ient

• Check your c(ient computer has at (east 0KK.+ o R#. i you 'ant to use 33/ or 3F3/

to do'n(oad sysrcddat

• Setup your +65S to $oot rom the net'ork via /IE

• Check your computer is connected to the same net'ork as the server• +oot your c(ient computer and it shou(d 'ork

@lternative met"ods: boot from 1FS or 1!D

6n the previous sections, the c(ient uses an 33/;3F3/ server to do'n(oad the root i(esystem

9'hich is stored in sysrcddatU 3his i(e is stored in memory on the c(ient machine, and then it canon(y 'ork is the c(ient computer has enough memory 91"% .+ or more in genera(

6n SystemRescueCd-"0K 9and more recent you can use either NFS 9Net'ork Fi(e System or

 N+& 9Net'ork +(ock &evice as a rep(acement o 33/;3F3/ Bou 'i(( sti(( need &C/ and3F3/ or the ear(y stages any'ay NFS or N+& are on(y used to retrieve the root i(esystem 6n

other 'ords these a(ternatives are used or steps L, "K, "" in the /IE $oot process descri$ed in the

 previous sections, and steps " to 8 are sti(( $ased on &C/;3F3/

 NFS is more popu(ar than N+& $ut N+& is much easier to conigure since it on(y uses a sing(e3C/ port to 'ork 6n $oth cases the root i(esystem 'i(( $e mounted through the net'ork 6t means

the c(ient 'i(( have to $e connected unti( you shut it do'n 6 the connection $reaks then it 'i((

stop 'orking

ere are the t'o $oot options introduced in SystemRescueCd-"0K:

• nbdboot+ip:port: 6/ and /ort o the N+& server that distri$utes a copy o sysrcddat

• nfsboot+ip:,pat": 6/ o the NFS v* server and path to the directory that contains a copy o

sysrcddat NFS v0 is not supported

@bout 1!D

 N+& 9Net'ork +(ock &evice provides a standard $(ock device 9ca((ed /dev/nbd0,

/dev/nbd, on the c(ient machine 3hese devices can $e mounted as any norma( disk Each

time a $(ock is read on such a device, there is a net'ork reuest and the N+& server sends the data

reuested

6n SystemRescueCd, N+& is used to mounted the (oop$ack root i(esystem 'hich is stored in

sysrcd.dat through the net'ork 3he coniguration o the N+& server is not descri$ed in this

documentation, $ut its rea((y easy .ost (inu7 distri$ution provide a package ca((ed nbd-server 

or simp(y nbd 'hich you can use to provide the $oot server

ere is an e7amp(e N+& server coniguration i(e that you can use:

K /etc/nbd-server/con#i"G"enericH

11

Page 56: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 56/174

  user = nbd  "roup = nbd  listenaddr = ,2.68..Gpartima"eH  exportname = /mnt/cdrom/sysrcd.dat  port = 2000

#nd here is an N+& server command:

nbd-server 2000 /mnt/cdrom/sysrcd.dat

@bout 1FS

3o conigure an NFS v* server , you have to insta(( the appropriate packages on your avourite

(inu7 distri$ution, and then you can add such an entry in the /etc/exports i(e:

/t#tpboot BEro1noMsubtreeMc3eck1allMsCuas31insecure1anonuid=0001anon"id=000F

 NFS reuire mu(tip(e ports to 'ork so it may $e comp(icated i you have a ire'a(( $et'een the

 NFS server and the SystemRescueCd c(ient

#(so you have to check that the sysrcd.dat and sysrcd.md+ i(e are avai(a$(e on the NFS server:

K ls -l3 /t#tpboot/sysrcd.B-rw-r--r-- root root ,84 200-02-2 206 /t#tpboot/sysrcd.dat-rw-r--r-- root root + 200-02-2 206 /t#tpboot/sysrcd.md+

ere is an e7amp(e o $oot command or the c(ient:

setkmap=uk et3x=,2.68.+2.2 n#sboot=,2.68.+2./t#tpboot "w=,2.68.+2.

Sysresccd-manual-en Run your own scripts

wit" autorun

From SystemRescueCd

Jump to: navigation, search

Contents

[hide

• " #utorun overvie'

• % 5ptions provided $y the autorun

• * Summary o scripts e7ecution ru(es

• 0 E7amp(es o autorun scripts

12

Page 57: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 57/174

@utorun overview

3he autorun feature a((o's you to run scripts automatica((y at startup o the system Each autorun

script can manage a task For e7amp(e, you can create a $ackup script that makes a $ackup o a

data$ase, another or c(eaning a system,

+y deau(t, the autorun script9s may $e copied in the root o the C&Rom, outside o thecompressed (oop image i(e 9sysrcddat, $ut other sources are avai(a$(e : (oppy disk, &

 partition, net'ork share, a 'e$ server

3he script may $e named autorun i a(one 6 many scripts have to $e chained, you may name

them autorun0, autorun, 6n this case, speciic autorun scripts may $e a((o'ed 'ith an

autoruns= startup option given at $oot time prompt For e7amp(e, you may type rescuecd

autoruns=21*1

6 you 'ant to use (oppy or net'ork source or autorun i(es, you 'i(( have to speciy the sourceusing the arMsource $oot option .ore on this in ne7t section

#utorun has $een re'ritten in SystemRescueCd-"KK so that it supports ne' autorun sources Bou

can have more detai(s a$out the changes in the page a$out autorun in the ne's section

Bou can use autorun to perorm comp(ete(y automatic tasks using SystemRescueCd 3here is adedicated chapter that e7p(ains o' to use autorun to manage server that are in a remote

datacenter  

Options provided by t"e autorun

Bou must use these option at $oot time, on the $oot command (ine

• ar8source+: p(ace 'here the autorun are stored 6t may $e the root directory o a

 partition 9/dev/sda, an ns share 9n#s//,2.68../pat3/to/scripts, a sam$a

share 9smb//,2.68../pat3/to/scripts, or an http directory

93ttp//,2.68../pat3/to/scripts

• autoruns+92-;: comma separated (ist o the autorun script that have to $e run For

instance i you use autoruns=0121 then the o((o'ing autorun scripts 'i(( $e e7ecuted:

autorun0, autorun2, autorun Ase autoruns=no to disa$(e a(( the autorun scripts 'ith a

num$er

• ar8nowait: do not 'ait or a keypress ater the autorun script have $een e7ecuted

3he o((o'ing autorun $oot options have $een introduced in SystemRescueCd-"KK:

• ar8inorefail: continue to e7ecute the scripts chain even i a script ai(ed 9returned a non-

Hero status

• ar8nodel: do not de(ete the temporary copy o the autorun scripts (ocated in

/var/autorun/tmp ater e7ecution

• ar8disable: comp(ete(y disa$(e autorun, the simp(e autorun script 'i(( not $e e7ecuted

1M

Page 58: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 58/174

Summary of scripts eecution rules

#t startup, a (ist o (ocations are checked against the presence o autorun i(es 3hey are,

successive(y:

• i the ar8source+ parameter 'as passed at startup, the root directory o the given (ocation

&evices are mounted to /mnt/autorun, a((o'ing 'riting data into them i the device is not'rite-protected

o F(oppy disks: rescuecd arMsource=/dev/#d0 

o ard disk: rescuecd arMsource=/dev/3da2 9autorun scripts in %nd partition o

"st 6&E hard disk

o  NFS shares: rescuecd arMsource=n#s-server/n#s/exported/directory 

o Sam$a shares: rescuecd arMsource=//samba-server/s3are 9recommended

'ithout user;pass'ord

o ttp server: rescuecd arMsource=3ttp//web-server/adminscripts/ 

9reuires SystemRescueCd-"KK or ne'er

• the root directory o the C&-R5.

• the superuser home directory 9,root• the ,usr,s"are,sys7autorun  directory

6 autorun i(es are ound in some (ocation, they are run and the process ends =ast t'o (ocationsreuire re$ui(ding o SystemRescueCd and are to $e used or advanced or test purposes

6n each source (ocation, there are t'o possi$(e modes o operation :

• simp(e one : i a she(( script named autorun is ound, it is run

• more (e7i$(e : i autorunK scripts are ound 9V is a digit rom K to L and either

o autoruns= $oot parameter 'as N53 speciied, or

o autoruns= $oot parameter va(ue contains V

E7amp(e: rescuecd autoruns=011 6n this e7amp(e, on(y autorun01 autorun or autorun

scripts may $e run i present 5ther scripts, such as autorun%, autorun* and autorun1, 'i(( $eignored, then authoriHed scripts are run in a(pha$etic order )henever a script returns a non-Hero

code, the processing stops and ne7t scripts are not run Bou can prevent any <autorunV< e7ecution

'ith an autorun@ $oot parameter 'ithout any digit, e7: autoruns=no 3his has no eect on

autorun script

#(though it is possi$(e to put $oth autorun and autorunK scripts, this shou(d pro$a$(y $e avoided

3he script has to $e any va(id she(( script /er(, python, etc scripts are not supported at this time)indo's end-o-(ine terminators are trans(ated to a((o' running she(( scripts 'ritten 'ith a .Seditor

$amples of autorun scripts

K/bin/bas3E  i#con#i" et30 A 3ead -n *

18

Page 59: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 59/174

  #disk -l /dev/3daF A tee -a /mnt/autorun/reportsyncexit 0

6n this script 'e assume to have passed the (oppy-disk as the source o autorun 'ith

arMsource=#d0 $oot-parameter 6t 'i(( accumu(ate inos a$out ethK net'ork interace and disk

 partitions into a i(e named report on irst (oppy drive +65S $oot seuence must speciy C&irst, diskette must $e 'rite-ena$(ed, C& and diskette must $e inserted at startup time int: 3he

 parameter -a ater the command tee has the o((o'ing eect: the i(e is not over'ritten $ut the

output is a ppended

6 net'ork is automatica((y conigured at $oot 9&C/, you may send inos through a NFS or

sam$a share or e7amp(e

&ont orget to give autorun (ocation at startup Say that you share through NFS a 'ritea$(e

directory named /n#s/backup on host myserver, you have to speciy:

•rescuecd arMsource=n#s//myserver/n#s/backup 

at SystemRescueCd $oot prompt and to put in the shared directory an autorun script (ike this one :

K/bin/bas3date=JEdate ]DYDmDdFcat /dev/3da A "zip @ /mnt/autorun/Jdate.3da."z ^^ exit 0ec3o Jdate 3da backup errorexit

6 suicient space is provided in NFS share, this 'i(( copy there a compressed image o your irst

6&E disk +e a'are there may $e a %4+ ma7imum i(e siHe 'hen copying across net'ork or to a

F#3 i(esystem

Bou must ensure that name reso(ution 'orks i you 'i(( access NFS server $y its name instead o

its 6/ address

Sysresccd-manual-en !uild a

SystemRescueCd wit" your own kernel

From SystemRescueCd

Jump to: navigation, search

Contents

[hide

• " 5vervie'

• % /repare your system

o %" Check the reuirements

o %% /repare a partition 'ith some ree space

1L

Page 60: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 60/174

• * &o'n(oad and prepare the sources and patches

• 0 Conigure your kerne(

o 0" CustomiHe the EI3R#ERS65N

o 0% Ase the right architecture

o 0* Choose the kerne( compi(ation options

• 1 Compi(e and insta(( the kerne(

2 Recreate the initramso 2" )hat is an initrams

o 2% erne( modu(es and initrams

o 2* E7tracting the current initrams

o 20 Copy the ne' modu(es in the initrams

o 21 Recreating the initrams

• M Create a customiHed disc 'ith the ne' kerne(

Overview

SystemRescueCd comes 'ith our kerne(s Bou may 'ant to compi(e your o'n (inu7 kerne( $ecause you need another driver, or you 'ant more recent sources, or Dust dierent compi(ation

options

3his tutoria( e7p(ains ho' you can compi(e your o'n kerne( rom SystemRescueCd itse(, you

dont need to have another (inu7 system insta((ed on your hard disk Bou can do a(( the compi(ationstu rom any other (inu7 system insta((ed on the hard disk, as (ong as you kno' 'hat you are

doing 3his tutoria( is $ased on SystemRecueCd-"11 $ut it shou(d 'ork 'ith any verison rom

SystemRecueCd-""K 'hich introduced the deve(opment too(s 9gcc, make, 'hich are reuired

to compi(e the kerne( So you shou(d not attempt to o((o' these instructions 'ith an o(der version

#ter the ne' kerne( sources are compi(ed, it 'i(( $e necessary to make a customiHedSystemRescueCd using the compi(ed kerne( image and modu(es

5repare your system

3his tutoria( e7p(ains ho' to compi(e the kerne( rom SystemRescueCd

First $oot SystemRescueCd-""K or a more recent version

C"eck t"e re0uirements

eriy the version o SystemRescueCd and that the gcc compi(er is insta((ed:

root>sysresccd /root D cat /root/version.+.+

root>sysresccd /root D "cc --version"cc E99F ..* Eentoo ..* p.0F9opyri"3t E9F 200 <ree o#tware <oundation1 (nc.;3is is #ree so#twareR see t3e source #or copyin" conditions. ;3ere is :warrantyR not even #or 4&?9O$;$%(!(;Y or <(;& <:? $ 5$?;(9'!$? 5'?5:&.

2K

Page 61: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 61/174

Page 62: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 62/174

bzcat ../std-sources-2.6.*2M0-stable.patc3.bz2 A patc3 -pbzcat ../std-sources-2.6.*2M02-sClzma0.patc3.bz2 A patc3 -pbzcat ../std-sources-2.6.*2M0*-au#s2.patc3.bz2 A patc3 -pbzcat ../std-sources-2.6.*2M0-reiser.patc3.bz2 A patc3 -pbzcat ../std-sources-2.6.*2M0+-loopaes.patc3.bz2 A patc3 -pbzcat ../std-sources-2.6.*2M06-cciss-3psa.patc3.bz2 A patc3 -pbzcat ../std-sources-2.6.*2M0-lsi-sw.patc3.bz2 A patc3 -p

3he sysresccd kerne( sources are made o severa( patches Some patches are necessary or thesystem to 'ork, other patches are not important ere are the patches that you must keep i you'ant the system to 'ork:

• s0lma'2: support or the suashs i(esystem 'ith the (Hma compression

• aufs): support or the aus i(esystem 9another unions

Bou are ree to app(y other patches as (ong as they dont con(ict 'ith other ones or $reak thesources

Confiure your kernelCustomie t"e $6AR@?$RS%O1

)hen you type uname -r, the e7tra version inormations are disp(ayed:

root>sysresccd /root D uname -r2.6.*2.0-std+0

Bou may 'ant to change the deau(t EI3R#ERS65N va(ue, you can do that $y editing the main

.akei(e:

root>sysresccd /root D cd /usr/src/linux-2.6.*2root>sysresccd /usr/src/linux-2.6.*2 D vi 4ake#ile

ere is an e7amp(e o /usr/src/linux-2.6.*2/4ake#ile 

V&?(: = 25$;9O!&V&! = 6'%!&V&! = *2&X;?$V&?(: = .0-custom

Ese t"e ri"t arc"itecture

Bou may 'ant to compi(e a *%$it kerne( i you are running a 20$it one, or you may 'ant to

compi(e a 20$it kerne( even i you are running a *%$it kerne( 6n that case, its important that you

speciy the right va(ue or #RC $eore you run any make command re(ated to the kerne( For

instance, here is 'hat you must do i you are running a 20$it kerne( 9uname -m returns x86M6

and you 'ant to compi(e a *%$it kerne(:

cd /usr/src/linux-2.6.*2export $?9O=i*86sed -i -e NiZ$?9O=i*86N 4ake#ile

2%

Page 63: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 63/174

3o compi(e a 20$it kerne( rom SystemRescueCd or rom any other *%$it (inu7 its a $it diicu(tBou have to insta(( crossdev irst 9run emer"e crossdev on SystemRescueCd 'ith portage ready,

and then compi(e that 'ay:

9?:M9:45(!&=x86M6-pc-linux-"nu- $?9O=x86M6 make

#ter than, the right architecture 'i(( $e used 'hen you se(ect the options and 'hen you compi(e

the kerne(

C"oose t"e kernel compilation options

6 you dont 'ant to check a(( the kerne( coniguration options, you can use the oicia( sysresccd

options as a starting point 3he options o the running kerne( are avai(a$(e in /proc/con#i"."z, so

you can Dust get the coniguration i(e that 'ay:

cd /usr/src/linux-2.6.*2cat /proc/con#i"."z A "zip -d @ mycon#i"

6 you are 'orking in graphica( mode, you can se(ect the options using the graphica( program $ased on 43 3he make xcon#i" command cannot $e used since the system does not have the

Qt (i$raries So Dust type this:

cd /usr/src/linux-2.6.*2make "con#i"

6 you are 'orking in conso(e mode, you can use make menucon#i" instead:

cd /usr/src/linux-2.6.*2make menucon#i"

)hen you se(ection the kerne( options, its very important that you ena$(e the o((o'ing options,

they must $e $ui(t-in the kerne( image not compi(ed as a modu(e:

9:<(M'$O<=y9:<(M'$O<M!W4$=y9:<(M'$O<M<?$4&;M9$9O&M(W&=*9:<(M$'<M<=y9:<(M$'<M%?$9OM4$XM2=y9:<(M$'<M&X5:?;=y9:<(M$'<M%?M<'&=y9:<(M$'<M5:!!=y9:<(M$'<M%)&VM!::5=y

6 you 'ant to compi(e a 20$its kerne( 9#RC@782O20, dont orget to ena$(e the 6#*% support9C5NF64O6#*%OE.A=#365N@y, e(se your kerne( 'ont e7ecute the *%$it $inaries #nd the

sysresccd system is made o *%$it $inaries

#(so its important to disa$(e C5NF64O6N63R#.FSOS5ARCE 9remove the va(ue 'hich contains

 Dust a space e7cept i you kno' ho' to use it

Compile and install t"e kernel

2*

Page 64: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 64/174

#ter the options have $een se(ected and saved in ;usr;src;(inu7-%2*%;conig, you can compi(ethe sources:

make ^^ make modules ^^ make modulesMinstall

6 the kerne( compi(e 'ithout error, a compressed kerne( image shou(d $e avai(a$(e:

root>sysresccd /root D #ind /usr/src -type # -name bz(ma"e/usr/src/linux-2.6.*2/arc3/x86/boot/bz(ma"e

Bou shou(d a(so ind ne' modu(es in either /lib/modules or /lib6/modules/

Just make a $ackup o these t'o things 9$H6mage i(e, and the ne' modu(es that you 'i(( need inthe ne7t stages

Recreate t"e initramfs

W"at is an initramfs

#n initrams 9a(so kno'n as init-ramdisk is a compressed cpio archive 'hich contains i(es used

to initia(iHe the system at $oot time 3he i(es are used $y the kerne( to initia(iHe the system+asica((y it does things such as mounting the main root i(esystem 6ts not reuired or a(( the (inu7

systems, $ut its necessary or comp(e7 ones, or instance 'hen the root i(esystem is on an =.

(ogica( vo(ume 6n previous kerne( versions, the ramdisks 'ere compressed (oop$ack i(esystems

SystemRescueCd needs an initrams to $oot, its (ocated in isolinux on the cdrom #(( the kerne(s

use the same initrams to save space 3his i(e contains the modu(es o the kerne( you $oot, so its

necessary to copy the ne' modu(es in this initrams

<ernel modules and initramfs

3he initrams archive is 'here you ind the kerne( modu(es used at $oot time in most =inu7

distri$utions Bou may $e surprised to see that the oicia( kerne( modu(es are not in the

initram.i"z 'hen you e7tract this archive to rep(ace the oicia( modu(es 'ith your o'n i(es

3his is Dust $ecause recent SystemRescueCd is using the 9:<(M((;?$4<M:'?9& option

)hen this option is used each kerne( image contains its o'n kerne( modu(es For instance the

rescuecd kerne( image contains $oth the standard kerne( $inary and an em$edded initrams 'hich

contains its o'n kerne( modu(es SystemRescueCd is using this option $ecause there are our

kerne(s )e cou(d provide our initrams i(es 'hich 'ou(d a(( contains the standard programs andthe speciic kerne( modu(es o each kerne(, $ut it 'ou(d 'aste a (ot o space )e rea((y 'ant to

make the 6S5 image as sma(( as possi$(e

)ith the 9:<(M((;?$4<M:'?9& option each kerne( image contains its o'n kerne( modu(es

#nd the initram.i"z on(y contains the common $oot scripts and programs 'hich are used $y a((

these kerne(s )hen a kerne( $oots, $oth the em$edded initrams and the initram.i"z are

e7tracted in memory, then the kerne( has a(( it needs to $oots )e cou(d a(so put a(( kerne( modu(es

or a(( kerne(s in the initram.i"z +ut it 'ou(d reuire a (ot o memory to Dust $oot since it 'ou(d

20

Page 65: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 65/174

Page 66: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 66/174

Page 67: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 67/174

Sysresccd-manual-en .ow to burn a D?D

wit" SystemRescue and ' *! more files

From SystemRescueCd

Jump to: navigation, search

Contents

[hide

• " 6ntroduction

• % Reuirements

• * First step: $urn the oicia( SysRescCd 6S5 image

• 0 Second step: add your o'n i(es

%ntroduction

6t is possi$(e to $urn SysRescCd on a && disc 9&&-R, &&GR, &&-R), &&GR), and tocopy 0 4+ o data i(es on this disc 6t a((o's to make a disc 'ith $oth your $ackup i(es, and the

system that a((o's to restore it # simp(e (ayer && provides 0* 4+ o space Since SysRescCd

uses a$out "KK .+, you 'i(( have a$out 0% 4+ o ree space 6t a((o's to copy uite $ig image

i(es 9you can make an image o your system 'ith partimage, ntsc(one, ghost, &rive6mage,

3his manua( e7p(ains ho' to make such a $oota$(e && under =inu7, $ut it shou(d $e possi$(e to

do the same under )indo's 'ith Nero

Re0uirements

5 course, you need a && $urner, a disc Bou a(so need an insta((ed =inu7 system, 'ith dvdGr'-too(s 6 you dont have this sot'are, you can do'n(oad on the o((o'ing homepage:

http:;;ycha(mersse;appro;(inu7;&&GR); 

Bou need to kno' the device name o your && $urner 6 you dont kno' it, you may ind it 'ith

dmesg Bou shou(d see something (ike this:

K dmes" A "rep )V)3dd 5(:&&? )V)-?7 )V?-06)1 $;$5( 9)/)V)-?:4 drive 3dd $;$5( *2X )V)-?:4 )V)-? 9)-?/?7 drive1 2000k% 9ac3e1 ')4$E**F

6n this e7amp(e, the t'o output (ines a((o' to kno' the device name 6ts <;dev;hdd< 3his 'as

tested under =inu7-%0%2, 'ith dvdGr'-too(s-1"M, on a &&GR), and the device 'as </ioneer&R-"K2&< 6t is supposed to 'ork 'ith a(( kind o && discs, and a(( && $urners

2M

Page 68: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 68/174

Page 69: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 69/174

Summary of t"e steps

" +oot SystemRescueCd

% Format the &&GR) media

* .ake the A&F i(esystem0 .ount the disc

1 )rite the &&

Step-3: !oot SystemRescueCd

.ost computers have on(y one &&GR) drive 6 you $oot SystemRescueC& rom a && use

the docache option 3his (oads SystemRescueC& into memory o a system 'ith at (east %12 .+

o memory

For e7amp(e:

boot rescuecd docac3e dod3cp setkmap=de

many messages... 

root>sysresccd /root D eIect

3he && drive is no' avai(a$(e

Step-): Format t"e D?DBRW media

Bou 'i(( need to kno' the name o the device Bou can try this i you have no idea:

ls -l /dev/cdBroot>sysresccd /root D ls -l /dev/cdBlrwxrwxrwx root root * 4ay , 200 /dev/cdrom2 -@ 3ddlrwxrwxrwx root root * 4ay , 200 /dev/cdrw2 -@ 3dd

6t means on this computer /dev/3dd is the device that $urns C&;&&, and 'e 'i(( use it

3o ormat the disc, type the o((o'ing command 9rep(ace the device name 'ith yours:

dvd]rw-#ormat -#orce=#ull /dev/3dd

6t can take severa( minutes ere is the output o the command:

B %)/)V)_?7/-?$4 #ormat utility by Sappro>#y.c3almers.se@1 version .0.B .% )V)]?7 media detected.B #ormattin"

Step-(: #ake t"e EDF filesystem

2L

Page 70: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 70/174

5nce the disc is ormatted, you can create the A&F i(esystem on the disc:

mkud##s --lvid=Ldvd-backupL --ud#rev=0x0+0 /dev/3dd

Bou can add your o'n options $ut its a good thing to use A&F revision "1K since it can avoid

compati$i(ity pro$(ems 'ith severa( operating systems 5 course, you shou(d change the vo(ume6& ere is an e7amp(e o the output o mkud##s 

start=01 blocks=61 type=?&&?V&)start=61 blocks=*1 type=V?start=,1 blocks=2*1 type='5$9&start=2+61 blocks=1 type=$9O:?start=2+1 blocks=61 type=5V)start=2*1 blocks=1 type=!V()start=21 blocks=22,+*1 type=55$9&start=22,81 blocks=1 type=$9O:?start=22,881 blocks=2*,1 type='5$9&start=22,+081 blocks=61 type=?V)start=22,+0*1 blocks=1 type=$9O:?

=inu7-%2 supports A&F 9i the option 'as ena$(ed in the kerne(, o course SystemRescueCd has itena$(ed )indo's %KKK and previous versions cannot read A&F discs )indo's I/, %KK* and

ista supports A&F

Step-': #ount t"e D?D

3he media is ormatted 'ith A&F Create a mount point and mount it in read-'rite mode

root>sysresccd D mkdir -p /mnt/)V)root>sysresccd D mount -t ud# -o rw1noatime /dev/3dd /mnt/)V)

Step-4: Write t"e data

 No' you can 'rite i(es to the && as you 'ou(d copy i(es to a mounted partition o your harddisk

6 First use du 9&isk Asage to check the siHe o a directory you are p(anning to save

root>sysresccd D du -s3 /3ome.* /3ome

+e careu( not to attempt to e7ceed the space avai(a$(e on a && 90M 4+ or a sing(e (ayer disc

3hen copy the directory and a(( su$directories preserving the origina( timestamps etc

root>sysresccd D cp -? -p /3ome /mnt/)V)

3he copy 'i(( $e s(o' since its not an hard disk

)hen you have inished copying data, unmount the &&, and run sync to cause the data to $e

'ritten:

MK

Page 71: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 71/174

root>sysresccd D umount /mnt/)V)root>sysresccd D syncroot>sysresccd D eIect

GorG

66Ase /artimage to save a partition to the &&, or e7amp(e:

root>sysresccd D partima"e save /dev/3da /mnt/)V)/dupoux;est?ootMrescued-0,0.pi

Sysresccd-manual-en Secure Deletion of Data

From SystemRescueCd

Jump to: navigation, searchContents

[hide

• " 6ntroduction

• % 3oo(s

• * 5ther 3oo(s

• 0 3esting

%ntroduction3he secure remova( o data is not as easy as you may think )hen you de(ete a i(e using the

deau(t commands o the operating system 9or e7amp(e <rm< in AN6I or <de(< in &5S oremptying the recyc(e $in in )6N&5)S the operating system does N53 de(ete the i(e, the

contents o the i(e remains on your hard disk

.ost operating systems on(y remove reerences to the i(e 'hen they are asked to de(ete a i(e 3hei(e - you thought has gone orever - remains on the disk unti( another i(e is created over it 9unti(

another i(e over'rites the disk space 'here the <de(eted< i(e is sti(( stored, and even ater that, it

might $e possi$(e to recover the data $y studying the magnetic ie(ds on the disk p(atter surace

using orensic euipment

+eore the i(e is over'ritten $y a ne' i(e, everyone can easi(y retrieve the data or e7amp(e $y

using a disk unde(ete uti(ity #nd even ater that some peop(e 9or e7amp(e the three-(etter-

agencies 'ith specia( euipment are a$(e to restore your data at (east partia((y

Every$ody has sensitive data 'hich they 'ant to keep private For e7amp(e inancia( data, privateemai(s, tracks o your internet suring ha$its etc 6 have heard o cases 'here peop(e so(d their o(d

computers or harddisks and the $uyer recovered their inancia( $usiness data

M"

Page 72: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 72/174

3he on(y 'ay to make recovering o your sensitive data near(y impossi$(e is to over'rite 9<'ipe<or <shred< the data 'ith severa( deined patterns For detai(ed inormation see the amous /aper

 $y /eter 4utmann http:;;'''csauck(andacnH;pgutKK";pu$s;secureOde(htm( 

C#A365N: 3he use o 'iping or shredding too(s re(ies on a very important assumption: that thei(esystem over'rites the data in p(ace 3his is the traditiona( 'ay to do things, $ut many modern

i(esystem designs do not satisy this assumption or e7amp(e ReiserFS, Reiser0, IFS, E7t* etc

See http:;;'''dienet;doc;(inu7;man;man";shred"htm( or more inormation 6n this case a

so(ution cou(d $e to 'ipe;shred the entire device 9partition 'here the sensitive data 'as stored toensure that the data is rea((y over'ritten

SystemrescueCd provides a e' too(s 'hich are a$(e to make recovering o data near(y impossi$(e

- 6 say near(y impossi$(e, $ecause no one can give you a guarantee that or e7amp(e the NS# or the

F+6 cou(d not recover at (east a part o that data $ut using those too(s makes it harder

C#A365N: 5n the other hand you 'i(( not $e a$(e to recover any data, de(eted $y those too(s3ake care )e 'i(( not take responsi$i(ity or (oss o data

6 you 'ant to have u(timate security, use encryption or e7amp(e =55/-#ES http:;;(oop-

aessourceorgenet;  Encrypt your home directory or create an encrypted partition or container to

save your data there

Aools

• SRE& rom the 4NA coreuti(s 9Fi(euti(s see http:;;'''gnuorg;sot'are;coreuti(s; or

http:;;'''gnuorg;sot'are;i(euti(s;doc;manua(;htm(;i(euti(shtm(VshredBou can use

shred to secure(y de(ete simp(e i(es $ut a(so entire partitions or harddisks Shred uses $y

deau(t %1 over'riting passes, you can increase and decrease the num$er o over'riting passes 3hereore shred is aster than 'ipe 9see $e(o'

For e7amp(e secure(y de(eting a(( data on the irst 6&E harddrive:

s3red -v /dev/3da.

• )6/E rom Sourceorge see http:;;'ipesourceorgenet Simi(ar to shred you can use 'ipe

to secure(y de(ete simp(e i(es $ut a(so entire partitions or harddisks )ipe uses $y deau(t*1 over'riting passes according to the /aper $y /eter 4utmann

http:;;'''csauck(andacnH;  pgutKK";pu$s;secureOde(htm( )ipe is s(o'er than shred,

 $ecause it uses $y deau(t more over'riting passes and thereore it is more secure

For e7amp(e secure(y de(eting the )indo's L8 S'ap Fi(e rom a mounted 9F#3 'indo's partition using *1 over'riting passes:

wipe -) /mnt/windows/win*86.swp

• SR. rom the 3C-Secure &e(etion 3oo(s see http:;;'''thcorg;re(easesphp@de(ete 

srm does secure de(etion o i(es

• SF6== rom the 3C-Secure &e(etion 3oo(s see http:;;'''thcorg;re(easesphp@de(ete 

M%

Page 73: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 73/174

si(( does a secure over'riting o the unused disk space on the harddisk si(( is the on(y AN6I too(6 kno' 'hich is a$(e to c(ean the unused 9ree disk space o a partition;harddisk Bou can a(so use

the <dd< command to over'rite the unused disk space 'ith Hero or random $ytes

• SS)#/ rom the 3C-Secure &e(etion 3oo(s see http:;;'''thcorg;re(easesphp

@de(ete 

ss'ap does a secure over'riting and c(eaning o the s'ap i(esystem

• S.E. rom the 3C-Secure &e(etion 3oo(s see http:;;'''thcorg;re(easesphp@de(ete

smem does a secure over'riting o unused memory 9R#.

3he 3C-Secure &e(etion 3oo(s use $y deau(t *8 over'riting passes $ased on the /aper $y /eter

4utmann http:;;'''csauck(andacnH;pgutKK";pu$s;secureOde(htm(, you can decrease the

num$er o passes

Ot"er Aools3here are other too(s on the SystemRescue C& 'hich you can use simi(ar(y to over'rite especia((y

devices, or e7amp(e

• <dd<: i@;dev;Hero or ;dev;urandom, o@device

• <ddOrescue<: 'orks simi(ar to <dd<

• <$ad$(ocks<: 'ith -' option or 'rites 0 static passes

For more inormation take a (ook at the manua(s

Aestin

6n order to see ho' the too(s 'ork and to check i a(( sectors or e7amp(e o a (oppy have $een

over'ritten, you can use CE, the virtua( conso(e he7 editor 6n our e7amp(e 'e 'i(( secure(yerase a(( data rom a (oppy

First type the o((o'ing command:

s3red -v -n /dev/#d0

Shred 'i(( over'rite the (oppy 'ith one random pass

3hen (ets run:

vc3e-raw /dev/#d0

3he (oppy shou(d $e i((ed 'ith random va(ues

3hen 'e type the o((o'ing command:

s3red -v -n -z /dev/#d0

M*

Page 74: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 74/174

3he -H option 'i(( make a additiona( pass 'ith Hero va(ues

#nd 'e run CE again

vc3e-raw /dev/#d0

3he (oppy shou(d $e i((ed 'ith Hero va(ues

Critica( Comments, and Suggestions are 'e(come: k(emens9dothoer9ataon9dotat

Sysresccd-manual-en #anae remote

windows linu servers usin

SystemRescueCdFrom SystemRescueCd

Jump to: navigation, search

Contents

[hide

• " #$out

• % E7amp(es o interesting things you can do

• * E7amp(e o ho' to use an automatic disaster recovery on remote serverso *" 5vervie'

o *% E7amp(e o a net'ork in a datacenter

o ** 6nsta((ing the &isaster Recovery system

o *0 /erorming the automatic recovery

• 0 )hat you need

• 1 o' to conigure SystemRescueCd on your net'ork

o 1" &evice $oot-order in the +65S 9production servers

o 1% #utorun scripts 9$ackup;recovery machine

o 1* dhcp server 9$ackup;recovery machine

o 10 ttp server 9$ackup;recovery machine

o 11 p7e(inu7 coniguration 9$ackup;recovery machine• 2 o' to use SystemRescueCd once its setup

o 2" Ase SystemRescueCd to perorm an automatic task

o 2% Ase SystemRescueCd to perorm a task $y hand

@bout

M0

Page 75: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 75/174

3he most popu(ar 'ay o using SystemRescueCd is rom a C&Rom drive on a desktop ininteractive mode Recent SystemRescueCd versions a(so come 'ith the support or net'ork $oot

via /IE 3he net'ork coniguration $oot options 9such as et3x=ip, "ateway=ip, dns=ip,

dod3cp a((o' you to automatica((y conigure the net'ork access to SystemRescueCd at $oot time

SystemRescueCd automatica((y starts an ssh server $y deau(t and you can deine a static root

 pass'ord on the $oot command (ine 3hat 'ay you can get an ssh conso(e to the server Dust $y

 $ooting a customiHed SystemRescueCd 3here is no need to conigure anything to get it to 'ork 6tcan $e very useu( or &isaster Recovery purposes, 6 mean to reinsta(( a $ackup o your operating

system ater a crash Bou can a(so use it to make any other administration task on your server

6n other 'ords, you can manae a windows or linu servers t"at is in a datacenter remotely/

from your office 3here is no need to $e in ront o the machine to insert a disc, conigure anet'ork interace, or set a root pass'ord #(( you have to do is to prepare a network boot server  

9one or severa( servers running the o((o'ing net'ork services: dhcpd, ttpd, httpd Bou can

insta(( these three services either on a dedicated physica(;vm'are server or on a productionmachine running other services

A"ere are two interestin ways of usin it:

• Bou can prepare a pxe boot server  so that you get an interactive ss" console to

administrate;repair your server $y hand Bou can preer the seria( conso(e that is a(so

supported 6 you need to run rap"ical prorams such as 4/arted remote(y, you can usethe vncserver $oot option 9reuires SystemRescueCd-"K% or ne'er so that the NC

server is automatica((y started on the remote machine

• Bou can a(so configure SystemRescueCd  in order to run your o'n autorun scripts to

perform automatic tasks 9$ackup, recovery,

Since the autorun eature o SystemRescueCd a((o's you to e7ecute scripts (ocated on an

ns;sam$a;http server, there is no need to spend time to make a customiHed SystemRescueCd

version #(( you have to do is to setup the p7e $oot server so that SystemRescueCd automatica((y $oots, conigure the net'ork and the root pass'ord, do'n(oad the autorun scripts, and e7ecute it

3o understand this chapter, you have to irst read the t'o previous chapters: /IE net'ork $ooting

'ith SystemRescueCd and Run your o'n scripts at start-up 'ith autorun

$amples of interestin t"ins you can do

• Disaster Recovery:

o restore a $roken 'indo's system 'ith ntsc(one;partimage

o restore a tar$a(( o your (inu7 operating system and reinsta(( gru$• .ard disk partitionin and administration tasks 

o ormat the hard disk and reinsta(( a copy o the operating system

o resiHe your partitions

o reinsta(( the gru$ $oot (oader

• Fi a critical problem 

o i7 a $oot pro$(em 9sck ai(s at $oot time

o reset the root pass'ord o your 'indo's system 'ith the ntpass (oppy disk image

o reset the root pass'ord o your (inu7 system $y chrooting on it

M1

Page 76: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 76/174

$ample of "ow to use an automatic disaster recovery on

remote servers

Overview

3his is a comp(ete e7amp(e o ho' you can organiHe an automatic disaster recovery on a net'ork

 $ased on three machines (ocated in a remote datacenter 3his e7amp(e sho's you 'hat kind o

things you can do 'ith SystemRescueCd 3he technica( detai(s and coniguration steps are given inthe ne7t sections

$ample of a network in a datacenter

6n your datacenter you have three servers:

" srv3 192.168.10.100 # )indo's 'e$ server running 66S and .S SQ=-Server

% srv) 192.168.10.101 # =inu7 'e$ server running #pache and .yS(

* srv( 192.168.10.102 # $ackup;recovery server running (inu7

%nstallin t"e Disaster Recovery system

Bou 'ant to $e a$(e to restore the operating system on srv" and srv% in case there is a sot'are pro$(em or an hard disk ai(ure For instance, i 'indo's ai(s to $oot on srv" $ecause o a virus,

you 'ant to $e a$(e to restore the operating system on the hard disk $y re$ooting the server on a

recovery script running SystemRescueCd ere is ho' to install t"is disaster recovery system:

" insta(( 'indo's on srv" 'ith at (east t'o partitions: C: or )indo's, &: or your &ata% in the $ios o srv", deine the $oot order as <net'ork, hard-disk<

* insta(( an apache or thttpd 'e$ server on srv* so that 'e can do'n(oad a i(e thought http0 re$oot on SystemRescueCd and make an image o the disk C using ntsc(one, save the

image on disk &:1 copy the ntsc(one image to srv* 'ith ssh;stp or tp

2 insta(( the p7e $oot services on srv* 9dhcp server, ttp server 'ith p7e(inu7, http server, the

SystemRescueCd i(esM 'rite a she(( script that restores the partition C: using ntsc(one and the $ackup you made

8 up(oad the recovery script you 'rote on the $ackup;recovery server in the 'e$ server data

i(es 9so that 'e can access 3ttp//,2.68.0.02/autorun

L conigure p7e(inu7 on srv* so that it $oots SystemRescueCd and conigure the net'ork and

runs 3ttp//,2.68.0.02/autorun automatica((y ere is an e7amp(e o a $oot

command (ine you can use 'ith p7e(inu7: append initrd=initram.i"zet3x=,2.68.0.00 rootpass=2*+ arMsource=3ttp//,2.68.0.02 autoruns= 

5erformin t"e automatic recovery

3hat 'ay, in case o a critica( pro$(em on srv", you can run t"e disaster recovery process in e'

minutes 5n(y the t'o irst steps reuires an action rom the user:

" connect to the $ackup server and start the p7e $oot services 9dhcpd, ttp, thttpd,

M2

Page 77: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 77/174

% use the management interace o the srv" machine to re$oot this server* since there is a dhcp server running, srv" 'i(( automatica((y $oot rom the net'ork

0 the p7e(inu7 $oot (oader starts SystemRescueCd 'ith the et3x=,2.68.0.00

rootpass=2*+ arMsource=3ttp//,2.68.0.02 autoruns= options

1 SystemRescueCd $oots and automatica((y conigures the net'ork and the system root

 pass'ord

2 since the autorun options 'ere used 9arMsource and autoruns, SystemRescueCd

do'n(oads the autorun script rom 3ttp//,2.68.0.02 

M the autorun" script is e7ecuted on srv", this script reads the ntsc(one image o the hard

disk thought the net'ork and it restores the hard drive8 Bou can a(so connect to SystemRescueCd using an ssh c(ient and the root pass'ord that

you deined previous(y, and you can run any command

#ter the &isaster Recovery is comp(ete, you must must stop the dhcp service on srv* so that srv"

cannot $oot rom the net'ork again Bou 'ant srv" to $oot rom the hard disk once it has $eenrecovered $y the autorun" script

W"at you need• Since 'e 'ant to re$oot rom the net'ork via p7e ater a pro$(em, you must $e a$(e to

remote(y re$oot the servers you 'ant to manage .ost servers manuacturers providemanagement interaces such as </ 6=5< 9integrated =ights5ut or <6+. RS#< 9Remote

Supervisor #dapter 3hese management interaces are oten connected through ethernet,

and they provide a 'e$ interace that (et you re$oot your server 6 you are using a server

 provided $y an host company, you may a(so have a speciic 'e$ management interacedeve(oped $y them that gives you the a$i(ity to re$oot the server 6n other cases, you may

ask an engineer 'orking in the datacenter to do that $y hand

• Bou a(so need another server on the same net'ork in the datacenter that can acts as a p7e

 $oot server 3his is the $ackup;recovery server, it may either $e a physica( machinerunning (inu7, or a virtua( machine running in .)are or instance 6t does not reuires a

(ot o storage;po'er # sing(e $ackup;recovery server can recover a(( the other servers oyour net'ork

• SystemRescueCd-"KK or ne'er

.ow to confiure SystemRescueCd on your network 

3his section descri$es ho' to set-up the servers o your net'ork in order to have them ready to

 perorm automatic tasks 'hen you $oot rom the net'ork via p7e 3here are t'o kind o servers inthe net'ork:

• 3he production servers that may $e $acked-up, recovered 3hey $oot SystemRescueCd to

 perorm administration tasks

• 3he sing(e backup,recovery mac"ine running =inu7 that provides the net'ork-$oot-

services to the other servers o your net'ork

Device boot-order in t"e !%OS =production servers>

MM

Page 78: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 78/174

)e 'ant the productions servers to $oot the norma( operating system rom the hard-disk 'henthere is no pro$(em, and they must $oot SystemRescueCd rom the net'ork 'hen 'e 'ant to

 perorm an administration task 3he $est 'ay o doing that is to conigure the device $oot-order in

the +65S o your production servers, so that they irst attempt to $oot rom the net'ork, and thenthey $oot rom the hard-disk o they ai( to $oot rom the net'ork

6t 'i(( $e necessary to start the &C/ service 9invo(ved in the /IE $oot process on the

 $ackup;recovery machine on(y 'hen you 'ant a server to $oot on SystemRescueCd )hen

everything is ok, the &C/ server must $e stopped, so that the server ai( to get a dynamic 6/address during the net'ork $oot, and then $oot rom the hard disk

#nother 'ay o doing that is to a('ays $oot rom the net'ork using the p7e(inu7 $oot (oader 6n

the p7e(inu7 coniguration i(e you can 'rite localboot 0x80 in the deau(t entry in order to orce

the server to $oot rom the hard disk any'ay

@utorun scripts =backup,recovery mac"ine>

Bou may 'ant your production server to $oot SystemRescueCd to get an interactive ssh conso(e toe7ecute commands yourse( 6n that case you dont need any autorun script and you can skip this

section Read this section i you 'ant your servers to $oot SystemRescueCd to perorm automatic

tasks

3he autorun eature o SystemRescueCd a((o's you to automatica((y e7ecute your o'n script onthe production servers 'hen SystemRescueCd $oots 3here is no need to $e in ront o the machine

to setup the net'ork or instance 3he $ackup;recovery machine 'i(( de(iver the autorun scripts to

the production machine 'hen it $oots Bou can use either NFS, Sam$a or 33/ to de(iver thisservice to the production servers =ets take 33/ as am e7amp(e since its easy to conigure

Bou have to setup an 33/ server on the $ackup;recovery machine 6t can $e apache httpd, thttp

or any other 'e$ server 6t must host the autorun scripts that you 'ant the other servers to e7ecute

automatica((y 'hen they $oot ere is an e7amp(e o ho' you can organise your 'e$ server so thatit provides * autorun scripts or each machine o your net'ork Bou cou(d a(so use the same script

or a(( the production $o7es i you preer

• 3ttp//,2.68.0.02/srv/autorun  $ackup script used $y the irst production

server

• 3ttp//,2.68.0.02/srv/autorun2  recovery script used $y the irst production

server

• 3ttp//,2.68.0.02/srv/autorun*  runs sck on a(( the partitions o the irst

 production server

• 3ttp//,2.68.0.02/srv2/autorun  $ackup script used $y the second production

server

• 3ttp//,2.68.0.02/srv2/autorun2  recovery script used $y the second production

server

• 3ttp//,2.68.0.02/srv2/autorun*  uns sck on a(( the partitions o the second

 production server

6ts important to notice that your autorun script must $e named either autorun 9sing(e script, or

autorunG0-,H 9mu(tip(e scripts Bou cant give another name such as backup

M8

Page 79: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 79/174

d"cp server =backup,recovery mac"ine>

3he &C/ server is the irst server contacted $y the production machine trying to $oot rom the

net'ork 3he &C/ service has to give the server a dynamic 6/ address, and other settings such asthe 6/ o the &NS server, and the 6/ o the 3F3/ server used in the ne7t stage o the $oot process

/(ease read the Chapter a$out /IE net'ork $ooting via /IE or more detai(s a$out it

ere is an e7amp(e o /etc/d3cp/d3cpd.con# coniguration i(e that can $e either edited $y hand

or generated $y the /etc/init.d/pxebootsrv service

K )O95 erver 9on#i"uration #ile.

ddns-update-style interimRi"nore client-updatesR

subnet ,2.68.0.0 netmask 2++.2++.2++.0[  option routers ,2.68.0.R  option subnet-mask 2++.2++.2++.0R

  option domain-name-servers ,2.68.0.R

  ran"e dynamic-bootp ,2.68.0.200 ,2.68.0.2+0R  de#ault-lease-time 2600R  max-lease-time *200R

  3ost srv  [  3ardware et3ernet 00092,+)06R  #ixed-address ,2.68.0.00R  \

  3ost srv2  [

  3ardware et3ernet 00092,+)0R  #ixed-address ,2.68.0.0R  \\

allow bootin"Rallow bootpR

next-server ,2.68.0.02R K (5 addr o# t3e ;<;5 server

class LpxeclientsL[  matc3 i# substrin"Eoption vendor-class-identi#ier1 01 ,F = L5X&9lientLR

  #ilename L/pxelinux.0LR\

tftp server =backup,recovery mac"ine>

3he 3F3/ server is the second server contacted $y the production machine trying to $oot rom the

net'ork 3he 3F3/ service has to send the production server the pxelinux.0 i(e to $e e7ecuted

irst 3his is Dust the $inary o the p7e(inu7 $oot (oader 3he 3F3/ server 'i(( a(so $e used to send

other i(es to the production server, such as the p7e(inu7 coniguration i(e, the kerne( to $oot, the

initram.i"z i(e, and it may a(so send sysrcd.dat and sysrcd.md+ that are necessary to

ML

Page 80: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 80/174

comp(ete the $oot process /(ease read the Chapter a$out /IE net'ork $ooting via /IE or moredetai(s a$out this stage

3he 3F3/ server has to send most the SystemRescueCd i(es that are provided in the C&-R5.

edition 9p7e(inu7 $oot (oader i(es, messages i(es or p7e(inu7, kerne( and initrams images SinceSystemRescueCd-K00-$eta, the SystemRescueCd i(esystem 9sysrcd.dat G sysrcd.md+ can $e

transerred $y either the ttp server or an http server 6 you 'ant to (oad these i(es through http

instead o ttp 9its aster, you shou(d rep(ace netboot=t#tp//pat3/to/sysrcd.dat  'ith

netboot=3ttp//pat3/to/sysrcd.dat

3he main dierence $et'een p7e(inu7 and iso(inu7 is that p7e(inu7 needs a conig i(e that is

inside the pxelinux.c#" directory instead o an isolinux.c#" #ile #ny'ay, the t'o kind o

coniguration i(es are very simi(ar, so you can use the contents o isolinux.c#" #ile to make

your customiHed pxelinux.c#" coniguration ere is an e7amp(e o 'hat i(es you may have on

your hard disk:

filepat" description

;ttp$oot;p7e(inu7K e7ecuta$(e i(e o the p7e(inu7 program

;ttp$oot;sysrcddat image o the i(esystem

;ttp$oot;sysrcdmd1 check o the i(esystem image

;ttp$oot;"$ootmsg message i(e disp(ayed $y p7e(inu7

;ttp$oot;%imagesmsg message i(e disp(ayed $y p7e(inu7

;ttp$oot;*paramsmsg message i(e disp(ayed $y p7e(inu7

;ttp$oot;0arunmsg message i(e disp(ayed $y p7e(inu7

;ttp$oot;1trou$(msg message i(e disp(ayed $y p7e(inu7

;ttp$oot;2p7emsg message i(e disp(ayed $y p7e(inu7

;ttp$oot;Mnetmsg message i(e disp(ayed $y p7e(inu7

;ttp$oot;memdisk (oads a (oppy disk image into memory

;ttp$oot;rescuecd irst kerne( image i(e 9deau(t *% $its kerne(

;ttp$oot;rescue20 second kerne( image i(e 9deau(t 20 $its kerne(

;ttp$oot;a(tker*% third kerne( image i(e 9a(ternative *% $its kerne(

;ttp$oot;a(tker20 ourth kerne( image i(e 9a(ternative 20 $its kerne(

;ttp$oot;initramigH common initrams image used $y the kerne(s

;ttp$oot;p7e(inu7cg;deau(t p7e(inu7cg deau(t coniguration i(e

;ttp$oot;p7e(inu7cg;K"-KK-Kc-%L-1M-dK-

20

conig speciic to server having

mac@KK:KC:%L:1M:&K:20

;ttp$oot;p7e(inu7cg;K"-KK-Kc-%L-1M-dK-

M0

conig speciic to server having

mac@KK:KC:%L:1M:&K:M0

8K

Page 81: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 81/174

3he most important i(e in the previous ta$(e is the p7e(inu7 coniguration i(e since you 'i(( haveto edit to 'rite the $oot settings you 'ant to use 3here are t'o kinds o coniguration i(es you

can use:

• Bou can either use a sing(e /t#tpboot/pxelinux.c#"/de#ault i a(( the servers have the

same p7e(inu7 coniguration

• Bou can a(so use i(ename $ased on the mac address o the c(ient i you 'ant each server to

have a speciic p7e(inu7 coniguration i(e For instance, /t#tpboot/pxelinux.c#"/0-

00-0c-2,-+-d0-6 'i(( $e (oaded $y the server having 00092,+)06 as a mac

address

/(ease read the ne7t section to kno' 'hat to 'rite in the p7e(inu7 coniguration i(e

pelinu confiuration =backup,recovery mac"ine>

3he p7e(inu7 coniguration i(e is simi(ar to a gru$ or (i(o coniguration i(e since its a

coniguration or a $oot (oader 6t says to p7e(inu7 'hich kerne( and ramddisk i(e to (oad into

memory, and 'hat $oot option to pass to the kerne( 9the parameters that 'e can read through/proc/cmdline once (inu7 is (oaded

6 you e7pect the server to $oot automatica((y, its important that you speciy a de#ault entry and a

timeout so that p7e(inu7 dont 'ait or a key$oard input rom the user ere is an e7amp(e o a

 p7e(inu7 coniguration i(e

/(ease notice there are on(y t'o (ines or each entry 9kernel and append # (ine $reak has $een

inserted on the 'e$ site $ecause the (ine is (ong $ut the (ine must not $e $roken in the

coniguration i(e

de#ault recoverytimeout 0prompt display #boot.ms"< #boot.ms"<2 #2ima"es.ms"<* #*params.ms"< #arun.ms"<+ #+troubl.ms"<6 #6pxe.ms"< #net.ms"label backup  kernel rescuecd  append initrd=initram.i"z arMsource=3ttp//,2.68.0.02/srv/ autoruns=

et3x=,2.68.0.00 netboot=t#tp//,2.68.0.0*/sysrcd.dat cdroot  dns=,2.68.0.2 "ateway=,2.68.0. setkmap=uslabel recovery  kernel rescuecd  append initrd=initram.i"z arMsource=3ttp//,2.68.0.02/srv/ autoruns=2

et3x=,2.68.0.00 netboot=t#tp//,2.68.0.0*/sysrcd.dat cdroot  dns=,2.68.0.2 "ateway=,2.68.0. setkmap=uslabel #sck  kernel rescuecd  append initrd=initram.i"z arMsource=3ttp//,2.68.0.02/srv/ autoruns=*  et3x=,2.68.0.00 netboot=t#tp//,2.68.0.0*/sysrcd.dat cdroot  dns=,2.68.0.2 "ateway=,2.68.0. setkmap=us

8"

Page 82: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 82/174

label ss3  kernel rescue6  append initrd=initram.i"z autoruns=no et3x=,2.68.0.00 rootpass=2*+  netboot=t#tp//,2.68.0.0*/sysrcd.dat dns=,2.68.0.2 cdroot  "ateway=,2.68.0. setkmap=uslabel serial  kernel rescuecd  append initrd=initram.i"z autoruns=no console=tty01,600 cdroot

  netboot=t#tp//,2.68.0.0*/sysrcd.dat dns=,2.68.0.2"ateway=,2.68.0. setkmap=us

label boot#romdisk  localboot 0x80

6n that e7amp(e the server 'i(( $oot the recovery entry, so it 'i(( $oot on the rescuecd kerne(,

and it 'i(( e7ecute the script autorun2 do'n(oaded rom

3ttp//,2.68.0.02/srv/autorun2 3he autorun2 script contains the instructions to

 perorm an automatic recovery o the server

ere is 'hat the entries do:

• backup o  $oots the rescuecd kerne( do'n(oaded through ttp and use initram.i"z as

initrams

o conigures the net'ork 'ith the ,2.68.0.00 ip address

o do'n(oads the 3ttp//,2.68.0.02/srv/autorun script to a temporary i(e

into the ram

o e7ecutes the autorun script that perorms a $ackup and re$oots

• recovery 

o  $oots the rescuecd kerne( do'n(oaded through ttp and use initram.i"z as

initrams

o conigures the net'ork 'ith the ,2.68.0.00 ip address

o do'n(oads the 3ttp//,2.68.0.02/srv/autorun2 script to a temporary i(e

into the ram

o e7ecutes the autorun2 script that perorms a recovery o the system and re$oots

• fsck  

o  $oots the rescuecd kerne( do'n(oaded through ttp and use initram.i"z as

initrams

o conigures the net'ork 'ith the ,2.68.0.00 ip address

o do'n(oads the 3ttp//,2.68.0.02/srv/autorun* script to a temporary i(e

into the ram

o e7ecutes the autorun* script that perorms an sck o the i(esystems and re$oots

ss" o  $oots the rescue6 kerne( do'n(oaded through ttp and use initram.i"z as

initrams

o conigures the net'ork 'ith the ,2.68.0.00 ip address

o sets the root pass'ord o the SystemRescueCd system to 2*+ so that 'e can

connect remote(y through ssh

o disa$(es autorun

• serial 

8%

Page 83: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 83/174

o  $oots the rescuecd kerne( do'n(oaded through ttp and use initram.i"z as

initrams 'ith options console=tty01,600 so that 'e can 'ork through the seria(

conso(e

o disa$(es autorun

• bootfromdisk  

o  $oots rom the irst hard disk

Every time you 'ant a server to e7ecute the task, you Dust have to change the irst (ine o the

coniguration i(e For instance you can change de#ault recovery to de#ault boot#romdisk 

once the recovery is comp(ete so that the server re$oots on the hard-disk the ne7t time Bou can

a(so stop the dhcp service on the $ackup;recovery server to orce the attempt to $oot the

 production server rom the net'ork to ai(

.ow to use SystemRescueCd once its setup

5nce your net'ork is insta((ed, using the SystemRescueCd to perorm automatic or manua(

administration tasks remote(y is very easy ere is ho' to use these eatures

Ese SystemRescueCd to perform an automatic task 

=ets take an e7amp(e: the hard-disk o the srv" machine 9"L%"28"K"KK crashed and has Dust

 $een rep(aced 'ith a $rand ne' empty disk Bou 'ant to perorm the recovery Do$ to restore the

operating system on this machine

" Connect on the $ackup;recovery server 9srv* and edit the p7e(inu7 coniguration i(e used

 $y srv" 9eg: /t#tpboot/pxelinux.c#"/0-00-0c-2,-+-d0-6 and 'rite the name o

the entry you 'ant to $oot in the de#ault section: de#ault recovery 

% Ensure the p7e $oot services 9dhcpd, ttpd, are started on the $ackup;recovery server

* Ase the management interace to re$oot the production server on 'hich you 'ant to perorm an administration task 9srv"

0 )ait * minutes, Dust to $e sure that the $oot process on SystemRescueCd is comp(ete on

srv"

1 Connect on the $ackup;recovery server 9srv* and edit the p7e(inu7 coniguration i(e used $y srv" 9eg: /t#tpboot/pxelinux.c#"/0-00-0c-2,-+-d0-6 and 'rite

boot#romdisk in the de#ault section so that the server 'i(( $oot rom the hard-disk the

ne7t time: de#ault boot#romdisk 

2 6 the recovery script has $een 'e(( designed, it shou(d restart automatica((y ater the

recovery is comp(ete, and srv" $oots on the production operating system

Ese SystemRescueCd to perform a task by "and

=ets take an e7amp(e: Bou orgot the root pass'ord o the srv% machine and you 'ant to get an

ssh connection on the SystemRescueCd to mount the root i(esystem and edit the pass'ord i(e9usua((y ;etc;shado'

" Connect on the $ackup;recovery server 9srv* and edit the p7e(inu7 coniguration i(e used

 $y srv% 9eg: /t#tpboot/pxelinux.c#"/0-00-0c-2,-+-d0- and 'rite the name o

the entry you 'ant to $oot in the de#ault section: de#ault ss3 

8*

Page 84: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 84/174

% Ensure the p7e $oot services 9dhcpd, ttpd, are started on the $ackup;recovery server* Ase the management interace to re$oot the production server on 'hich you 'ant to

 perorm an administration task 9srv%

0 )ait * minutes, Dust to $e sure that the $oot process on SystemRescueCd is comp(ete onsrv%

1 Ase ssh to connect to srv% rom your oice Bou must use the root pass'ord that you gave

on the command (ine on the p7e(inu7 coniguration i(e 9eg: 2*+ to connect to

SystemRescueCd &ont conuse 'ith the root pass'ord o the system that you 'ant to

change, that is 'ritten in the ;etc;shado' i(e on your hard-disk .ount the root partition,

and edit the i(e, or perorm any other administration task $y hand2 Connect on the $ackup;recovery server 9srv* and edit the p7e(inu7 coniguration i(e used

 $y srv% 9eg: /t#tpboot/pxelinux.c#"/0-00-0c-2,-+-d0- and 'rite

boot#romdisk in the de#ault section so that the server 'i(( $oot rom the hard-disk the

ne7t time: de#ault boot#romdisk 

M 6n the ssh conso(e to srv%, type re$oot 3he (inu7 system must restart 'ith the ne' root

 pass'ord on srv%

Sysresccd-manual-en Outil Systeme Complet@ssistance Reseau OSC@R 

From SystemRescueCd

Jump to: navigation, search

Contents

[hide

• " 6ntroduction• % 4uide(ines or net'ork administrators W ho' to use the /C recovery too(

• * o' to test 5SC#R 'ithout creating the 5SC#R C&-Rom

• 0 o' to create the 5SC#R C&-Rom

• 1 o' to use the 5SC#R C&-Rom

• 2 /rocedures avai(a$(e in the net'ork menu

• M &isk partitioning

o M" For a /C 'ith )indo's on(y

o M% For a /C 'ith =inu7 on(y

o M* For a /C 'ith $oth )indo's and =inu7

%ntroduction

OSC@R  has $een a ina(ist in the 3rophXes du =i$re %KKL : 

OSC@R  uses the main commands o the SystemRescueCd C&-R5. and makes them easi(y

avai(a$(e in a user-riend(y interace # genera( documentation is avai(a$(e at this AR= :

oscarcrdpac-(yonr  

80

Page 85: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 85/174

6ts simp(e commands run a(( the processes automatica((y3he commands on the screen a('ays te((sthe user 'hat to do ne7t Bou Dust need to kno' a e' commands 9o' to use the 5SC#R C&-

Rom Ase o the 5SC#R C&-R5., to manage a computer (eetY the documentation $ecomes

use(ess ater a sing(e use o 5SC#R

*uidelines for network administrators I "ow to use t"e 5C

recovery tool

OSC@R  can repair a au(ty computer 9virus, corrupted system i(e Bou on(y have to press the

$scape key 'hen $ooting the computer, then 5SC#R (aunches the recovery procedure

OSC@R  ena$(es net'ork administrators to set up a computer (eet rom a sing(e c(ean computer

and uick(y repairs the au(ty computer

%ts principle: each computer has an e7t0 =inu7 partition 'hich stores the $ackup o the 5peratingSystem partition Shou(d a ai(ure occur, 5SC#R 'ou(d restore this 5S partition rom the $ackup

 partition6 you 'ant to keep some private data upon recovery, you shou(d use another partition

dedicated to these private data Z.y documents directory, or e7amp(e, can $e on this dedicated partition 5 course, this C&-Rom can $e used on a sing(e computer as 'e(( as on a (eet o

computers

OSC@R  manages severa( $ackups on the same computer

OSC@R  manages severa( 5perating Systems

OSC@R  automatica((y renames the c(ient /Cs and can attach them to a )6N&5)S domain

OSC@R  can save a partition on an e7terna( AS+ hard disk

OSC@R  can $e started rom a CD-Rom, a ES! drive, a =#N 'ith a 56$ server or can $e

insta((ed (oca((y on the computer hard disk

OSC@R  can perorm schedu(ed recoveries 9at night or e7amp(e

.ow to test OSC@R wit"out creatin t"e OSC@R CD-Rom

+urn a SystemRescueCd C&-R5. 

Bou can run OSC@R  'ithout creating the C&-Rom $y se(ecting Aest OSC@R  'hich is avai(a$(e

rom the command (ine:

cd_oscar

3his 'ay, you 'i(( have access to many 5SC#R commands e7cept the sauve $ackup command to

make sure you keep your data #ctua((y, a pass'ord is necessary shou(d you orget a C&-Rom in acomputer

81

Page 86: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 86/174

.ow to create t"e OSC@R CD-Rom

• +urn a SystemRescueCd C&-R5. 

• /repare the computer on 'hich you 'i(( run the OSC@R  C&-R5. :

6 you don\t have a =inu7 partition o " 4+ minimum, 'hich is the minimum siHe, $oot thecomputer 'ith the <SystemRescueCd< 9)hen starting the C&, type rescuecd, altker() or

rescue&', altker&' +ooting the C&-R5. to create one 'ith the o((o'ing command (ine:

cd_oscarselect S &est 'scar @in t3e menu dis(ues c3oose )*arted 

3hen $oot the computer under )indo's and create the directory, C:,cdOSC@R  9or &:;cd5SC#R

and the t'o su$-directories: C:,cdOSC@R,scripts, and C:,cdOSC@R,dossiers, 9'arning: case

sensitive

5ne remark: these directories can a(so $e set up on a =inu7 partition system

" /ut your persona( i(es and sot'are under the C:,cdOSC@R,dossiers, directory

% Bou may add your o'n scripts in the C:,cdOSC@R,scripts, directory

* Bour o'n OSC@R7iso i(e 'i(( $e copied in the C:,cdOSC@R  directory

• Creation o the OSC@R  C&-R5.:

Start the computer 'ith the SystemRescueCd  C&-R5. 'ithout the docac"eoption 9on C&-R5. $oot, type altker() or rescue&', altker&'

run the command (ine:

cd_oscar

Bou 'i(( $e prompted:

" a choice $et'een 5SC#R and RapideS5S: choose 5SC#R,

% the mark o an e7t0 partition o " 4+ minimum,

* the administrator pass'ord that you have chosen,

0 the mark o the partition 'here the 5SC#Riso i(e 'i(( $e stored

#t the end, the 5SC#Riso i(e is stored under the C:;cd5SC#R directory +urn it under )indo's

or =inu7 Bour persona( data are stored on tha hard drive under the ,5ersonnel directory Bou can

a(so create the ast automatic recovery C&-R5. ca((ed RapideSOS7iso to $e given to the personin charge o the computer (eet 3o repair a computer, Dust $oot it 'ith this RapideS5S C&-R5.

'hich 'i(( perorm the automatic recovery process

.ow to use t"e OSC@R CD-Rom82

Page 87: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 87/174

• /reparation o the /Cs :

5n the /Cs, insta(( a =inu7 partition 'hose siHe must $e eua( to the siHe o the partition to $ackup )ith the OSC@R  C&-R5. use the *5arted command o the dis0ues menu to create

these partition

• 5vervie' o some OSC@R  commands :

3o save a /C the sauve command o the sauvearde menu, (ooks or the =inu7 $ackup partitionand then copies on them the partition chosen $y the user 3o restore a /C therestaure command

(ooks or the $ackup partition and restores it

)hen a /C is u((y insta((ed and has an up-to-date $ackup on a =inu7 partition, it is very easy to

restore the C: partition o another /C 9or severa( rom it : the t'o /Cs have to $e connectedthrough a cross-over ca$(e or via a regu(ar net'ork

• Comp(ete insta((ation o a room:

# too( situated in the net'ork menu a((o's the comp(ete and simu(taneous insta((ation o a(( the

c(ient /Cs 3he advantage o this method is that you on(y have to setup one /C, 'hich 'i(( $ecome

the reerent server /C or the 'ho(e room )#RN6N4: the c(ient /Cs 'i(( (ose the data o a(( theirdisks P )ith the complete command o the reseau menu, the server /C sends the partition ta$(e o

a(( its disks and its $ackup partition to the c(ient /Cs Y the c(ient /Cs 'ith the c(ient command 'i((

have the same ormated partitions as the server /C, then 'i(( $e restored and named, 6/ anddomain 'i(( $e insta((ed

3o avoid manipu(ating C&-R5. on the c(ient /Cs, you can $oot the c(ient /Cs direct(y rom the

=#NY the C&-R5. 'i(( $e (oaded through the net'ork rom the server /C Ase the serveur856$

command o the reseau menu on the server /C

• Restoration o a comp(ete room:

3he advantage o this method is a ast update o sot'are app(ications o a comp(ete room

6./5R3#N3:

" For a )indo's operating system, a(( the $ackup partition o the /Cs must have the same

siHe% For a )indo's operating system, the hard'are characteristics o the /Cs are the same or

you have a(( the drivers or a(( the hard'are Y under =inu7, a(( the hard'are are supported

* Choose a server /C 'hich has a good $ackup partition

3he simple command o the reseau menu automatica((y the /C as a server 'hich shares its $ackup 3he client command automatica((y conigures the c(ient /Cs: )ith these commands the

server simu(taneous(y sends its $ackup to a(( the c(ients 3he restoration o a comp(ete room is as

ast as the restoration o a sing(e /C P 5n(y the saved partitions are restored, the other partitions arenot aected

• #ter a dep(oyment via the net'ork o the c(ient /Cs:

8M

Page 88: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 88/174

3he setup o the hostname and )indo's domain on the c(ient /Cs is automatic or $oth )indo'sand =inu7 For )indo's 5SC#R persona(iHes the hostname and domain name 'ith sysprep or

newsid, or =inu7, 5SC#R takes care o everything #(( the c(ient /Cs can $e mode( server

(ink : group and domain net'ork )indo's 

• 6nsta(( OSC@R  on the /C

6n order to avoid the use o C&-R5.s, the installer command o menu8oscar in di0ues insta((s

OSC@R  i(es on the /C

3he cle8usb command o menu8oscar sets up an 5SC#R AS+ key 'hich rep(aces the C&-R5.

5rocedures available in t"e network menu

" Restaure : restores the c(ient /Cs rom the server /C, sets up the 6/ address, the hostname

and the )indo's domain Y

% Simple : sends its backup to the c(ient /Cs then restores the c(ient /Cs and sets up their 6/address, host name and )indo's domainY

* Formate : formats the c(ient /Cs 'ith the same partition scheme as the server /C, thenrestores the c(ient /Cs and sets up their 6/ address, host name and )indo's domainY

0 Complete : formats the c(ient /Cs 'ith the same partition scheme as the server /C, sends

its backup, then restores the c(ient /Cs and sets up their 6/ address, host name and)indo's domainY

1 Aable : sends the partition table then formats the c(ient /Cs

2 3o send 5SC#R i(es to c(ient /Cs : oscar8sync"rone or oscar8async"rone o

menu8oscar in disks

For the c(ient /Cs a sing(e command : client

For a irst in insta((ation use the complete command 'ith the /IE server, or an update o a room

use the simple command

For each o these commands, there is "elp 'hich sho's the process

Disk partitionin

3o create these partitions, use *5arted in the dis0ues menu

For a 5C wit" Windows only

Windows 1AFS OSC@R $t' Data 1AFS/ or fat()

/rimary *K4o /rimary *K4o /rimary, the rest

For a 5C wit" Hinu only

88

Page 89: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 89/174

Ebuntu $t' swap OSC@R $t' Data $t'/ or fat()

/rimary %K4o /rimary %4o /rimary %K4o /rimary, the rest

For a 5C wit" bot" Windows and Hinu

Windows 1AFS Ebuntu $t' swap OSC@R $t' Data $t'/ or fat()

/rimary *K4o =ogica( %K4o =ogica( %4o =ogica( 0K4o =ogica(, the rest

Sysresccd-manual-en !ackup data from an

unbootable windows computer

From SystemRescueCd

Jump to: navigation, search

Contents

[hide

• " #$out

• % 5vervie'

• * Step-": prepare the $oota$(e cdrom;us$-key

• 0 Step-%: get access to your 'indo's disk

o 0" &etection o the diskso 0% #ccess to the right partition

• 1 Step-*: $ackup your data through the net'ork

o 1" Coniguration o the 6/ net'ork

o 1% Coniguration o the SF3/ server

o 1* Coniguration o the SF3/ c(ient

• 2 Step-0: re$oot your computer

@bout

3his tutoria( e7p(ains you ho' you can $ackup the data rom a )indo's computer that cannot $e $ooted any more 3here are many reasons 'hy a 'indo's computer cou(d stop 'orking:

insta((ation o a $ad driver, system crash 'ith disk corruption, system i(es de(eted, 6n that case

you can Dust reinsta(( the operating system, $ut the most important is to irst $ackup your data 6)indo's is not $oota$(e, you can Dust $oot using SystemRescueCd to do that Even i its running

=inu7, its a$(e to read the 'indo's disk, and then you 'i(( $e a$(e to $ackup your data through

the net'ork #(( the steps are detai(ed in this tutoria( so that 'indo's users 'ith no kno'(edge o

=inu7 can o((o' it to $ackup their data

8L

Page 90: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 90/174

6 its the irst time you use SystemRescueCd, its recommended to read the Quick start 4uide iyou have pro$(ems

Overview

SystemRescueCd is a (ivecd 6t contains a comp(ete operating system $ased on =inu7 6t means you

'i(( $e a$(e to run program rom that environment even i the )indo's 5S 'hich is insta((ed onyour computer is $roken 5 course, you 'i(( need a 'orking computer to do'n(oad an $urn

SystemRescueCd 6 you rea((y cant do that you can a(so $uy a disc rom on(ine shops

• Step-3: prepare t"e bootable cdrom,usb-key 

First, you have to do'n(oad and $urn SystemRescueCd 3o do that you need a 'orking computer

6 you cant $oot SystemRescueCd rom a cdrom, you can a(so 6nsta(( SystemRescueCd on a AS+stick  and $oot rom it

• Step-): et access to your windows disk  

6n this section, 'e 'i(( see ho' to read the 'indo's disks rom =inu7, too see 'hat i(es can $e

 $acked up

• Step-(: backup your data t"rou" t"e network  

6 you have a net'ork access 9Ethernet card and another computer 'here to copy the data thissections e7p(ains ho' to conigure the net'ork and copy the data to another $o7

• Step-': reboot properly 

Step-3: prepare t"e bootable cdrom,usb-key

#(( you have to do is to do'n(oad the (atest 6S5 image o SystemRescueCd or 782, to $urn it on acdrom disc using any $urning sot'are such as Nero 6 you dont have any $urning sot'are, you

can do'n(oad 6mg+urn or C&-+urner I/ 'hich are ree 6 the computer 'here 'indo's is

 $roken cannot $oot rom a cdrom disc, you can a(so 6nsta(( SystemRescueCd on an AS+ stick  and $oot rom it

3hen, go in the +65S o your computer 9you oten have to press F% or &E= during the hard'are

initia(iHation period, go in the section 'here the $oot order is deined, and make sure the cdrom or

the AS+ device is the irst device in the (ist 9or $eore the hard drive

 No', re$oot 'ith the cdrom ; us$ stick inserted 6 it 'orks, you shou(d see a SystemRescueCd#SC66 art (ogo, and $oot instructions Bou can then Dust press enter to $oot SystemRescueCd 'ith

the deau(t settings 6 you p(an to use the net'ork, its recommended to $oot 'ith your net'ork

settings so that you dont have to conigure it (ater 3o do that, Dust type the o((o'ing (ine at the prompt and press enter 5 course, you have to rep(ace this address 'ith the 6/ address to

conigure or that computer:

rescuecd et3x=,2.68..+8 "ateway=,2.68..2+

LK

Page 91: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 91/174

3he gate'ay address is reuired on(y i you can to connect to computer that are (ocated on adierent net'ork 3o use a dynamic 6/ address instead o a static 6/, you can type that:

rescuecd dod3cp

&ont 'orry a$out the net'ork settings no', you can change it (ater i it ai(s Bou can a(so readthe chapter a$out the $oot options to have more detai(s a$out it

Step-): et access to your windows disk 

)hen the $oot process is inished, you shou(d get a $(ack screen 'here to type commands #(( the

o((o'ing steps 'i(( $e $ased on commands so you may stay in this environment Bou can a(so runcommands rom a termina( in the graphica( environment i you preer Just type startx or wizard 

in that case

Detection of t"e disks

3he irst thing to do is to detect the partition 'here your data are (ocated =inu7 is using namesthat are dierent rom 'indo's or the disks, so you 'i(( see names such as /dev/sda,

/dev/sda2 instead o 9 or ) 3o detect the disks and partitions, Dust run the o((o'ing command:#sarc3iver probe simpleScode@. You s3ould see an output like t3at

root>sysresccd /root D #sarc3iver probe detailedG=====)&V(9&=====H G==<(!&Y==H G=====!$%&!=====H G====(W&====H G4$H G4(HG/dev/sda H Gnt#s H G7indows-X5 H G 2+.00 %H G 8H G HG/dev/sda+ H Gnt#s H G)ata H G 20.00 %H G 8H G +HG/dev/sda6 H Gnt#s H G%ackup H G 0.00 %H G 8H G 6H

6n that e7amp(e there are three partitions on the computer, you may Dust have one or t'o partitions

on(y 3he irst co(umn is very important since it is the device name o the partition that 'e 'i((need to access to your data Bou shou(d 'rite that name on a paper

@ccess to t"e ri"t partition

 No' 'e 'i(( have to make these data accessi$(e rom the system =ets consider that you 'ant to $ackup the data (ocated on the disk ca((ed >code?;dev;sda" 3he irst thing to do is to mount the

 partition on a directory 6t on(y means that this directory 'i(( contains a vie' to your disk, it 'ont

'rite anything to it:

nt#s-*" -o ro /dev/sda /mnt/windows

3he on(y option 'hich is used here is -r, it means that the data on the disk are mounted 'ith a

read-on(y access )e Dust use this option to make sure 'e cant do an error that cou(d destroy these

data, $ut you can mount the disk 'ith a comp(ete read-'rite access i you preer 9Dust remove that

option rom the command No', (ets see the contents o the partition:

cd /mnt/windowsls -l

Bou shou(d see something (ike that:

L"

Page 92: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 92/174

Page 93: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 93/174

d3client et30

Confiuration of t"e SFA5 server

6n this section 'e 'i(( consider that the $roken computer is using "L%"28""18 and the computer

'here you 'ant to copy the data is "L%"28"%K

.u(tip(e protoco(s can $e used to transer your data 6n this tutoria( 'e 'i(( use the SC/;SS protoco( or severa( reasons:

• its using on(y a sing(e 3C/ connection on port %% 'hich is easier to conigure than F3/

'hich reuires t'o connections to 'ork

• its re(ia$(e, and its encrypted to there is no risk or your data i you dont trust the peop(e

connected to your (oca( net'ork

• its very easy to conigure on the c(ient and server side 9sam$a can $e use to share your i(es

 $ut the coniguration may $e tricky

3he $roken computer is running an 5penSS server 'hich means another computer can connect

to it using port tcp;%% as (ong as it kno's the pass'ord the computer 'here the data 'i(( $e copier'i(( have to e7ecute an SF3/ c(ient )e recommend Fi(eHi((a-c(ient 'hich is a very good ree and

mu(tip(atorm F3/;SF3/ c(ient you can use it e7act(y as any other F3/ c(ient e7cept the protoco(

'i(( $e SF3/ Bou can a(so use )inSC/ i you preer

 No', 'e 'i(( have to set the pass'ord on the server side 9on (inu7 so that 'e can connect romthe other end Just type the o((o'ing command, and type the pass'ord t'ice 9it 'ont $e disp(ayed

on the screen or security reasons:

passwd

Confiuration of t"e SFA5 client

 No' the server is ready, you can go to the other computer 9'hich is 'orking, insta(( Fi(eHi((a-

c(ient to it 9Fi(eHi((a 'orks on )indo's and =inu7, and do this:

• c(ick on Fi(e;Site-manager in the menu $ar

• c(ick on ne'-site to create a ne' connection

• i(( the dia(ogue 'indo' 'ith the o((o'ing inormation:

o ost: "L%"28""18 96/ address o the computer running SystemRescueCd

o /ort: %%

o Server type: SF3/ 9SS Fi(e 3ranser /rotoco(

o =ongon type: Norma(

o =ogin: root

o /ass'ord: type the pass'ord you typed in the previous step

o C(ick on <#dvanced<

o &eau(t &irectory: ;mnt;'indo's

•  No' c(ick on connect

L*

Page 94: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 94/174

Bou shou(d no' $e connected to the 5penSS server running on SystemRescueCd, and youshou(d see the (oca( disk on one side o the 'indo', and the remote disk on the other side 6 you

dont see your remote i(es, you have to go in the directory /mnt, and then in windows 

Step-': reboot your computer

)hen you have inished using SystemRescueCd, its recommended to unmount your 'indo's partition, and then re$oot proper(y the computer:

umount /mnt/windowsreboot

Sysresccd-H?#-$1-Overview-of-t"e-loical-

volume-manaer

From SystemRescueCd

Jump to: navigation, search

Contents

[hide• " #$out

• % &escription

• * Concrete e7amp(e

• 0 o' to use =.• 1 Reasons to use =.

• 2 =imitations 'ith =.

@bout

=. is the Hoical ?olume #anaer or =inu7, current(y in version % 6ts the ne' method to

manage the disk storage in a 'ay 'hich is more (e7i$(e than the traditiona( disk partitioning 6ta((o's you to create and modiy vo(umes easi(y 3he standard partitioning method has many

(imitations: 'hen you shrink partition 'hich is at the end o your disk, you have to move the partitions i you 'ant to rea((ocate this space to gro' another partition )ith =. you dont have

such pro$(ems #(( you need to use =. is a =inu7-%2 kerne( 'ith the device-mapper supportena$(ed, and the (vm% userspace too(s =.% has $een in production many years so its no' very

sta$(e and you shou(d not have any pro$(em 'ith it =. comes 'ith a(( the recent mainstream

=inu7 distri$utions, and its even use $y deau(t on Redhat =inu7 3he purpose o this document isto he(p you to understand 'hat it is, ho' is 'orks, and to decide 'hether or not its good or you

Description

L0

Page 95: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 95/174

6n the traditiona( partitioning (ayout, there are Dust t'o (eve(s o storage: the physica( disks, and the partitions 'hich are containers inside a physica( disk =. comes 'ith three (eve(s o storage to

oer more (e7i$i(ity )e end up 'ith containers ca((ed =ogica(-o(umes 'hich correspond to an

improved type o disk partitions 6ts important to understand that partitions and =ogica(-o(umesare Dust sets o disk $(ocks 'ith a siHe Bou sti(( have to make a i(esystem on your vo(ume to use

it 6ts dierent rom So(aris FS 'here the vo(ume manager and the i(esystem are integrated 6n

the 'or(d o =inu7, the vo(ume manager and the i(esystem are independent Bou can choose'hich i(esystem you 'ant to use on the top o a =ogica(-o(ume 3he e7t* i(esystem is the

deau(t choice $ecause its very sta$(e, $ut you can a(so use reisers or 7s or instance 6n the

uture, $trs 'i(( $e the standard i(esystem in =inu7

ere are the three (eve(s o storage:

• 5"ysical ?olumes =5?>: 3his is the physica( storage used $y =. it may $e an entire

disk or an e7isting partition

• ?olume *roup =?*>: 3his is an aggregate o one or more /hysica( o(umes, and it

contains =ogica(-o(umes

• Hoical ?olume =H?>: 3his is the space oered $y =. that you can use as a partition to

make a i(esystem and store your i(es

6n any case a(( these three (eve(s are reuired Bou have to create a o(ume-4roup even i you

on(y have one /hysica(-o(ume on your computer )ith these three (eve(s o storage, you can

organiHe your data in a very (e7i$(e 'ay, and you can sometimes make very interestingcom$inations

=. manages the disk space in chunks ca((ed e7tents 3hey a(( have the same siHe 9*%.+ in

genera( 3hat 'ay the $(ocks o a vo(ume can $e spread over the 'ho(e siHe o your disks, 'hich

a((o's to resiHe the vo(umes mu(tip(e times 'ith no (imitation other than the tota( disk space

6ts a(so possi$(e to use $oth =. and the traditiona( partitioning method on the same disk: or

instance you can insta(( )indo's on the irst partition o your disk, insta(( (inu7 on the second

 partition, and create a third partition or =. to store your data in a (e7i$(e 'ay

Concrete eample

=ets consider you have t'o hard disks: /dev/sda 9%1K4+ and /dev/sdb 9"2K4+ =ets create

our primary partitions on the irst disk or =inu7-$oot, )indo's, =inu7-root, and =., and one

 partition or (inu7 on the second disk 9entire(y dedicated to =.:

K parted /dev/sdaparted@ mklabel msdosparted@ mkpart primary 0 004parted@ mkpart primary 004 ,64parted@ mkpart primary ,64 82,24parted@ mkpart primary 82,24 00Dparted@ Cuit K parted /dev/sdbparted@ mklabel msdosparted@ mkpart primary 0 00Dparted@ Cuit

L1

Page 96: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 96/174

3he ne7t thing to do is to create t'o /hysica(-o(umes on these disks 6t 'i(( Dust initia(iHe theset'o disks so that =. can use it 3here is no name associated 'ith /hysica(-o(umes other than

the name o the device 'here they have $een created

K pvcreate /dev/sdaK pvcreate /dev/sdb

 No', 'e 'i(( create one o(ume-4roup as the concatenation o the t'o /hysica(-o(umes )ehave to choose a name or this o(ume-4roup, (ets use Volroup00:

K v"create Volroup00 /dev/sda /dev/sdb

Bou can print detai(s a$out this ne' o(ume-4roup using either v"display or v"s

3his o(ume-4roup no' provides a$out 0KK4+ o storage that 'e can use to make =ogica(-

o(umes Each time 'e create a =ogica(-o(ume 'e have to give it a name and a siHe )e cou(dmake one $ig =ogica(-o(ume o 0KK4+ is 'e 'anted to, $ut (ets create on(y t'o =ogica(-

o(umes and e7t* i(esystems on the top:

K lvcreate -n data -! +0 Volroup00K mke2#s -I /dev/Volroup00/data -! dataK mount /dev/Volroup00/data /mnt/data K lvcreate -n backup -! *+ Volroup00K mke2#s -I /dev/Volroup00/backup -! backupK mount /dev/Volroup00/backup /mnt/backup

)hen you use (vcreate your system 'i(( create a specia( i(e to manage this device 6t can $e either

/dev/v"name/lvname or /dev/mapper/v"name-pvname or $oth

#ter some time, you may decide to use the disk space 'hich is not yet a((ocated in your o(ume-4roup to gro' a =ogicia(-o(ume 'hich needs more space .ost (inu7 i(esystems can $e gro'n

on(ine, 'hich means that you dont have to unmount it 3hey can $e gro'n even i they are in use

3his is very useu( on servers or 'hich 'e 'ant to avoid any do'n time =ets add "K4+ o spaceor the $ackups:

K lvresize -! ]0 /dev/Volroup00/backupK resize2#s /dev/Volroup00/backup

3he command to resiHe a =ogica(-o(ume is (vresiHe Bou can either give it a re(ative siHe 9G"K4+ to gro' it $y "K4+ or an a$so(ute siHe 9014+ )hen no siHe is given to resiHe%s 9the too(

that resiHes e7t%;e7t*;e7t0 i(esystems, then it automatica((y gro's to the siHe o the under(ying

vo(ume 'hich is 'hat 'e 'ant +e careu( i you shrink a vo(ume Bou have to unmount thei(esystem irst since the (inu7 i(esystem dont support on(ine shrinking e7cept $trs #(so you

have to shrink the i(esystem irst 9using resiHe%s, resiHeOreisers, and then you can resiHe the

vo(ume # i(esystem cannot $e $igger than the vo(ume 'here it (ives For this reason, its good practice not to a((ocate a(( the space o your o(ume-4roups immediate(y 6ts recommended to

create sma(( =ogica(-o(umes irst to (eave some ree space on your o(ume-4roup #nd you can

a('ays gro' the vo(umes (ater 'hen you need more space 3hat 'ay you shou(d not have to

unmount a i(esystem to shrink to ree some space or other =ogica(-o(umes 6t 'ou(d reuiresome do'n time 'hich is not a('ays possi$(e on production machines

L2

Page 97: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 97/174

.ow to use H?#

3here 'as a version " o =. $ut its very o(d no' so a(( the recent =inu7 distri$utions have

=.% +y deau(t (vm can $e managed using the command (ine too(s 'hich come 'ith the

 package ca((ed (vm% 3he names o these commands are very easy to remem$er: in genera( there isa prei7 'hich is one o these: pv, vg, (v depending on 'hat sort o o$Dect 'e 'ant to 'ork on

9/hysica(-o(umes, o(ume-4roups, =ogica(-o(umes 3hen comes the name o the action 'e'ant to perorm: create, disp(ay, rename, reduce, )e end up 'ith command such as pvcreate,

v"create, lvcreate, pvdisplay, 6 these commands are not avai(a$(e and you are sure (vm% is

insta((ed, you may have to use these commands as argument o the main (vm $inary So you may

have to type something (ike lvm lvcreate Sar"uments@ instead o lvm lvcreate

Sar"uments@

3here is no rea( need or graphica( too(s 'ith =. $ecause the physica( 'ay the $(ocks are stored

does not rea((y matters )ith =. 'e dont have to kno' 'hether the vo(ume is stored at the

 $eginning or at the end o the disk: you can gro' or shrink your vo(umes as (ong as there is somespace some'here in the o(ume-4roup 3he (vm% commands are rea((y easy to use direct(y once

you understand ho' it 'orks #nd these commands accept the siHes in common units such as .+,4+, 3+ Bou dont have to 'orry a$out sectors or cy(inders #nd then you Dust have to use thei(esystem commands such as mks, sck, resiHes on your vo(umes, there is no rea( need or

graphica( too(s to do that as 'e((

Reasons to use H?#

3here are many good reasons to use =.:

• Fleible disk space manaement: 

3he irst reason to use =. is to have a (e7i$(e 'ay to use the ree space o your disk and to $ea$(e to a((ocate the space rom any'here on the disk to gro' vo(ume #nd $ecause most (inu7

i(esystems support on(ine gro'ing there is no do'n time 'hen you Dust 'ant to gro' a a vo(ume

• #ake read-only snaps"ots of a volume: 

)ith =. you can create read-on(y snapshots o an e7isting =ogica(-o(ume as (ong as you havesome space in your o(ume-4roup to store a copy o the origina( $(ocks 'hich are modiied

during that time 6ts the $est 'ay to make consistent (inu7 $ackup $ecause the $(ocks rom the

read-on(y snapshot are roHen in the origina( state 'hi(e the norma( i(esystem is sti(( $eingmodiied

• 5reserve t"e name of your volumes: 

3he name o physica( disks and partitions may change i you reconnect the same disk on another

computer or i you p(ug it on another disk contro((er in the same machine 3he partition 'hich 'as

named /dev/sda may $e /dev/sdb on another computer 3his can $reak many things (ike the

a$i(ity to $oot )ith =. the =ogica(-4roups and the =ogica(-o(umes 'i(( keep the names they

have $een given even i the name o the physica( disk is modiied Bou can rename them at

anytime using commands such as v"rename or >;code?(vrename>;code?

LM

Page 98: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 98/174

• @void limitations of t"e number of volumes: 

6 your hard disk is using the msdos disk(a$e( 9the standard partition ta$(e system used on mostcomputers then you are (imited to 0 primary partitions Bou can have more partitions i you have

an e7tended partition, $ut the imp(ementation is $ased on (inked (ist so its very ragi(e 6 you

(oose a (ink to a (ogica( partition, you 'i(( (oose the ne7t ones #ny'ay (inu7 on(y supports up to"2 partitions per disk $ecause the "Mth minor num$er is used or the irst partition o the ne7t disk

)ith =. you dont have this (imitation so you can have more than "2 =ogica(-o(umes per disk

• Hive-miration of your data: 

6ts possi$(e to move =ogica(-o(umes rom one physica( disk to another disk 'hi(e the i(esystemsare sti(( in use 9mounted 'ith a read-'rite access and modiied 3o do that, you must irst create a

ne' /hysica(-o(ume on the ne' disk, add it to the current o(ume-4roup using v"extend 3hen

use pvmove to move the e7tents o your =ogica(-o(umes rom the o(d disk to the ne' one 9they

'i(( stay inside the same o(ume-4roup 3hen remove the o(d /hysica(-o(ume rom the

o(ume-4roup using v"reduce, and then destroy the o(d /hysica(-o(ume 6ts a very useu(

techniue to upgrade to a $igger hotp(ug hard-drive on a production server that must stay in production during the migration o the contents

• Concatenate multiple smalls disks: 

=ogica(-o(umes can $e $igger than a physica( disk $ecause a o(ume-4roup can $e made o

mu(tip(e /hysica(-o(umes

Himitations wit" H?#

&espite these good things =. may not a('ays $e appropriate:

• 1on-linu operatin systems wont see t"e volumes: 

3here is current(y no' sta$(e so(ution or reading =inu7 =. vo(umes rom another operating

system such as )indo's Even i you use an N3FS i(esystem on your =ogica(-o(ume, )indo's

'ont $e a$(e to read it $ecause o the =. 'ay to organise the disk e7tents 6ts a(so true or the proprietary sot'are: in genera( the commercia( products such as /artition-.agic or Norton-4host

dont support =. Bou have to use the standard (inu7 administration too(s instead

• @n initramfs,initramdisk is re0uired to boot a linu system installed on a Hoical-

?olume: 

Bou 'ont have any pro$(em to $oot i on(y your data are on =ogica(-o(umes 6 you insta(( the

root i(esystem o your (inu7 system on a =ogica(-o(ume, an initrams;initramdisk 'ith the (vmtoo(s is reuired to $oot Fortunate(y a(( the mainstream =inu7 distri$ution insta(( such an

initramdisk any'ay +ut there are (inu7 users 'ho 'ant to compi(e support or a(( the critica(

things in the kerne( image 9disk drivers, i(esystem drivers so that no initramdisk is necessary to $oot 6n that case the (inu7 kerne( 'ont ind the root i(esystem $ecause the support or =. is

imp(emented in userspace and not in the kerne( 3hats 'hy the initrams is reuired to mount

=. $ased root i(esystems

L8

Page 99: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 99/174

• *rub3 cant boot t"e kernel if its stored on an H?# volume: 

Bour kerne( image and initrams;initramdisk may either $e on a speciic ;$oot partition or it may Dust $e in the ;$oot directory in your root i(esystem 'here (inu7 is insta((ed #ny'ay, at the

 $eginning o the $oot process the $oot manager 94ru$ in genera( has to read the kerne( image

9oten ca((ed vm(inuH and the initrams;initramdisk i there is one 3he current sta$(e version o4ru$ 94ru$-KLM does not kno' ho' to read these i(es rom =. vo(umes So the partition

'here these i(es are stored must $e on a standard partition o your disk 9idea((y a ;$oot partition

Sysresccd-H?#-$1-.ow-t"e-loical-volume-

manaer-works

From SystemRescueCd

Jump to: navigation, search

Contents

[hide

• " #$out

• % =. 6mp(ementation

• * &evice-.apper

• 0 =. uti(ities

• 1 #$out =. metadata

@bout

6n this tutoria(, 'e 'i(( e7p(ain more a$out ho' =. 'orks 6ts uite important to understand

ho' it 'orks to kno' ho' to use it the right 'ay )e 'i(( a(so ocus on the root i(esystem, 'hichis 'here the main (inu7 programs are insta((ed, so that you kno' 'hether or not its appropriate or

you 6ts recommended that you read the previous chapters a$out =. $eore you read that page

H?# %mplementation

6ts uite important to understand that H?# is implemented in userspace and not in kerne( space

6t means that t"e kernel does not know anyt"in about H?# , and the imp(ementation is Dust in

the =. $inaries 'hich comes 'ith the =.% package #s a conseuence you 'ont ind any

=. option i you try to recompi(e your =inu7 kerne( 3he other very important conseuence isthat t"e kernel wont be able to mount t"e root filesystem directly at $oot time i its an =.

(ogica( vo(ume 6t reuires the (vm $inary, and then an initramdisk ; initrams is used to $oot rom

=.

LL

Page 100: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 100/174

Device-#apper

=. is $ased on the Device-#apper 'hich is imp(emented in kerne( space 3he device mapper is

a $(ock driver that esta$(ish a mapping $et'een (ogica( $(ocks and physica( $(ocks # (ogica( $(ock

device such as an =. =ogica(-o(ume is a vo(ume as the end user can see it 3he physica( $(ockdevice is something (ike a partition o your hard-disk or your entire hard-disk 3he &evice-.apper

 provides a (ot o (e7i$i(ity 'ith $(ock devices For instance, 'hen you read the irst $(ock o a(ogica( vo(ume, the physica( $(ock may $e (ocated in the midd(e o your disk 6 you create t'o(ogica( vo(umes, and then gro' the irst vo(ume ater the second has $een created, it 'i(( use disk

 $(ocks 'hich dont o((o' the $(ocks o the initia( vo(ume, $ecause the &evice-.apper te((s the

(ogica( vo(ume 'here to ind the ne' disk $(ocks o the vo(ume 3he &evice-.apper is not on(y

used $y =. 6ts a(so used $y programs such as dmraid 'hich a((o's to use R#6& adapters $und(ed 'ith mother$oards 6ts a(so used or encryption at the $(ock (eve( or an entire i(esystem,

'ith too(s such as 3rueCrypt

H?# utilities

)hen =. is started at $oot time, it irst reads its meta-data in the /hysica(-o(umes to kno'

ho' its o'n data are organiHed 3hen it maps the disk $(ocks using the &evice-.apper 3his 'ay

the &evice-.apper kno' 'here to ind the physica( $(ock 'hen the user 'ants to read a $(ock in a

=ogica(-o(ume #ter the mapping has $een esta$(ished, the =. program is not active anymore, and on(y the &evice-.apper driver is doing a(( the trans(ations each time a $(ock is

accessed 3hats 'hy there is no process running (vm 'hen you 'ork on =. disks #s a

conseuence, =. cannot $e used i the &evice-.apper is not compi(ed in your kerne(

@bout H?# metadata

=. has its o'n 'ay to organiHe the data on your disk 5$vious(y it needs some space to store

inormation a$out the mapping so that is kno' 'here the $(ocks can $e ound on the disk 'hen it $oots the ne7t time #(( these interna(s data used $y =. are its metadata 3hey are stored on disk

sectors that you cannot see direct(y For instance, each =. /hysica( o(ume has metadata $(ocks

that are used to store inormation re(ated to ho' the o(ume-4roups are stored on these /hysica(-o(umes #nd each o(ume-4roup contains metadata $(ocks a$out the =ogica(-o(umes 'hich

are part o a vo(ume-4roup 6n other 'ords, =. is not using any i(e to store its o'n interna(

structures, so the disk 'i(( sti(( $e reada$(e $y =. i you decide to erase the root i(esystem

'here the deau(t =inu7 system is insta((ed

Sysresccd-H?#-$1-!ootin-linu-from-

H?#-volumes

From SystemRescueCd

"KK

Page 101: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 101/174

Jump to: navigation, search

Contents

[hide

• " #$out

• % +ooting rom an =. Root i(esystem

• * &istri$utions and roots on =.• 0 E7tracting an initrams

o 0" a$out initramdisks

o 0% a$out initramdisks

@bout

6n this tutoria(, 'e 'i(( e7p(ain the (inu7 $oot process in genera(, and ho' it 'orks 'hen =inu7 is

insta((ed on an =. vo(ume 6ts recommended to read the previous chapter a$out =. i you are

not a(ready ami(iar 'ith =. 3his page 'i(( a(so give you a good understanding o the =inu7 $oot process in genera( even i you dont use =., so its 'orth reading 6ts recommended that

you read the previous chapters a$out =. $eore you read that page

!ootin from an H?# Root filesystem

.any (inu7 distri$ution such as Redhat;Fedora a((o' you to insta(( the root i(esystem on an =.=ogica( o(ume 3his 'ay you get the (e7i$i(ity o =. or this i(esystem and not Dust or the

data 3he do'n side is that the $oot procedure is a $it more comp(e7, and you need to understand

ho' its $oots so that you are a$(e to i7 it in case o pro$(ems

+ooting using a root i(esystem (ocated on an =. =ogica( o(ume is more comp(icated $ecausethe kerne( does not kno' anything a$out =. So it needs the =. $inary to mount the root

i(esystem +ut the =. $inary is insta((ed on the root i(esystem that 'e 'ant to mount 3he

so(ution to this egg and chicken pro$(em is to $oot 'ith an initramdisk;initrams 3his is acompressed archive that contains a(( the kerne( modu(es and programs that are reuired to mount

the root i(esystem at $oot time 6n genera(, its (ocated in /boot, and its ca((ed initrd-x.y.z."z

3he other important i(e is the (inu7 kerne( image 'hich is ca((ed vmlinuz-x.y.z

ere are the important steps invo(ved in $ooting rom =.:

" 3he +65S e7ecutes the $oot (oader 9gru$;(i(o 'hich is insta((ed at the $eginning o the

hard disk% 3he $oot (oader has its o'n code or reading partition and i(esystem So it kno's ho' to

read i(es rom the ;$oot partition 'hich contains the (inu7 kerne( image 9vm(inuH-7yH

and the initrams 9initrd-7yHgH 6t irst (oads these t'o i(es into memory 3hen it

e7ecutes the kerne( image and it te((s the kerne( 'here the initrams is (ocated into memory3he $oot command (ine is a(so passed to the kerne( 3his command (ine contains the

important parameters or the kerne( such as root=/dev/vol"roup/lvroot

* 3he (inu7 kerne( starts and e7ecutes its initia(iHation code 3hen it reads the initrams romthe memory 3he contents is uncompressed into a ne' (ocation in the memory

"K"

Page 102: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 102/174

0 3he contents o the initrams is no' avai(a$(e 3he program;script ca((ed init is no'e7ecuted 3his script 'hich is speciic to each (inu7 distri$ution is responsi$(e or inding

the root i(esystem

1 6 the =. /hysica( o(umes are stored on the top o a R#6& disk, the init program 'i((irst e7ecute dmraid;mdadm to make these raid disk avai(a$(e

2 3hen the init script 'i(( runs programs such as pvscan;vgscan;(vscan to detect the =.

vo(umes (ocated on the disksM 3he =. vo(umes are not usa$(e yet 3hey have to $e activated irst 3his is done $y

v"c3an"e --available y or v"c3an"e -ay

8 3he init script reads the virtua( i(e ca((ed /proc/cmdline to see 'hat is the name o the

root i(esystem speciied on the $oot command (ine

L 3he root i(esystem is mounted on a temporary directory such as /root#s and other things

such as /root#s/proc and /root#s/dev many a(so $e mounted

"K 3he initscript e7ecutes a chroot to /root#s 6t means that this directory $ecomes the ne'

root or the processes 'hich 'i(( $e e7ecuted )hen a process reads /bin/somet3in" it

'i(( read /root#s/bin/somet3in" in rea(ity

"" 3he secondary init program, the one 'hich is stored on the root i(esystem is no' e7ecuted

and it inishes the initia(iHation 'ith an access to the rea( root i(esystem

Distributions and rootfs on H?#

• #(( the mainstream =inu7 distri$ution no' support =.% +ut the insta((ation program

may not a((o' you to insta(( the =inu7 roots on an =. =ogica( o(ume

o Red"at B Fedora B Centos, anaconda 9the insta((ation program insta((s the root

i(esystem on =. $y deau(t, $ut you can change it

o *entoo: since the deau(t insta((ation method is to insta(( it $y hand, you can

direct(y insta(( 4entoo on =. i you kno' 'hat you are doing

o Ebuntu: as o version KLK0, the insta((ation program does not support =., $ut

you can pro$a$(y migrate the root i(esystem ater insta((ation

3here are good reasons or using =. or the root i(esystem:

• 3he root i(esystem 'i(( $e more (e7i$(e: it 'i(( $e easier to resiHe it i its on an =.

=ogica( o(ume

• Bou can make snapshots o the root i(esystem 'hich is very useu( i you 'ant to make

consistent $ackups o it

Bou may not 'ant your root i(esystem to $e on an =. =ogica( o(ume i you dont 'ant to $oot

'ith a ramdisk 6 you compi(e your o'n kerne( 'ith a(( the important disk and i(esystem drivers

 $ui(t in the (inu7 image, it 'i(( $e possi$(e to $oot 'ith no initrams as (ong as (inu7 is insta((ed ona standard disk partition that the kerne( 'i(( $e a$(e to mount

$tractin an initramfs

#n initramdisk;initrams contains the i(es necessary to get an access to the root i(esystem at $oot

time 6ts possi$(e to read it contents i you 'ant to have a (ook at its contents 3here are t'o sortso such i(es: the o(d ones are ca((ed initramdisk and the ne' ones are ca((ed initrams

"K%

Page 103: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 103/174

about initramdisks

6nitramdisks e7isted irst 6ts a compressed image o a i(esystem 6n genera( the i(esystem is an

e7t%s $ut it can a(so $e a mini7s

.ake an uncompressed copy o the initrdcat /boot/initrd-x.y.z."z A "zip -d @ /var/tmp/initrd-x.y.z

.ount the copy o the origina( initrdmkdir /var/tmp/mntramdisk R mount -o ro1loop /var/tmp/initrd-x.y.z/var/tmp/mntramdisk

Copy the i(es to a ne' directorycp -a /var/tmp/mntramdisk /var/tmp/ramdisk#iles

Anmount the imagecd / R umount /var/tmp/mntramdisk

about initramdisks

 Ne' =inu7-%2 $ased distri$utions provide initrams instead 3hey are compressed cpio archives

ere is ho' to e7tract it

Create a temporary directorymkdir /var/tmp/ramdisk#iles

E7tract the compressed initramscd /var/tmp/ramdisk#iles ^^ zcat /boot/initrd-x.y.z."z A cpio -id

ere is ho' to recreate an initrams

3he o((o'ing command 'i(( create a ne' initrams using i(es (ocated in

/var/tmp/ramdisk#iles-new:

#ind /var/tmp/ramdisk#iles-new A cpio -O newc -o A "zip -, @ boot/initrd-x.y.z-

new."z

Sysresccd-H?#-$1-#ovin-t"e-linu-rootfs-

to-an-H?#-volume

From SystemRescueCd

Jump to: navigation, search

Contents

[hide• " #$out

• % Checking the initrams

• * Copying the root i(esystem to a (ogica( vo(ume

• 0 Apdating the $oot (oader

"K*

Page 104: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 104/174

@bout

.any (inu7 users insta(( the root i(esystem on a standard partition 6 its your case, it may $e

 possi$(e to copy the root i(esystem on an =. =ogica(-o(ume $y hand, and to modiy the $oot

(oader coniguration i(e 9eg: ;$oot;gru$con or ;$oot;gru$(st or 4ru$ so that it no' $oots romthe =. vo(ume 3his procedure has $een tested 'ith &e$ian =enny, and its (ike(y to 'ork or

other distri$utions

Bou 'i(( need enough space on your disk to have $oth the o(d root partition and the ne' =.

vo(ume at the same time 6 you dont have enough space, its a(so possi$(e to $ackup and restoreyour root i(esystem instead o doing a copy 6t shou(d 'ork i you kno' 'hat you are doing 3his

is a dangerous operation, so p(ease check you have recent $ackup irst and dont do that i you

dont u((y understand this procedure 6ts recommended that you read the  previous chapters a$out=. $eore you read that page

C"eckin t"e initramfs

+eore you migrate your root i(esystem to an =. vo(ume, you shou(d check that the initrams

 provided $y your distri$ution supports =. 5n some distri$utions, the initrams is conigurationspeciic For instance, on Fedora;Redhat, the initrams is created automatica((y $y a program ca((ed

mkinitrd each time you insta(( or update the kerne( image 3he pro$(em is that this program on(y

inc(ude the disk drivers or the hard'are on 'hich it runs, and it on(y inc(udes the =. programsi you are using it 6n that case you 'i(( have pro$(ems i you try to reuse this (inu7 kerne( image

and this initrams on an hard'are 'hich needs dierent disk drivers and i you use =. 3he

so(ution is to use recreate the initrams 'ith the =. support $eore you re$oot on the ne' rooti(esystem

)ith 5ther distri$utions such as &e$ian-=enny the initrams inc(udes a(( the disk drivers and it

a('ays inc(ude the =. programs so it shou(d 'ork 6n that case you can Dust reuse the (inu7

-kerne(-image and the initrams as they have a(ready $een insta((ed in ;$oot

#s o version KL"K the deau(t insta((er in A$untu does not support =. Bou have to insta((A$untu on a norma( partition irst, run commands on this system either $y $ooting on it on through

chroot, insta(( the (vm% too(s, update the initras and then copy the i(esystem to an =. vo(ume:

" 6nsta(( A$untu on a norma( partition 9eg: /dev/sda

% +oot on the ne' insta((ed system or chroot to it rom SystemRescueCd* 6nsta(( the (vm% too(s: apt-"et install lvm2 

0 Regenerate the initrams: update-initram#s -u -k all 

3hen the initrams has =. support and it 'i(( 'ork 'hen you try to use it to $oot A$untu roman =. =ogica(-o(ume

Copyin t"e root filesystem to a loical volume

" +oot on a recent SystemRescueCd

Bou can $oot either rom the cdrom edition or the us$ or rom the net'ork

"K0

Page 105: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 105/174

% Create an =. /hyisca( o(ume i necessary

6 you have no =. /hysica(-o(ume, you have to ind a disk or a partition or it 6t 'i(( $e $ig

enough to store the ne' root i(esystem

* Create an =. o(ume-4roup i necessary

Create an =. o(ume-4roup i you dont have is a(ready 6n this e7amp(e it 'i(( $e ca((ed/dev/v"main 

0 Create an =. =ogica(-o(ume

Create an =. =ogica(-o(ume 'hich is $ig enough or the root i(esystem =ets say its/dev/mapper/v"main-debian 

1 .ake a ne' i(esystem on the ne' =ogica(-o(ume

Bou can change the type o the i(esystem i you are sure that the kerne( 'i(( support it 6 you are

not sure 'hich i(esystems are supported $y your distri$ution, you shou(d keep the same one, itse7t* in genera(:

mke2#s -I -! debian /dev/mapper/v"main-debian

2 .ount $oth the o(d and the ne' i(esystemsmkdir -p /oldroot#s /newroot#smount -r /dev/sda2 /oldroot#smount /dev/mapper/v"main-debian /newroot#s

M Copy the contents o the root i(esystem to the ne' vo(ume

rsync 'i(( $e used to copy a(( the data $ecause it kno' ho' to preserve a(( the attri$utes, inc(uding

the e7tended-attri$utes 'hich are reuired or se(inu7 to 'ork 'hen its ena$(ed Bou can a(so use

another too( such as tar i you kno' 'hat you are doing Bou can a(so do a copy at the $(ock (eve(i the ne' vo(ume is at (east as $ig as the o(d one $ut you may have to run resiHes i its $igger

ere is ho' to do the copy using rsync:

rsync -axO$X /oldroot#s/ /newroot#s/

8 Apdate the entry or the root i(esystem in the ne' sta$

Bou have to edit /newroot#s/etc/#stab and change the entry re(ated to the root i(esystem so

that the name o the device and the i(esystem are correct

L Anmount the i(esystems

cd / R umount /oldroot#s /newroot#s

Epdatin t"e boot loader

 No' you have to mount your $oot partition and edit the $oot (oader coniguration so that it kno'

'here to $oot rom 6ts recommended to preserve the e7isting $oot entry, Dust in case there is a pro$(em 'ith the ne' root i(esystem ere is an e7amp(e o a gru$ coniguration i(e or &e$ian

'ith these t'o entries 3he important thing is the the root=xxx $oot parameter

"K1

Page 106: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 106/174

de#ault 0timeout 0

title )ebian-!inux-2.6.26-2-amd6 Gnew-lvm-root#sH  root E3d010F  kernel /vmlinuz-2.6.26-2-amd6 root=/dev/mapper/v"main-debian ro  initrd /initrd.im"-2.6.26-2-amd6

title )ebian-!inux-2.6.26-2-amd6 Gold-std-root#sH  root E3d010F  kernel /vmlinuz-2.6.26-2-amd6 root=/dev/sda2 ro  initrd /initrd.im"-2.6.26-2-amd6

 No' you shou(d $e a$(e to re$oot on the ne' root i(esystem

Sysresccd-H?#-$1-#akin-consistent-

backups-wit"-H?#

From SystemRescueCd

Jump to: navigation, search

Contents

[hide

• " #$out

• % +ackups and consistency

• * Creation o an =. snapshot

• 0 +ackup $ased on the snapshot

• 1 +ackup script using sarchiver

@bout

#(( the important stu you have shou(d $e $acked up 5n production servers, you dont 'ant tohave do'n time or the $ackups, $ut you 'ant the $ackups to $e consistent any'ay =. is a very

interesting storage system since it provides disk snaps"ots 'hich are reuired to make consistent

data backup 3hey can $e done 'hen the system is running 'ith no impact on your production

environment 6t can $e used or $oth desktops and servers running =inu7 as (ong as the i(esystem

that you 'ant to $ackup is stored on a =ogica(-o(ume No particu(ar $ackup sot'are is reuired

to make such $ackups Bou can Dust use the standard commands such as tar that comes or ree'ith =inu7 6ts recommended that you read the previous chapters a$out =. $eore you read that

 page

!ackups and consistency

6 your operating system is running, i(es can $e 'ritten at any time +ecause the $ackup can takesome time, important i(es are reerences to other i(es may have changed $et'een the $eginning

and the end o the $ackup =ets consider your system is hosting a 'e$site using #pache and

"K2

Page 107: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 107/174

.ys( /eop(e 'ho visit your 'e$site can up(oad images in their proi(e )hen they do that the i(eis stored in ;''';up(oad and a ne' entry is added in a mys( ta$(e that reers to that i(e on the

disk

ere is the situation that 'e 'ant to avoid:

" 3he $ackup 'hich is not $ased on =. snapshots starts% 3he $ackup program does a $ackup o the up(oad directory

* # visitor up(oads an image 3he i(e is created on the disk and a reerence to that is added

in the data$ase0 3he $ackup program does a $ackup o the data$ase i(es

1 3he $ackup is no' inished

6n this e7amp(e 'e can see that the $ackup is inconsistent $ecause the data$ase i(es 'hich have

 $een $acked up contain a reerence to a i(e 'hich does not e7ist in the up(oad directory 'hen it'as $acked up, Dust $ecause the user up(oaded that i(e 'hen the $ackup 'as in the midd(e o the

 process 6 you restore your system using this $ackup, the data$ase 'i(( reer to a i(e 'hich is

missing 3he =. snapshots are a good so(ution to that sort o pro$(ems

Creation of an H?# snaps"ot

#n =. snapshot is a roHen vie' o a =. =ogica(-o(ume )hen you make modiication on

the i(es o the origina( vo(ume the snapshot is not modiied So you end up 'ith t'o vo(umes: the

norma( =ogica(-o(ume o your system and the =ogica(-o(ume o the snapshot =ets consideryou run that command at %am 3hen each time you read data rom the snapshot you have created,

you 'i(( see the data as they 'ere at %am

Bou have to run a command to take a snapshot o an =. =ogica(-o(ume 3his command is

lvcreate 'hich is a(so the command you use to create a norma( =. =ogica(-o(ume ere isthe genera( synta7:

• lvcreate -HJsieK -s -n JsnapnameK JorilvK 

• orilv: name o the norma( =ogica(-o(ume that you 'ant to $ackup

• snapname: name o the snapshot that 'i(( $e created

• sie: space reserved or the snapshot in your o(ume-4roup

=ets take an e7amp(e: Bou are running =inu7 Redhat Enterprise RE=1 6ts insta((ed on

/dev/Volroup00/!o"Vol?oot 3he siHe o this =ogica(-o(ume is "24+ and you 'ant to make

a $ackup o it using =. snapshots Bou have 14+ avai(a$(e in your o(ume-4roup 'hich is

ca((ed Volroup00 ere is the appropriate command to do that:

• creation of t"e H?# snaps"ot: lvcreate -!+ -s -n !o"Volnap/dev/Volroup00/!o"Vol?oot 

• new situation: no' you can see t'o =ogica(-o(umes o "24+ each:

/dev/Volroup00/!o"Vol?oot and /dev/Volroup00/!o"Volnap 

• destruction of t"e H?# snaps"ot: lvremove /dev/Volroup00/!o"Volnap 

Bou may $e surprised to see that the siHe o the snapshot is "24+ since 'e passed a siHe o 14+ to

lvcreate 3he reason is that the space reserved or the snapshot 'hich is 14+ is on(y used or

"KM

Page 108: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 108/174

data that have changed ater the snapshot has $een taken =. does not keep t'o copies o thedata 'hen you do an =. snapshot 3hats 'hy the creation o the =. snapshot is very uick:

its a(most immediate $ecause it does not make any copy at that time

)hat rea((y happens is H?# makes a copy of t"e oriinal data eac" time a modification is

re0uested on the =ogica(-o(ume )hen a $(ock o the =ogica(-o(ume is modiied, =. irst

makes a copy o the origina( version 'hich is stored in the snapshot, and then the modiication is

'ritten on the norma( =ogica(-o(ume So the norma( =ogica(-o(ume a('ays contains the (atest

version o the data and the snapshot on(y contains a copy o the $(ocks 'hich have $een modiiedFor each $(ock that has not $een modiied since the snapshot creation, then the snapshot Dust

contains a reerence to the $(ock on the norma( =ogica(-o(ume #s a conseuence, having a

snapshot make your =ogica(-o(ume s(o'er $ecause t'o $(ocks have to $e 'ritten each time a $(ock is modiied on the vo(ume

6ts important to remem$er that H?# is workin at t"e block level #s an hard disk, =. Dust

considers the data as a (ist o i7ed siHe $(ocks 6t does not kno' anything a$out i(es and

directories 3his is the Do$ o the i(esystem 'hich is using that =. =ogica(-o(ume #(so thereis a pro$(em i you 'ant to make too many modiications to the vo(ume 6 you created a snapshot

o 14+, the snapshot 'ont $e a$(e to store the data i you make modiy more than 14+ o data on

your =ogica(-o(ume )hen that happens the snapshot is automatica((y destroyed, and you (oosethe origina( version o your vo(ume 3he (atest version 'ith modiication is a('ays preserved Bou

can create snapshots 'hich are as $ig as the origina( =ogica(-o(ume i you 'ant to $e sure not to

(oose the snapshot in case o modiications

!ackup based on t"e snaps"ot

3he snapshot that has $een created is Dust (ike a standard =. =ogica(-o(ume, so you can read it

 Dust as you 'ou(d read any other =ogica(-o(ume o your system 6nterna((y =. on(y stores the

 $(ocks 'hich have $een modiied, $ut the user can read a(( the $(ocks o the vo(ume Reading $(ocks o an =. snapshot is Dust the same as reading the $(ocks o the origina( vo(ume at the

time the snapshot has $een created #s a conseuence the snapshot shou(d contain a va(id

i(esystem that can $e mounted read-on(y

3hen you have t'o options to make a $ackup o an =. snapshot:

• work at t"e block level: you can consider the snapshot at the $(ock (eve( and make a

 $ackup 'ith too(s such as dd or partima"e 

• work at t"e file level: you can mount the snapshot on an a(ternative mount point and use

rsync or archivers such as tar, dar, or #sarc3iver 

3he second option is recommended $ecause it 'i(( $e more (e7i$(e, $ut you can Dust 'ork 'ith a((too(s that can do disk or i(e $ackups

!ackup script usin fsarc"iver

ere is an e7amp(e o simp(e she(( script that perorms a $ackup using sarchiver  3his too( has

 $een used $ecause it provides high compression, good perormances, and re(ia$i(ity $ecause o the

"K8

Page 109: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 109/174

Page 110: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 110/174

Page 111: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 111/174

you have (ess than 0 primary partitions 3he pro$(em o e7tended partitions is that its morecomp(icated than primary partitions, and its a $it ragi(e

6 your .+R is over'ritten then you (oose your partitions 6t 'ont $e possi$(e to $oot and you

cant ind your data 3hats 'hy you have to $e very careu( 'hen you make modiications in your.+R Fortunate(y, too(s (ike testdisk  can scan the disk and try to recreate the origina( partitions i

you (oose your .+R

$ac" partition "as an identifier w"ic" is written in t"e partition table 3his identiier is used

to identiy 'hat sort o i(esystem the partition contains Sometimes it may not $e consistent 'iththe data that the partition actua((y contains: a =inu7 partition may have the )indo's identiier

3hats 'hy its important to check 'hat the i(esystem o that partition is i you are not sure

Windows can only be installed on a primary partition Fortunate(y it can use (ogica( drives or

data =inu7 can $e insta((ed on any type o partition, inc(uding (ogica( drives

3he standard /C;+65S partition ta$(es on(y a((o' addresses up to % 3era-+ytes 6t can $e used on(arger disks, $ut the e7tra space 'i(( $e unaccessi$(e 3o address more than % 3era-+ytes use 4/3,

 $ut you 'ont $e a$(e to $oot )indo's rom that disk

5artitions and filesystems

6ts very important to differentiate two t"ins: t"e partition and t"e filesystem # partition is agroup o contiguous sectors o your disk 3he i(esystem is the system that organiHe the storage o

data 'ithin a partition: its responsi$(e or managing i(es, o(ders, permissions, and many other

things

# partition is deined $y the irst sector on the disk, (ast sector on the disk, identiied and

attri$utes ere is an e7amp(e o partition ta$(e on a disk:

)evice %oot tart &nd %locks (d ystem/dev/sda 2 *0 +8,60 8* !inux/dev/sda2 8,* 00 ,00+2] 8* !inux/dev/sda* 002 ,*0 2,+2] 8* !inux

3he most popu(ar i(esystems are F#3 and N3FS or )indo's and e7t*, e7t0, reisers or =inu7

$ac" operatin system "as its own native filesystems For instance )indo's can on(y $e

insta((ed using F#3 or N3FS =inu7 has a $igger choice o native i(esystems 9e7t*, e7t0, reisers,

7s, Ds, $trs, , and its a(so a$(e to read and 'rite )indo's i(esystems So you can read and

'rite data on your )indo's partitions rom =inu7

)hen you create a partition 'ith (o' (eve( too(s such as disk, it may Dust create an empty partition

'ith no i(esystem in it 3his partition 'ont $e reada$(e unti( a va(id i(esystem has $een created

on it +ut in genera(, advanced partitioning too(s create $oth the partition and a va(id i(esystem in

the same time

6ts a(so very important to dierentiate the partition and the i(esystem or resiHing: in genera( a

i(esystem is using "KK] o the space avai(a$(e in a partition 6t can never $e $igger than the

 partition, $ut it can $e sma((er )hen you 'ant to gro' a partition, you irst have to gro' the

"""

Page 112: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 112/174

 partition itse(, and then you can gro' the i(esystem 'hich is inside )hen you shrink a partition,you have to shrink the i(esystem irst

Bou shou(d no' understand the dierence $et'een t"ree levels of free space:

• )ithin a hard-disk, there can $e space 'hich is not a((ocated to a partition

• )ithin a partition, there may $e space 'hich is not a((ocated to the i(esystem 9its very

rare• )ithin a i(esystem, some space may not $e a((ocated to any i(e, $ut its a((ocated $y the

i(esystem any'ay

.ow to create partitions

6 your disk is empty there are many 'ays to create ne' partitions 3he )indo's and =inu7insta((ation programs a((o' you to create and destroy partitions 6n other 'ords, i you 'ant to

insta(( and 5perating System on a $rand ne' disk, you dont need any additiona( partitioning too(:

the insta((ation program can do that, $ut you may have to se(ect advanced options

Bou may a(so 'ant to modify your disk partitions w"en it already contains data 6 you haveno particu(ar partitioning program you can a('ays destroy a(( your partitions and recreate ne'

ones, $ut you 'i(( (oose a(( your data Bou can do that 'ith a(( the $asic partitioning too(s 9&isk-

.anager in )indo's, disk on =inu7,

Fortunate(y there are advanced partitionin prorams that a((o' you to make modiications inyour partitioning 'ith no data (oss $y using too(s that understand the i(esystem used on a partition

3hus its possi$(e to move and resiHe e7isting partitions Bou can a(so change their (a$e( or their

settings 9visi$(e, hidden, 3he commercia( products are /artition .agic and #cronis &isk&irector have good support or )indo's partitions 9F#3 and N3FS 3hey a(so provide support

or advanced operations such as merging t'o partitions or sp(itting a partition +ut they dont provide a good ; up to date support or =inu7 partitions in genera(

SystemRescueCd comes wit" *5arted 6ts a graphica( too( that supports a(( the )indo's and=inu7 i(esystems 6t a(so 'orks on 4/3 disks 6t a((o's you to move and to resiHe partition

Anortunate(y it does not support very advanced eatures such as merging and sp(itting

Sysresccd-5artitionin-$1-5artitions-

attributes

From SystemRescueCd

Jump to: navigation, search

Contents

[hide

• " /artition identiiers

• % E7amp(e o a typica( partition ta$(e

""%

Page 113: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 113/174

• * /artition (ags

o *" 3he $oota$(e;active (ag

o *% 3he hidden (ag

• 0 &isks and partition names

5artition identifiers

Each partition o your disk has an identiier 6ts 'ritten in the partition ta$(e 'hich is in the .+R

i its a disk $ased on the standard msdos partition ta$(e 3his is Dust a num$er 'hich says 'hich

sort o partition it is Bou can get the (ist o a(( the possi$(e partition identiiers that can $e used in

an msdos partition ta$(e $y typing <=< in disk under (inu7:

9ommand Em #or 3elpF !

 0 &mpty 2 &9 ): 8 4inix / old !in b# olaris  <$;2 *, 5lan , 82 !inux swap / o c )?):/sec E<$;- 2 X&(X root *c 5artition4a"ic 8* !inux c )?):/sec E<$;-

 * X&(X usr 0 Venix 80286 8 :/2 3idden 9 c6 )?):/sec E<$;-  <$;6 S*24 559 5?e5 %oot 8+ !inux extended c yrinx + &xtended 2 < 86 ;< volume set da on-< data 6 <$;6 d X.x 8 ;< volume set db 95/4 / 9;: / .  O5</;< e X.x 2nd part 88 !inux plaintext de )ell 'tility 8 $(X # X.x *rd part 8e !inux !V4 d# %oot(t , $(X bootable +0 :n;rack )4 ,* $moeba e ): access a :/2 %oot 4ana" + :n;rack )46 $ux , $moeba %%; e* ): ?/: b 7,+ <$;*2 +2 95/4 ,# %)/: e peedtor c 7,+ <$;*2 E!%$F +* :n;rack )46 $ux a0 (%4 ;3inkpad 3i eb %e: #s e 7,+ <$;6 E!%$F + :n;rack)46 a+ <ree%) ee 5; # 7,+ &xtNd E!%$F ++ &W-)rive a6 :pen%) e# &<( E<$;-2/6/0 :5' +6 olden %ow a eX;;&5 #0 !inux/5$-?(9 b

Oidden <$;2 +c 5riam &disk a8 )arwin '< # peedtor2 9ompaC dia"nost 6 peedtor a, et%) # peedtor Oidden <$;6 S* 6* ' O'?) or ys ab )arwin boot #2 ): secondary6 Oidden <$;6 6 ovell etware a# O< / O<] #b V4ware V4< Oidden O5</;< 6+ ovell etware b %)( #s #c V4ware V4P9:?&8 $; martleep 0 )iskecure 4ult b8 %)( swap #d !inux raid autob Oidden 7,+ <$;* + 59/(X bb %oot 7izard 3id #e !$stepc Oidden 7,+ <$;* 80 :ld 4inix be olaris boot ## %%;e Oidden 7,+ <$;

)hen you (ook at this ta$(e, you can see that there are %12 possi$(e identiiers 6n genera(, they are'ritten in he7adecima( $ecause it a((o's to represent %12 dierent com$inations 'ith on(y t'o

characters 3he partition identiier is supposed to $e consistent 'ith the contents o the partition,

 $ut its not a('ays correct 6ts perect(y possi$(e to insta(( =inu7 on a partition having its identiierset to M 'hich is norma((y used or N3FS partitions 6ts more important to use the right identiier i

you 'ant to insta(( )indo's 6t may reuse to $oot i you use the 'rong identiier or the partition

#ny'ay it shou(d $e correct i you use a high-(eve( partitioning too( such as parted 3his identiieris a(so very important i its an e7tended partition 9types 4 and f  6 you 'ant to change the

identiier o a partition you have to use disk, and press <3< in the menu 6t corresponds to c3an"ea partitionNs system id 

.ere are t"e most important identifiers:

""*

Page 114: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 114/174

• : Norma( N3FS 9visi$(e )indo's partition

• 3: idden N3FS 9hidden )indo's partition

• G): =inu7 s'ap 9(inu7 partition or s'ap

• G(: =inu7 data 9(inu7 partition or data

• Ge: =inu7 =. 9(inu7 partition or =.

• 4: E7tended partition 9contains (ogica( partitions

• f : E7tended =+# partition 9contains (ogica( partitions

$ample of a typical partition table

ere is an e7amp(e o a disk 'here $oth =inu7 and )indo's are insta((ed ere is ho' is (ooks

(ike in #disk #or linux:

)evice %oot tart &nd %locks (d ystem/dev/sda *2 2+0000 8* !inux/dev/sda2 B *2 2, +0000 O5</;</dev/sda* 2+0 8* 28,*++ # 7,+ &xtNd E!%$F/dev/sda+ 2+0 *6 +*86 8* !inux

/dev/sda6 * 26 8,6,8] O5</;</dev/sda 26 8* 288 Oidden O5</;<

ere is ho' the same partition ta$(e is printed $y another too(: ' 5arted 

umber tart &nd ize ;ype <ilesystem <la"s  +2% 2+64% 2+64% primary ext* 2 2+64% 2084% ,24% primary nt#s boot * 2084% 604% *,24% extended lba + 2084% 2+,,4% ++4% lo"ical ext* 6 2+,,4% *+004% ,04% lo"ical nt#s  *+004% 604% 2,04% lo"ical nt#s 3idden

""0

Page 115: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 115/174

#nd no' the same in 4/arted:

5artition flas

Each partition may a(so have other attri$utes, a(so kno' as (ags:

• 5ne partition o the disk may $e marked as active;$oota$(e

• F#3;N3FS may $e marked as hidden or visi$(e

A"e bootable,active fla

3he irst (ag is ca((ed either bootable or active 5n(y one partition o the disk may have this

(ag 3his (ag is used to mark the partition that contains the operating system that shou(d $e

 $ooted 'hen the computer starts using that disk )hen the computer starts, the $oot code o the.+R is e7ecuted +y deau(t the .+R contains the conventiona( .+R code, 'hich is used to

automatica((y start the operating system 'hich is insta((ed on the partition marked as active 3his is

the typica( situation o a computer 'hen .icrosot 5perating-Systems are insta((ed 5ther $ootmanagers can $e insta((ed in the .+R $oot code, such as 4ru$ 'hich is used to start =inu7 or

)indo's 9or any other 5perating-System 3hese $oot managers tend to ignore the

bootable/active (ag since they have their o'n representation o the insta((ed systems Bou cana(so insta(( more than one version o )indo's on your disk i you have mu(tip(e primary

 partitions 3his bootable/active (ag can $e used to choose 'hich one you 'ant to $oot

A"e "idden fla

/artition may $e either visi$(e or hidden 6n rea(ity the 5perating-System can a('ays see the

 partition o the disk and it can decide to ignore the partitions 'hich are marked as hidden Bou canhide a partition i you dont 'ant this partition to $e visi$(e under )indo's 6t can $e used to hide

""1

Page 116: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 116/174

data, or to $e sure they 'ont $e accidenta((y removed Bou can c(ear this (ag at any time using a partitioning too( such as /arted or disk 6n rea(ity there is no such (ag in the partition ta$(e F#3

and N3FS partitions have mu(tip(e identiiers so there is one identiier or a visi$(e N3FS partition,

and another identiier is used or hidden N3FS partitions =inu7 partition dont have such anhidden identiier $ut thats not a rea( pro$(em since its possi$(e not to mount a partition i you

dont 'ant its contents to $e visi$(e

Disks and partition names

=inu7 and )indo's have dierent naming conventions or disk and partitions ere is ho' is adescription o "ow disks names are set under Hinu:

• SCS6 and S#3# disks are named /dev/sda 9irst disk, /dev/sdb 9second disk,

/dev/sdc,

• 6&E;/#3# disks names used to $e /dev/3da 9irst disk, /dev/3db 9second disk, $ut

can a(so $e ca((ed sda, sdb,

• R#6& arrays use other names such as /dev/cciss/c0d0p 9/ Smart#rray raid

contro((ers

)ith traditiona( msdos;$ios partition ta$(e numbers 3 to ' are reserved for primary partitions 

9an e7tended partition is a primary partition, and numbers from 4 are used for loical

partitions 3hus there can $e a /dev/sda+ 9irst (ogica( partition inside the e7tended partition

even i there is no partition ca((ed /dev/sda:

• /dev/sda is the irst primary partition o the disk ca((ed /dev/sda 

• /dev/sda2 is the second primary partition o the disk ca((ed /dev/sda 

• /dev/sda+ is the irst (ogica( partition o the disk ca((ed /dev/sda 

• /dev/sda6 is the second (ogica( partition o the disk ca((ed /dev/sda 

6 you are using the 4/3 disk (ayout then there is no need or e7tended partitions, $ecause there

can $e more than 0 primary partitions 3hen partitions are $ased on norma( num$ering starting at"

Bou can (ook at the i(e ca((ed /proc/partitions under =inu7 to see your disks and partitions:

D cat /proc/partitionsmaIor minor Kblocks name  8 0 62,+6 sda  8 2+0000 sda  8 2 +0000 sda2

  8 * sda*  8 + +*86 sda+  8 6 8,6,8 sda6  8 288 sda

6 its insta((ed you can a(so use sarchiver to sho' the (ist o partitions 'ith more detai(s:

D #sarc3iver probe simpleG=====)&V(9&=====H G==<(!&Y==H G=====!$%&!=====H G====(W&====H G4$H G4(HG/dev/sda H Gext* H Gboot H G 2. 4%H G 8H G HG/dev/sda2 H Gnt#s H Gwindows-xp H G .6 %H G 8H G 2H

""2

Page 117: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 117/174

G/dev/sda+ H Gext* H Glinux-data H G +2+.+* 4%H G 8H G +HG/dev/sda6 H Gnt#s H Gwindows-data H G 8+,.08 4%H G 8H G 6HG/dev/sda H Gnt#s H Gbackups H G 2. %H G 8H G H

Sysresccd-5artitionin-$1-Standard-partitionin-tools

From SystemRescueCd

Jump to: navigation, search

Contents

[hide

• " #$out

• % Fdisk and 4disk

• * /arted

• 0 4/arted

• 1 Fi(esystem too(s

@bout

SystemRescueCd comes 'ith many disk and partitioning too(s 3his page 'i(( give you a good

idea o 'hich one you shou(d use, and 'hat they can do 5 course, a(( these too(s are reesot'are or =inu7 and you dont have to pay to use it 6ts recommended to read the 6ntroduction to 

 partitioning and the page a$out /artitions attri$utes irst

Fdisk and *disk 

fdisk is a primitive disk partitionin tool Each operating system comes 'ith its o'n version o

disk, $ut they a(( provide the same sort o services disk a((o's you to create, edit and de(ete

 partitions 6n other 'ords its a too( to edit the partition ta$(es o your disk 6t can 'ork on $oth the primary partitions ta$(e 'hich is stored in the .+R and the (ogica( partitions 'hich are

imp(emented in the e7tended partitions

6t disp(ays the partitions in either disk sectors or disk cy(inders units, 'hich makes it uite diicu(t

to rea(iHe 'hat the rea( siHe o a partition siHe is in terms o 4iga-+ytes #(( you can do 'ith diskis to create and manipu(ate partition ta$(es 6t 'ont do anything 'ith the contents o the partition

6n other 'ords you 'i(( have to use another too( i you 'ant to create or modiy a i(esystem in a

 partition created using disk disk can $e used to create partitions $eore you insta(( an operatingsystem on it

""M

Page 118: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 118/174

Changes are not commited immediate(y 'ith disk #(( the changes are done in memory on(y unti(you decide to 'rite your modiications to the disk 6t a((o's you to try modiications and see ho'

it (ooks $eore you decide 'hether or not to keep it

disk is not the $est too( i you 'ant to create ne' partitions on your disk 6ts the appropriate too('hen you 'ant to make changes 'hich are not avai(a$(e or other partitions too(s 6ts very useu(

i you 'ant to change the identiier o partition 'ithout changing its i(esystem, $ecause the other

too(s dont give you access to that sort o advanced option in genera(

disk can a(so $e used to resie partitions 'hen /arted;4/arted are not a$(e to do that: they reuseto resiHe partitions 'hen they dont support their i(esystem 6n that case you 'i(( have to de(ete the

 partition and recreate it 'ith a dierent siHe in disk Bou 'ont (oose the contents $ecause disk

on(y modiies the partition ta$(e, not the partition contents 6ts uite dangerous any'ay so you

have to $e very careu( #nd you have to use the appropriate too( to resiHe the i(esystem manua((y

So disk is a uite primitive partitioning too( 'hich s"ould only be used for specific t"ins that

cannot $e done rom parted;gparted #nd it has to $e used 'ith care

gdisk is the euiva(ent o disk or 4/3 disks Bou shou(d use /arted or 4/arted or norma( tasks

on 4/3 disks since they support it gdisk is a good a(ternative or things that cannot $e done rom/arted and 4/arted

)evice %oot tart &nd %locks (d ystem/dev/sda *2 2+0000 8* !inux/dev/sda2 B *2 2, +0000 O5</;</dev/sda* 2+0 8* 28,*++ # 7,+ &xtNd E!%$F/dev/sda+ 2+0 *6 +*86 8* !inux/dev/sda6 * 26 8,6,8] O5</;</dev/sda 26 8* 288 Oidden O5</;<

5arted

/arted 94NA /artition Editor is the most popu(ar command (ine partitioning too( or (inu7 6t

supports a 'ide range o partition ta$(es: natura((y it 'orks on msdos;$ios partition ta$(es and on

4/3 partition ta$(es, $ut it a(so supports the partition ta$(es or sun, $sd, ai7, amiga,

5arted "as to be used wit" t"e command line 6ts not diicu(t once you are a $it ami(iar 'ith it

6t provides many options 'hich makes it easy to use For instance you can manipulate partition

sies in #ea-!ytes and *ia-!ytes as 'e(( as sectors #(( the changes take eect immediate(y

in /arted, so you have to $e careu(

5arted works on bot" t"e partition table and on filesystem levels at the same time 6n other

'ords it 'i(( $oth create an entry in the partition ta$(e and a i(esystem on the space a((ocated to it

'hen you decide to make a ne' partition 6t has $ui(t-in support or F#3 and EI3% i(esystems 6t

'i(( then $e a$(e to create and resiHe these i(esystems /arted has no such support or the otheri(esystems 9nts, e7t*, e7t0, reisers, 7s, $trs, , $ut they 'i(( $e detected any'ay #s a

conseuence, you 'i(( have to use the e7terna( i(esystems too(s once you have created an empty

 partition in /arted, or you can use 4/arted 'hich does that or you

""8

Page 119: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 119/174

So 5arted is t"e best partitionin tool in tet mode on =inu7 6ts shou(d $e the deau(t choice iyou dont 'ant to use a graphica( too( 6t can a(so $e scripted i you 'ant to automate operations

using scripts

umber tart &nd ize ;ype <ilesystem <la"s  +2% 2+64% 2+64% primary ext* 2 2+64% 2084% ,24% primary nt#s boot

 * 2084% 604% *,24% extended lba + 2084% 2+,,4% ++4% lo"ical ext* 6 2+,,4% *+004% ,04% lo"ical nt#s  *+004% 604% 2,04% lo"ical nt#s 3idden

*5arted

*5arted is t"e best rap"ical partitionin tool for Hinu 6ts $ased on /arteds (i$rary9(i$parted or partition ta$(e manipu(ations $ut its not Lust a front-end to 5arted $ecause it a(so

interacts 'ith i(esystem too(s to provide support for all t"e popular filesystems For instance, it

'i(( use programs rom ntsprogs to create and resiHe nts partitions #s a conseuence it reuires

these i(esystem too(s or these eatures to $e avai(a$(e Fortunate(y SystemRescueCd comes 'itha(( the i(esystem too(s that 4/arted reuires 3he modiications done in 4/arted are not

immediate(y app(ied on the disk, so you have to app(y your modiications or the changes to take

eect

4/arted is very user riend(y 3he graphica( representation o the disks gives a good idea o ho'the disk space is used $y partitions 6t may $e used $y users 'hich are not e7pert in disk

 partitioning 6t provides all t"e traditional tasks or most i(esystems:

• Creation o a ne' partition ta$(e on a disk device

• Creation o partitions and i(esystems

&e(etion o partitions rom the disk• .ove and resiHe partitions 'ith no data (osses

• Check the integrity o a i(esystem

• .odiications o partition attri$utes 9(a$e(, (ags,

""L

Page 120: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 120/174

Filesystem tools

Hinu supports a wide rane of filesystems: it provides a u(( read-'rite support or )indo's

i(esystems 9at and nts as 'e(( as its o'n native i(esystems 9e7t*, e7t0, reisers, reiser0, 7s, Ds,

 $trs 3hey can a(( $e used rom the command (ine, and t"ey provide advanced options thatcannot $e accessed rom generic partitioning programs $ac" filesystem comes wit" its own set

of prorams:

• mkfs: is the traditiona( program that creates a ne' i(esystem on a partition o your disk

• fsck : checks the integrity o a i(esystem and it repairs inconsistencies 9due to a $ug or a

crash

• resiefs: a((o's you to gro' a i(esystem 9you must gro' the partition irst or to shrink it

9shrink the partition ater'ards

• tunefs: is used to change various settings o a i(esystem 9its vo(ume name, advanced

options,

Each i(esystem has its o'n (imitation and may provide e7tra too(s ere are e7amp(es:

• e)fspros: (inu7 e7t%;e7t*;e7t0 i(esystems 9mke%s, e%sck, resiHe%s, tune%s

• reiserfspros: (inu7 reisers versions *1;*2 9mkreisers, reisersck, resiHeOreisers,

reiserstune

• fspros: (inu7 7s i(esystems 9mks7s, sck7s, 7sOgro's, 7sOadmin 9shrinking 7s

is not possi$(e

• ntfspros: 'indo's nts i(esystems 9mknts, ntsi7, ntsresiHe

.ost native linu filesystem can be rown online 9ie: 'hen the i(esystem is mounted 6ts very

useu( or production servers since it a((o's you to a((ocate more space to a i(esystem 'ith nodo'n time 3o do that you Dust have to run the norma( resize#s command that corresponds to a

 particu(ar i(esystem 3he command 'i(( e7it uick(y since the rea( resiHe is done $y the i(esystem

driver in the kerne(

"%K

Page 121: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 121/174

Page 122: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 122/174

3he conseuence is that the msdos partition ta$(e can on(y supports up to 0 primary partitions, and'e cannot address more than % 3+ o space 3he e7tended partition has $een created to

'orkaround the irst (imitation, and a((o's you to have many secondary partitions 9ca((ed <(ogica(

 partitions< inside one primary partition 9ca((ed the <e7tended partition< $ut this so(ution is notvery ro$ust and a $it artiicia( 3he second (imitation is more pro$(ematic $ecause very (arge disks

are no' very popu(ar: you can $y disk such as the itachi %3+ 9&SM%%K%K#=#**K or (ess

than %KK EAR 3his (imitation is a rea( pro$(em or proessiona(s, since many servers 'ith anhard'are R#6& contro((ers are using R#6& arrays 'hich are $igger than %3+

W"et"er or not to use *5A

3he 5; E'() 5artition ;ableF has $een introduced 'ith the E7tensi$(e Firm'are 6nterace

9EF6 standard, and its the ne' native (ayout on ne' architectures such as 6tanium 3he 4/3(ayout can a(so $e used on norma( /C 'ith a standard +65S 'ith =inu7 as (ong as you use recent

versions o the sot'are invo(ved Anortunate(y, )indo's or /C cannot $e insta((ed on a disk

using the 4/3 (ayout +ut the 20$it versions o )indo's can see partitions o a 4/3 disk, so youcan have a second disk $ased on 4/3 as (ong as )indo's is insta((ed on a disk 'ith a traditiona(

msdos partition ta$(e

6 you are on(y using =inu7 on your computer you can s'itch to 4/3 as (ong as the sot'are

invo(ved is recent enough to understand 4/3 Anortunate(y many =inu7 insta((ers dont (et youchoose 'hich partition (ayout 'hen the disk is ormatted For instance Redhat;Fedora Dust

automatica((y ormats disks 'ith the most appropriate system, depending on ho' $ig the disk is

3he so(ution is to use SystemRescueCd to make the partitions yourse( using too(s such as /arted,4/arted o 4&isk 3hen you can insta(( =inu7 and you 'i(( have to se(ect the option that a((o's

you to preserve the e7isting partitioning and customiHe the disk (ayout

3he 4/3 (ayout oers many advantages over msdos partition ta$(es:

• 6t can address very disks 'hich are $igger than %3+ 9%K08 4+

• Bou can have more than 0 primary partitions in a native 'ay

• 6ts more ro$ust: the partition ta$(e is redundant

• 6t supports a 'ide range o partition types since its encoded on "2 $ytes

#ny'ay, you shou(d keep a traditiona( msdos partition ta$(e i you 'ant to have )indo's

insta((ed $ecause )indo's or /C cannot $oot rom 4/3 disks 6 your disk is sma((er than %3+

and i you dont 'ant to have more than 0 partitions then you dont rea((y need to move to 4/33he =inu7 =ogica(-o(ume-.anager  is a good method to organiHe data on your disk and its on(y

using one partition to store the =. /hysica(-o(ume

System prorams involved in t"e disk layout

.u(tip(e system programs are invo(ved in the management o the disk (ayout, and a(( o them haveto support 4/3 i you 'ant to use that (ayout on your disk Fortunate(y a(( the recent =inu7

distri$ution are a$(e to cope 'ith it so you shou(d not have any pro$(em i your =inu7 distri$ution

has $een re(eased on %KKL or (ater

"%%

Page 123: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 123/174

• 3he irst program invo(ved in the $oot process is the $oot (oader 4ru$ is no' the deau(t

choice and a(( the important distri$utions are using it Bou can use 4ru$-KLM i it has $een

 patched or 4/3, and its the case in genera( 3he 4ru$% pre-re(eases 94ru$ versions "L2,

"LM, support 4/3 native(y

• 3he (inu7 kerne( has to $e compi(ed 'ith the support or 4/3 9option

C5NF64OEF6O/#R36365N set to yes, this is the case in genera(

• 3he disk partitioning too(s you may use have to support 4/3

6n SystemRescueCd-"KK and more recent, $oth the (inu7 kerne( and 4ru$ support 4/3 6ts

recommended to use at (east SystemRescueCd-"*7 any'ay $ecause it comes 'ith 4&isk 94/3disk or =inu7 'hich is an a(ternative to disk that supports 4/3 3hese t'o programs 9disk and

gdisk are sometimes necessary 'hen you 'ant to do something 'hich is not supported $y

/arted;4/arted For instance you need it to resiHe a partition 'hich has a i(esystem that/arted;4/arted cannot resiHe

6n genera(, the other uti(ities dont have to support 4/3 For instance, you can archive i(es o a

4/3 disk 'ith tar or sarchiver any'ay, $ecause these too(s are Dust a$(e to see 'hat the kerne( can

see

*5A and protective #!R 

An(ike the msdos partition (a$e(s the 4/3 disks dont use a .aster +oot Record 9.+R, $ecause

their partition ta$(e is comp(ete(y dierent #ny'ay you can have the euiva(ent o an .+R in the

irst sector o 4/3 disks

3his is used to prevent the disk too(s 'hich are not 4/3 a'are rom corrupting your 4/3 partitions 3his protective .+R contains a ake partition o type &<( 5; 'hich spans the entire

disk 'ith a ma7imum siHe o %3+ 3hus o(d disk too(s 'i(( see that the space is a(ready a((ocated

and they 'ont $e a$(e to make any modiications to the partitions managed $y the 4/3 (ayout3his protective .+R a(so a((o's standard +65S-$ased computer to $oot rom a 4/3 disk using a

 $oot (oader stored in the protective .+Rs code area, since the +65S on(y kno's the o(d system

 $ased on the .+R 3his ake .+R is the on(y 'ay or norma( /C 'ith a standard +65S to $oot a4/3 disk $ecause this is 'hat the +65S e7pects

ere is 'hat happens 'hen 'e use the standard disk 9'hich does not support 4/3 on a 4/3

disk:

root>debian /root D #disk -l /dev/sdb7$?( 5; E'() 5artition ;ableF detected on N/dev/sdbN;3e util #disk doesnNt support 5;. 'se ' 5arted.

)isk /dev/sdb 000.2 %1 0002088606 bytes2++ 3eads1 6* sectors/track1 260 cylinders'nits = cylinders o# 606+ B +2 = 822+280 bytes)isk identi#ier 0x2c2#e00b

  )evice %oot tart &nd %locks (d ystem/dev/sdb B 2602 ,662+8*] ee &<( 5;

!%OS !oot 5artition

"%*

Page 124: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 124/174

# $oot (oader such as 4ru$ is reuired to $oot =inu7 3his program is particu(ar $ecause it runs $eore your operating system and then its a uite critica( program 3he code o the $oot (oader is

oten insta((ed $et'een the .+R and the irst partition o the disk 3his is not a very good so(ution

since there is not any protection and this code may $e over'ritten $y a system uti(ity 'hich is nota'are o that

For this reason a specia( partition can $e used 'ith 4/3 disks: its the %(: %oot 5artition

)hen you have such a partition on your disk, this space is reserved 3his is 'here the $oot

managers can insta(( their $oot code 94ru$ stage%, and this 'ay you can make modiications tothe other partitions o your disk 'ith no risk o damaging 4ru$ 3his specia( partition does not

have to $e very $ig Bou can Dust a((ocate e' mega$ytes on the disk or such a partition 6t 'i((

 Dust use a very sma(( portion o your disk, and one entry in your partition ta$(e, $ut this is not a pro$(em 'ith 4/3 since you can have more than our primary partitions

6 you are a$out to create a 4/3 (ayout on your disk, its recommended to create a %(: %oot

5artition even i you dont p(an to use it immediate(y 6t 'i(( Dust prevent many pro$(ems you

cou(d have 'ith the $oot (oaders 3o create such a partition you can use /arted or 4&isk 'hich are

 $oth on recent SystemRescueCd versions ere is ho' to do that using the /arted command (ine

interace Bou have to $e careu( 'hen you manipu(ate your partitions, so $e sure you kno' 'hat

you are doing irst Bou have to create a norma( partition irst, using mkpart and then use the

 parted command ca((ed set to set the biosM"rub (ag on the partition you have Dust created

ere is ho' to create a ne' 4/3 (ayout on a disk 9'e use /dev/sda or the e7amp(e 'ith that

 partition 9a(( the pre-e7ising data o that disk 'i(( $e (ost 6t may (ook strange to use e7t% or that partition /arted 'ants a type or that partition so 'e have to give it something, and e7t% is ine

root>sysresccd /root D parted /dev/sda' 5arted .,.0'sin" /dev/sda

7elcome to ' 5arted ;ype N3elpN to view a list o# commands.EpartedF p&rror /dev/sda unreco"nised disk labelEpartedF mklabel "ptEpartedF mkpart primary ext2 0 04EpartedF mkpart primary ext 04 00DEpartedF set biosM"rub onEpartedF p4odel $;$ &4' O$?))(P EscsiF)isk /dev/sda 04%ector size Elo"ical/p3ysicalF +2%/+2%5artition ;able "pt

umber tart &nd ize <ile system ame <la"s

  .k% 0.04% ,,8*k% primary biosM"rub 2 0.04% 04% 064% primary

EpartedF Cuit(n#ormation You may need to update /etc/#stab.

C"eckin t"e current layout

Bou can use /arted rom SystemRescueCd or any (inu7 system to see 'hich (ayout you are

current(y using Just use the print command in parted 6ts sae and it 'ont make any

"%0

Page 125: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 125/174

modiication ere is an e7amp(e o t'o disk 9/dev/sda and /dev/sdb 3he irst one is using an

.S&5S (ayout, and the second one is $ased on 4/3

root>debian /root D parted /dev/sda print4odel $;$ ;*000*0$ EscsiF)isk /dev/sda 000%ector size Elo"ical/p3ysicalF +2%/+2%5artition ;able msdosumber tart &nd ize ;ype <ile system <la"s  *2.*k% 024% 024% primary ext* 2 024% 8.2% .2% primary reiser#s * 8.2% *+.% .2% primary nt#s boot  *+.% 000% ,6+% primaryroot>debian /root D parted /dev/sdb print4odel $;$ $4' O)0*' EscsiF)isk /dev/sdb 000%ector size Elo"ical/p3ysicalF +2%/+2%5artition ;able "ptumber tart &nd ize <ile system ame <la"s  .k% 0.04% ,,8*k% primary biosM"rub 2 0.04% 024% 04% ext* boot

 * 024% 8.2% .2% reiser#s "entoo  *+.% +2.6% .2% reiser#s debian + +2.6% 6,.% .2% ext* centos 6 6,.% 000% ,*0% lvm

%nstallin a patc"ed *rub-27

6 you have a 4/3 disk and you have restored a copy o a (inu7 system rom some'here e(se, you

'i(( have to insta(( a $oot (oader that supports 4/3 to $e a$(e to $oot your system 3his can $edone rom SystemRescueCd +e careu(, this is a dangerous operation Bou have to kno' 'hat

you are doing ere is ho' to insta(( the patched gru$-KLM or 4/3 using SystemRescueCd:

•  $oot on SystemRescueCd-"*K or more recent

• type mkdir ;mnt;$oot

• mount your $oot partition 9or the ; partition o $oot is not on a dedicated partition on

;mnt;$oot

o copy your kerne( to ;mnt;$oot;vm(inuH-7777

o mkdir -p ;mnt;$oot;gru$

o cp ;(i$;gru$;i*82-pc;! ;mnt;$oot;gru$;

o edit ;mnt;$oot;gru$;gru$con

o (n -s gru$con ;mnt;$oot;gru$;menu(st

o umount ;mnt;$oot

o run gru$ rom the she((o use the gru$ root and setup commands to reinsta(( it:

root 9hdK,K or the gru$ name o the partition 'ith the gru$ i(es 9usua((y

;$oot

setup 9hdK or 9hd" to insta(( the $oot (oader on the second hard disk

"%1

Page 126: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 126/174

Sysresccd-5artitionin-$1-*rub-boot-staes

From SystemRescueCd

Jump to: navigation, searchContents

[hide

• " #$out 4ru$

• % 3he $oot managers

• * &escription o the three stages

• 0 )here the stages are (ocated

@bout *rub4ru$ is the deau(t $oot manager on =inu7 3his program is 'orking ear(y in the $oot process,

 $eore the (inu7 kerne( starts 4ru$ is insta((ed automatica((y $y =inu7 insta((ers 6ts a very particu(ar program, and you may $reak it 'hen you make modiications on your system 3he

 pro$(em is its uite diicu(t to repair a $roken 4ru$ insta((ation 'ithout understanding ho' it

'orks For that reason, its uite important to have a (ook at 4ru$ in detai(s #ter having read thischapter, you shou(d $e a$(e to repair and reinsta(( 4ru$ on your $o7, and you shou(d a(so $e a$(e to

make $etter decisions at insta((ation

3here are current(y t'o 4ru$ versions: *rub3 'hich is a(so kno'n as *rub Heacy 9versions

KL7 is sti(( the deau(t on most o the =inu7 distri$utions 6t 'orks 'e((, $ut its not maintainedany more, so each =inu7 distri$ution has a particu(ar 4ru$" version 'ith their o'n modiications

4ru$% is on(y avai(a$(e as pre-versions 9"L2, "LM, $ut its a(ready usa$(e 6t has a $etter design

and provides more (e7i$i(ity 6ts under heavy deve(opment, and its a(ready used $y A$untu-KL"Kor ne' insta((ations

Fortunate(y most o the concepts are common to these t'o versions, so it 'ont $e diicu(t to

understand ho' 4ru$% 'orks i you are ami(iar 'ith 4ru$" 3his documentation 'i(( ocus on

giving you enough kno'(edge so that you can insta(( and repair 4ru$ conigurations

A"e boot manaers

4ru$ is the deau(t $oot manager or =inu7, $ut its a(so used to $oot other operating systems such

as 5pen-So(aris )hat 4ru$ has to do is to load t"e linu kernel and =t"e associated

initramdisk if necessary> into memory so that the kerne( can start 3hese t'o i(es are usua((yca((ed vmlinuz and initrd, and they are stored on a (inu7 i(esystem 9either on the root or on the

 $oot i(esystem in genera( 3he pro$(em is that the norma( programs are using the services o the

operating system to read a i(e rom a i(esystem #t stage stage 4ru$ cannot use it $ecause =inu7is not started yet

"%2

Page 127: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 127/174

5ther $oot managers such as =i(o are reading these i(es using a static (ist o sectors thatcorrespond to the sectors 'here these i(es are stored 3his map is created at insta((ation time $y

the (i(o command 'hen the operating system is avai(a$(e 3he pro$(em 'ith this static map is that

the $oot (oader is not (e7i$(e and it stops 'orking i the physica( (ocation o the i(es on the diskare modiied

4ru$ is a (ot more (e7i$(e 6t is a$(e to read i(es rom i(esystems such as at, nts, e7t*, reisers

3hen it can read the (inu7 kerne( image and its initrd even 'hen i(es are modiied on the disk

3his (e7i$i(ity has a cost: gru$ is $igger and mu(tip(e steps are necessary or gru$ to $e e7ecuted3hese three steps are ca((ed sta"e-, sta"e-.+ and sta"e-2 #(so the sta"e-.+ may not $e

used 'ith 4ru$" 6n that case sta"e 'i(( direct(y (oad sta"e2 For simp(icity sta"e-.+ it has

 $een comp(ete(y removed rom 4ru$%

Bou can see these these stages i you (ook at the the i(es you have in ;$oot;gru$:

root>debian D ls -l /boot/"rub-rw-r--r-- root root 6* 200,-08-6 0+ device.map-rw-r--r-- root root *8 200,-08-6 0+ e2#sMsta"eM+

-rw-r--r-- root root *608 200,-08-6 0+ #atMsta"eM+-rw-r--r-- root root 2,20 200,-08-6 0+ ##sMsta"eM+-rw------- root root 6* 200,-08-6 0+ "rub.con#-rw-r--r-- root root 2,20 200,-08-6 0+ iso,660Msta"eM+-rw-r--r-- root root 88 200,-08-6 0+ I#sMsta"eM+lrwxrwxrwx root root 200,-08-6 0+ menu.lst -@ ./"rub.con#-rw-r--r-- root root *0+6 200,-08-6 0+ minixMsta"eM+-rw-r--r-- root root +6+6 200,-08-6 0+ reiser#sMsta"eM+-rw-r--r-- root root ,8* 200,-0- ,, splas3.xpm."z-rw-r--r-- root root +2 200,-08-6 0+ sta"e-rw-r--r-- root root 2208 200,-08-6 0+ sta"e2-rw-r--r-- root root *,6 200,-08-6 0+ u#s2Msta"eM+-rw-r--r-- root root 2+00 200,-08-6 0+ vsta#sMsta"eM+-rw-r--r-- root root +2 200,-08-6 0+ x#sMsta"eM+

Description of t"e t"ree staes

3he $oot process on traditiona( /C computers has to cope 'ith the (imitations o the +65S 3he+65S kno's ho' to 'ork 'ith hard disks having a va(id .aster-+oot-Record 9.+R 3his is the

irst sector o a disk 91"% $ytes, and its used to store $oth the partition ta$(e 9'hich can contains

up to 0 entries and the initia(iHation code 6 no initia(iHation code is present in the .+R, the+65S 'i(( e7ecute the code stored on the irst sector o the partition 'hich is marked as active

3hats 'hy )indo's has to $e insta((ed on the active primary partition o you 'ant it to start

6n genera(, 4ru$ is using 00K $ytes reserved or the initia(iHation code o the .+R to start 3he pro$(em is this code area is very sma((, and 4ru$ does comp(e7 things that cannot it in 00K $ytes3hats 'hy 4ru$ is made o mu(tip(e stages: the irst stage is very sma(( #(( it does is it (oads the

irst sector o the ne7t stage 9either stage-"1 or stage%, and it e7ecutes the instructions it contains,

'hich (oad the stage entire(y in memory

%f stae-374 is present/ it implements t"e support for readin files from t"e filesystem  'herestage% is stored 3hen stage% can $e stored as a norma( i(e, and it is ready dynamica((y 3hen

stage% can $e moved or modiied $ecause gru$ understands ho' to the data o that i(es are

organiHed in a i(esystem 4ru$ comes 'ith mu(tip(e possi$(e versions o the stage-"1, one version

"%M

Page 128: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 128/174

or each supported i(esystem #t the end on(y one versions 'i(( $e insta((ed: the version thatcorrespond to the i(esystem o the partition 'here the stage% is stored

%f t"ere is no stae-374/ t"en stae3 directly loads stae)  using a static (ist o sectors 'here

stage% is stored 3his $(ock (ist is created at insta((ation time 3he pro$(em is that it sti(( stop'orking o stage% is moved to another (ocation

A"e stae) is biest and the most important part o gru$ Stage% contains the entire code that

 provides support or a(( the i(esystems, it can disp(ay the $oot menu and oer many eatures used

to $oot an operating system 6ts inte((igent enough to read any i(e rom the supported i(esystems3hats very important, $ecause the stage% 'i(( have to (oad the (inu7 kerne( image 9vm(inuH and

the initramdisk 9initrd to $oot (inu7

6ts important to dierentiate the two ways *rub can read a file from t"e disk  6n the irst

method 4ru$ is using a static (ist o sectors, 'hich depends on your particu(ar coniguration 3his(ist i created at insta((ation, Dust ater the i(es have $een copied to your disk # i(e may $e

ragmented on the disk so 'e cant Dust store the num$er o the irst sector o the i(e 3he second

method is to read the i(e dynamica((y $y understanding the structure o the i(esystem 'here itsstored 3his is on(y possi$(e ater the stage-"1 or the stage% have $een (oaded

W"ere t"e staes are located

3he various 4ru$ stages can $e stored in mu(tip(es p(aces on the disk: they can $e either copied in

the .+R, in the $oot sector o a partition, in a space 'hich has not $een a((ocated to partitions, inan unused area o a partition, as a norma( i(es, or on a dedicated partition )hen stage-"1 is

 present, stage% 'i(( $e stored as a norma( i(e 'hich is read dynamica((y 6n the other cases the

stage 'i(( $e stored at a static (ocation 3he $est p(ace 'i(( $e on sectors 'hich are not supposed to

move in the uture, or to $e over'ritten $y something e(se

Stage" can on(y $e stored either on the .+R or in the $oot sector o a partition, $ecause thats the

on(y p(aces that can $e direct(y e7ecuted $y the +65S

Stage-"1 can $e stored at mu(tip(e (ocations: i stage" is in the .+R, stage-"1 is (ike(y to $e

'ritten in the sectors 'hich are $et'een the .+R 9irst sector and the irst partitions Forgeometry reasons, the irst partition does not start on the second sector Dust ater the .+R 3hen it

(eaves e' i(o-+ytes 'here stage-"1 can it entire(y Anortunate(y stage% is too $ig to it there

e7cept i the administrator decided not to create the irst partition at the very $eginning Stage-"1can a(so $e insta((ed on the irst sectors o a partition, i the i(esystem (eaves some ree space at

the $eginning For instance, reisers starts at oset 211*2 o a partition, 'hich (eaves 20 i(o-

+ytes or that sort o things

Stage% is the $iggest o the three stages 6 there is a stage-"1, then stage% is Dust a norma( i(e onthe $oot or root i(esystem 6 stage% is direct(y (oaded $y stage" then its read using a static (ist o

sectors created during the insta((ation Stage% can $e insta((ed $eore the irst partition o the disk i

there is enough space or it 6t can a(so $e insta((ed on a dedicated partition i your disk is $ased onthe 4/3 partition ta$(e 3his partition shou(d idea((y the irst one, and it reserves some space or

the $oot manager 3hat 'ay nothing e(se can over'rite its data, and 4ru$ shou(d not stop 'orking

as (ong as you dont modiy this partition

"%8

Page 129: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 129/174

Sysresccd-5artitionin-$1-Repairin-a-

damaed-*rub

From SystemRescueCd

Jump to: navigation, search

%ntroduction

6 you have read the previous chapter , you kno' that 4ru$ reuires mu(tip(e stages to $e insta((ed

correct(y 3hey are a(( insta((ed in dierent (ocations o your hard-disk 6 one o these sectors is

over'ritten then 4ru$ 'i(( stop 'orking Fortunate(y t"ere are solutions to recover your linu

installation $y reinsta((ing 4ru$, and you dont have to reinsta(( =inu7 entire(y

#(( the administration programs reuired to re-ena$(e 4ru$ are part o the standard =inu7

insta((ations, so the main pro$(em is to access =inu7 the irst time 3he irst so(ution is to start the=inu7 system 'hich is on your hard-disk $y $ooting rom SystemRescueCd 3he second so(ution

is to $oot rom a rescue disk such as SystemRescueCd norma((y and to run the 4ru$ insta((ationcommand rom a chroot environment 3hese t'o so(utions are descri$ed $e(o' and they s"ould

work for bot" *rub3 =*rub Heacy> and *rub)

W"y *rub may break 

4ru$ may stop 'orking or many reasons ere are e7amp(es o 'hat can $reak it:

• installation of anot"er operatin system on your computer: the insta((ation program is

(ike(y to over'rite the $oot code in the .+R 'here 4ru$ can store its irst stage

• modifications of t"e disk partitionin: 4ru$ sometimes use a static (ist o sectors to

remem$er 'here the ne7t stage is (ocated 6t can $e insta((ed at the $eginning o a partition'hen the i(esystem o that partition (eaves some ree space at the $eginning 9eg: ReiserFS

is not using the irst 20+ 6 you move that partition, then the sectors 'here 4ru$ is

insta((ed 'i(( move 'ith it, and the $ad sectors 'i(( $e reerenced

• disk clonin: you may 'ant to c(one your partitions to another disk or another computer

or some reasons 6 you Dust c(one the partitions o the disks, the sectors 'here 4ru$ is

insta((ed may not $e copied 9eg: sectors $eore the irst partition, or .+R

• modification of t"e boot priority of t"e "ard-disks: 6 you have mu(tip(e hard-disks you

can speciy 'hich one you 'ant to $oot rom in the +65S settings 6n genera( 4ru$ is

insta((ed on on(y one disk, so it 'i(( stop 'orking i the +65S try to $oot rom another disk

%dentification of t"e boot and root filesystems

3o repair 4ru$, you may need to kno' the name o the $oot and root partitions 'here =inu7 isinsta((ed 6 you have many partitions on your disk you may not remem$er 'hich one it is Bou can

run #sarc3iver probe simple or #sarc3iver probe detailed rom SystemRescuecd to sho'

the (ist o i(esystems o your computer ere is an e7amp(e:

"%L

Page 130: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 130/174

root>sysresccd /root D #sarc3iver probe simpleG=====)&V(9&=====H G==<(!&Y==H G=====!$%&!=====H G====(W&====H G4$H G4(HG/dev/sda H Gext* H Gboot H G 2+6.00 4%H G 8H G HG/dev/sda2 H Greiser#s H Gdebian H G 6.00 %H G 8H G 2HG/dev/sda* H Gnt#s H Gwinxp*2 H G 6.00 %H G 8H G *HG/dev/sda H Gext* H Gdata H G 8,8.+6 %H G 8H G H

3here 'e can see that /dev/sda is the $oot partition, and /dev/sda2 is the root i(esystem or

=inu7-&e$ian 3his is o$vious $ecause the (a$e(s are appropriate, $ut its not a('ays that simp(e

#(( (inu7 root i(esystems are supposed to have their init program in /sbin/init Bou can check

that =inu7 is insta((ed on a partition $y checking i that i(e e7ists:

root>sysresccd /root D mkdir -p /mnt/linuxroot>sysresccd /root D mount -r /dev/sda2 /mnt/linuxroot>sysresccd /root D ls -l /mnt/linux/sbin/init-rwxr-xr-x root root **8 2008-08-2 +20 /mnt/linux/sbin/initroot>sysresccd /root D umount /mnt/linux

3he /boot directory is 'here the (inu7 kerne( image 9vm(inuH and the associated initrams 9initrd

and gru$ i(es are insta((ed 3his directory is either part o the root i(esystem or on a separate

 partition Bou can identiy the $oot partition $ecause its uite sma(( in genera( 9$et'een 1K.+and *KK.+, and its oten the irst partition o the hard drive Bou can mount the $oot partition

and check that it contains the i(es 'e e7pect 9vm(inuH and initrd:

root>sysresccd /root D mkdir -p /mnt/bootroot>sysresccd /root D mount -r /dev/sda /mnt/bootroot>sysresccd /root D ls -l /mnt/bootlrwxrwxrwx root root 2008-08-0+ 226 boot -@ .-rw-r--r-- root root ,820* 200,-0-2 00+ con#i"-2.6.*0-bpo.2-amd6drwxr-xr-x 2 root root 2800 200,--2 ,*8 "rub-rw-r--r-- root root 8,8+8 200,--08 +, initrd.im"-2.6.*0-bpo.2-amd6drwx------ 2 root root 8 2006--2+ +++ lost]#ound

-rw-r--r-- root root +08+ 200,-0-2 00+ ystem.map-2.6.*0-bpo.2-amd6-rw-r--r-- root root 22206 200,-0-2 00 vmlinuz-2.6.*0-bpo.2-amd6root>sysresccd /root D umount /mnt/boot

Solution 3: !ootin your Hinu installation from

SystemRescueCd

SystemRescueCd a((o's you to $oot a =inu7 system insta((ed on the disk even i gru$ is $roken

Bou have to $oot SystemRescueCd 'ither rom the cdrom, us$ stick  or  the net'ork  3he purposeis to Dust have an access to your system so that you can reinsta(( 4ru$ rom your origina( =inu7

insta((ation

)hen the irst screen sho's up 9'ith the #CS66-art (ogo, you 'i(( have to $oot 'ith speciic $oot

options so that it starts the system 'hich is insta((ed on the disk 3he root=/dev/xxx option can

 $e use either 'ith the name o the root partition o your =inu7 insta((ation, or 'ith auto 6n the

irst case 9eg: rescuecd root=/dev/sda2 the SystemRescueCd initia(iHation script 'i(( mount

the speciied partition 6 you type rescuecd root=auto then SystemRescueCd 'i(( use the irst

va(id root partition 'here a =inu7 insta((ation has $een detected

"*K

Page 131: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 131/174

6 your =inu7 system is using 20$it $inaries, you have to use a 20$it kerne( 9either rescue6 or

altker6, so the comp(ete command can $e something (ike rescue6 root=auto i you 'ant

SystemRescueCd to ind and $oot the irst va(id 20$it insta((ation o =inu7 Bou can use a 20$it

kerne( even i you have a *%$it insta((ation o =inu7, as (ong as your hard'are supports 20$it programs 9'hich is the case or a(( the recent 6nte( ^ #.& processors

Bour =inu7 system shou(d then $oot using the kerne( rom SystemRescueCd the conseuence is

that it may comp(ain a$out missing kerne( modu(es 9o suc3 #ile or directory errors 3his is

 $ecause each speciic kerne( version has its o'n kerne( modu(es, and the (inu7 distri$ution you

have insta((ed does not provides the modu(es o that particu(ar kerne( 6t shou(d not $e a pro$(em

since a(( the i(esystems and disk drivers shou(d $e (oaded at that stage 3his is a(( you need to

reinsta(( 4ru$

5nce you have an access to your system, you have to get a she(( to run commands Bou have to

identiy the name o the disk 'here 4ru$ has to $e insta((ed 6n genera(, it 'i(( $e /dev/sda 6 you

have more than one disk, it may a(so $e /dev/sdb, /dev/sdc, Bou can use #sarc3iver probe

simple to get the (ist o the partition, and then you can guess the name o the disk ere is an

e7amp(e o a computer 'ith t'o disks 9/dev/sda and /dev/sdb:

root>debian /root D #sarc3iver probe simpleG=====)&V(9&=====H G==<(!&Y==H G=====!$%&!=====H G====(W&====H G4$H G4(HG/dev/sda H Gext* H Gboot H G 2+6.00 4%H G 8H G HG/dev/sda2 H Greiser#s H Gdebian H G 6.00 %H G 8H G 2HG/dev/sda* H Gnt#s H Gwinxp*2 H G 6.00 %H G 8H G *HG/dev/sda H Gext* H Gdata H G 8,8.+6 %H G 8H G HG/dev/sdb H Gext* H Gboot H G ,6.++ 4%H G 8H G HG/dev/sdb2 H Greiser#s H G"entoo H G 6.00 %H G 8H G 8HG/dev/sdb* H G!V42MmemberH GSunknown@ H G 866.+6 %H G 8H G ,H

3hen you can use "rub-install 'ith the name o the disk 'here it has to $e insta((ed ere is

'hat you can e7pect:

root>debian /root D "rub-install /dev/sda(nstallation #inis3ed. o error reported.;3is is t3e contents o# t3e device map /boot/"rub/device.map.93eck i# t3is is correct or not. (# any o# t3e lines is incorrect1#ix it and re-run t3e script Q"rub-installN.E3d0F /dev/sda

4ru$ shou(d no' $e i7ed on your disk, and you can re$oot your computer

Solution ): Reinstallation of *rub usin c"root

3he second option is to repair 4ru$ $y running "rub-install another 'ay 3he command 'e are

using is sti(( part o your =inu7 insta((ation 3he dierence is that 'e 'i(( start SystemRescueCd

norma((y, and 'e 'i(( access your =inu7 insta((ation rom chroot 3he irst thing to do is to start

SystemRescueCd norma((y Bou Dust have to $oot 'ith a 20$it kerne( 9eg: rescue6 or

raltker6 i your =inu7 insta((ation is $ased on 20$it $inaries

 Ne7t, you can run #sarc3iver probe simple to identiy your $oot and root i(esystems 9see the

section a$out detection o the $oot and root i(esystems

"*"

Page 132: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 132/174

root>sysresccd /root D #sarc3iver probe simpleG=====)&V(9&=====H G==<(!&Y==H G=====!$%&!=====H G====(W&====H G4$H G4(HG/dev/sda H Gext* H G/boot H G ,6.08 4%H G 8H G HG/dev/sda2 H Gext* H G#edora H G 6.0+ %H G 8H G 2HG/dev/sda* H Gext* H Gdata H G 2.0 %H G 8H G *H

 No' you have to mount the partition that contains the root i(esystem 6n that e7amp(e /dev/sda2 

is the partition 'here Fedora-=inu7 is insta((ed Bou a(so have to mount theproc

,dev

 andsys

 

virtua( i(esystems this 'ay:

root>sysresccd /root D mkdir /mnt/linuxroot>sysresccd /root D mount /dev/sda2 /mnt/linuxroot>sysresccd /root D mount -o bind /proc /mnt/linux/procroot>sysresccd /root D mount -o bind /dev /mnt/linux/devroot>sysresccd /root D mount -o bind /sys /mnt/linux/sys

3he mount -o bind command makes something that (ooks (ike a sym$o(ic (ink For instance the

directory /mnt/linux/proc is an access to the rea( primary directory 'hich is /proc 

 No' 'e have to c3root to /mnt/linux C"root is a very powerful command: it ives t"eprorams t"e illusion t"at t"e root of t"e system is /mnt/linu# 6t means each time a programs

reads a i(e such as /bin/ls it 'i(( use /mnt/linux/bin/ls instead Chroot is reuired $ecause

'e 'ant to e7ecute commands rom the =inu7 insta((ation rom the disk, as i it 'as the current

root C"root only "as an effect on t"e current s"ell and on a(( the commands that you 'i(( runrom that she(( 6n has no eect on the other programs 'hich are a(ready running rom

SystemRescueCd

root>sysresccd /root D c3root /mnt/linux /bin/bas3

6 the contents o /boot is on a separate partition 9i /boot is current(y empty you have to mount

it:

Groot>sysresccd /HK ls -l /boot/total 0Groot>sysresccd /HK mount /dev/sda /boot/Groot>sysresccd /HK ls -l /boot/-rw-r--r--. root root ,+6 200,-0+-2 222+ con#i"-2.6.2,.-6.#c.i+86drwxr-xr-x. 2 root root 02 200,-- 8+ "rub-rw-------. root root 2,0 200,-06- 08 initrd-2.6.2,.-6.#c.i+86.im"-rw-r--r--. root root 2+8 200,-0+-2 222+ ystem.map-2.6.2,.-6.#c.i+86-rwxr-xr-x. root root *0*+0+6 200,-0+-2 222+ vmlinuz-2.6.2,.-6.#c.i+86

 No' you can run "rub-install to repair 4ru$ 3he irst argument it takes is the name o the disk

'here to reinsta(( 4ru$ See the previous section or more detai(s

Groot>sysresccd /HK "rub-install /dev/sda(nstallation #inis3ed. o error reported.;3is is t3e contents o# t3e device map /boot/"rub/device.map.93eck i# t3is is correct or not. (# any o# t3e lines is incorrect1#ix it and re-run t3e script Q"rub-installN.K t3is device map was "enerated by anacondaE3d0F /dev/sda

"*%

Page 133: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 133/174

5nce 4ru$ has $een reinsta((ed, you can type exit to (eave the chroot environment

Groot>sysresccd /HK exitexit

3hen unmount a(( the i(esystems proper(y:

root>sysresccd /root D umount /mnt/linux/[dev1proc1sys\root>sysresccd /root D umount /mnt/linux/bootroot>sysresccd /root D umount /mnt/linux/

Bou can no' re$oot your computer, 4ru$ shou(d 'ork

Sysresccd-1etworkin-$1-!asic-%5-

confiuration-tools-on-linu

From SystemRescueCd

Jump to: navigation, search

Contents

[hide

• " 5(d generation net'ork coniguration too(s on (inu7

o "" interace coniguration too(

o "% routing coniguration too(

• % Ne' generation net'ork coniguration too(s on (inu7

o %" interace coniguration too(

o %% $asic routing 'ith ip route

Old eneration network confiuration tools on linu

interface confiuration tool

#(( uni7 (avours comes 'ith i#con#i" too( to conigure the net'ork interaces 5n =inu7 the

net'ork interaces are ca((ed ethK, eth", eth%, i#con#i" a((o's you to conigure the $asic

3C/;6/ settings on the net'ork interaces, such as one or more static 6/ addresses, the netmask,

Bou dont have to use iconig 'hen you use dynamic 6/ addresses 6n that case, you Dust have torun a &C/ c(ient 9such as dhdpcd or dhc(ient that 'i(( try to connect to a &C/ server on your=#N in order to get a dynamic address ere is ho' to conigure an 6/ address on the irst ethernet

interace o your computer:

i#con#i" et30 ,2.68.. netmask 2++.2++.2++.0

3his 6/ address $e(ongs to the private c(ass-C 6/ address, it means that your net'ork interace can

speak to a(( the computers having an address starting 'ith ,2.68. that are connected on that

"**

Page 134: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 134/174

=#N 6 you conigure static 6/ addresses, make sure an address is never used t'ice on the same=#N

Bou can a(so conigure more that one 6/ address on an interace 3his is ca((ed <6/ #(iasing< 6t

means that the interace 'i(( receive a(( the net'ork packets sent to one o these addresses 3heseaddresses can either $e part o the same su$net 9eg: "L%"28"";%0 and "L%"28"%;%0 or they

can $e on dierent su$nets 9eg: "L%"28"";%0 and "M%"2"";"2 ere is an e7amp(e o 6/

a(iasing:

i#con#i" et30 ,2.68.. netmask 2++.2++.2++.0i#con#i" et30 ,2.68..2 netmask 2++.2++.2++.0i#con#i" et302 2.6.. netmask 2++.2++.0.0

routin confiuration tool

Bou may need to conigure the routes on your machines as soon as you dont have a very simp(enet'ork coniguration on your machine, 6 mean a computer 'ith one interace +asica((y, routing

a((o's you to say 'hich net'ork device, or 'hich router o the net'ork must $e used to send

net'ork packets to a remote machine or to a remote su$net

#(( the recent operating systems have a route command to conigure routing, $ut the synta7 may

change ere are severa( e7amp(es o ho' to conigure routing 'ith the o(d generation command

on (inu7:

• conigure the deau(t route to use "L%"28"%10 as the gate'ay:

route add de#ault "w ,2.68..2+ 

• send the packets to "L%"28"1M* through the second net'ork interace 9eth" is the second

interace:

route add -3ost ,2.68.+.* dev et3 

• send the packets the su$net "L%"28%KKK;%0 through a gate'ay:

route add -net ,2.68.200.0/2 "w ,2.68.. 

• de(ete the previous route:

route del -net ,2.68.200.0/2 "w ,2.68.. 

• disp(ay the current routing ta$(e:

route -n 9option -n disa$(es the name reso(ution

3he routing ta$(e is used to route the packets sent $y your o'n computer 6ts a(so used i your

computer acts as a router 6n that case, you must ena$(e the <6/ or'arding< 'ith the o((o'ing

command:

ec3o @ /proc/sys/net/ipv/ipM#orward

"*0

Page 135: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 135/174

1ew eneration network confiuration tools on linu

iproute% is a co((ection o uti(ities to rep(ace the (egacy Ani7 net'orking too(s that 'ere previous(y

used or the tasks o coniguring net'ork interaces, routing ta$(es, and managing the #R/ ta$(e

3he most important command is ip 6t comes 'ith severa( su$commands 'hich rep(aces the o(d

generation uni7 net'orking too(s iproute% uses the net(ink socket to speak to the kerne( 3his is

(ess (imited than the ioct( interace that is used 'ith iconig

• ip address Sparameters@: conigures the net'ork interaces 'ith 6/v0 or 6/v2 9it

rep(aces i#con#i"

• ip route Sparameters@: conigures the routing 9it rep(aces route

• ip rule Sparameters@: conigures the po(icy routing 9advanced routing on (inu7

• ip nei"3 Sparameters@: manages the #R/ ta$(e 9it rep(aces the arp command

interface confiuration tool

Since ip is a recent command, it has $een designed to $e a$(e to manage comp(e7es cases 3his is

'hy you dont have to use 6/ a(iasing to conigure severa( 6/ addresses on an interace ere isho' to conigure t'o 6/ addresses on ethK:

ip address add ,2.68../2 dev et30ip address add ,2.68..2/2 dev et30

#ny'ay you can speciy an a(ias even i its not reuired, in order to preserve the compati$i(ity

'ith o(d too(s:

ip address add ,2.68../2 dev et30ip address add ,2.68..2/2 dev et30 label et30

ere is an e7amp(e o 'hat you can get 'hen you 'ant to (ist the 6/ addresses conigured on your

computer 'ith ip address s3ow:

lo S!::5%$9P1'51!:7&?M'5@ mtu 6*6 Cdisc noCueue  link/loopback 000000000000 brd 000000000000  inet 2.0.0./8 brd 2.2++.2++.2++ scope 3ost lo2 et30 S%?:$)9$;14'!;(9$;1'51!:7&?M'5@ mtu +00 Cdisc p#i#oM#ast Clen 000  link/et3er 000c2,028c8d brd ############  inet ,2.68.+.*/2 brd ,2.68.+.2++ scope "lobal et30  inet 2.6.0./6 scope "lobal et30

ere is ho' to get rid o addresses:

ip address del ,2.68../2 dev et30ip address del ,2.68..2/2 dev et30

3he errors disp(ayed $y this too( may $e mis(eading For instance ?;&;!(P answers <ile

exists means that you added an address or a route that 'as a(ready conigured 3here is no i(e

invo(ved in that action:

K ip address add ,2.68..2/2 dev et30 label et30?;&;!(P answers <ile exists

"*1

Page 136: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 136/174

basic routin wit" ip route

3he ip command a((o's you to make $oth $asic routing and advanced routing such as po(icy

routing 3his is 'hy the o(d route command is deprecated #ny'ay this section ocuses on $asic

routing on(y

ere are severa( e7amp(es o ho' to conigure routing 'ith ip route:

• conigure the deau(t route to use "L%"28"%10 as the gate'ay:

ip route add de#ault via ,2.68..2+ 

• send the packets to "L%"28"1M* through the second net'ork interace 9eth" is the second

interace:

ip route add ,2.68.+.*/*2 dev et3 

• send the packets the su$net "L%"28%KKK;%0 through a gate'ay:

ip route add ,2.68.200.0/2 via ,2.68.. 

• remove the previous route entry rom the routing ta$(e:

ip route del ,2.68.200.0/2 

• disp(ay the current routing ta$(e:

ip route s3ow 

• sho' the routing cache:

ip route s3ow cac3e 

• (ush the routing cache:

ip route #lus3 cac3e 

#s said previous(y, you have to ena$(e 6/ or'arding i you 'ant your machine to act as a router:ec3o @ /proc/sys/net/ipv/ipM#orward 

Sysresccd-1etworkin-$1-@dvanced-networkin-and-policy-routin

From SystemRescueCd

Jump to: navigation, search

Contents

"*2

Page 137: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 137/174

[hide

• " #$out po(icy routing

• % 3he routing ta$(es

o %" 3he norma( routing ta$(es

o %% 3he routing cache ta$(e

o %* E7amp(es o routing ta$(es

* Ru(es and po(icieso *" E7amp(es o ru(es

o *% o' ru(es are processed

• 0 E7am p(e o ru(es

• 1 o' to organiHe the routing ta$(es

@bout policy routin

6n c(assic routing the destination address o an 6/ packet is used to kno' ho' to route the packet/o(icy routing is an advanced type o routing that (et you to conigure routing $ased on parameters

other than Dust the destination 6/ address For instance, you may 'ant to use the source address orthe port to take the routing decision /o(icy routing is on(y possi$(e 'ith the ne' generationnet'ork too(s, so you 'i(( need the iproute% programs 3he route command cannot do po(icy

routing 3he good ne's is the support or po(icy routing has $een merged in the (inu7 kerne( a (ong

time ago, so you dont have to patch your kerne( 3he support is optiona(, $ut most the =inu7distri$utions support it $y deau(t

Since the o(d routing too(s are sti(( supported, its not possi$(e to mi7 the standard routes $ased on

the destination addresses, and the advanced routes $ased on e7tended parameters 3hats 'hy you

have to use severa( routing ta$(es Bou 'i(( have to 'rite ru(es that te((s the kerne( 'hich routingta$(e to use or each net'ork packets For instance, you can say that 3C/;6/ packets having a

speciic destination port 'i(( $e routed using a speciic routing ta$(e, and that a(( the other packets'i(( use the main routing ta$(e

A"e routin tables

/o(icy routing reuire more than one routing ta$(e =inu7-%2 supports up to %11 dierent routing

ta$(es +y deau(t and 'ith c(assic routing, you Dust use t'o ta$(es: the local routing ta$(e and the

main routing ta$(e )ith po(icy routing, you 'i(( create other routing ta$(es 3he ta$(es are (isted in

/etc/iproute2/rtMtables

A"e normal routin tables

• 3he local routin table is managed automatica((y $y the kerne( 3he user does not have

to take care o this ta$(e 6ts used to store a(( the (oca( addresses, and it a((o's the kerne( to

kno' i a net'ork packet has to $e de(ivered (oca((y 9on the (oca( machine or i it has to $ede(ivered to another computer 9it 'ou(d $e routed i its a((o'ed 6ts the irst rea( routing

ta$(e used $y the kerne( 'hen its making a (ookup 6ts used Dust ater the routing cache that

is a specia( routing ta$(e

"*M

Page 138: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 138/174

• 3he main routin table is used or a(( the other addresses $y deau(t 3his is the routing

ta$(e used $y the route command, and its a(so the ta$(e that is used 'hen you dont

speciy the name o the ta$(e 'ith ip route

• 3he custom  routin tables are a(( the other ta$(es 3hese ta$(es 'i(( $e used 'hen a

net'ork packet matches the advanced routing ru(es speciied $y ip rule 3hese routing

ta$(es are norma( routing ta$(es, they can have a deau(t route

A"e routin cac"e table

3he routin" cac3e table is a specia( routing ta$(e managed automatica((y $y the kerne( ta$(e to

improve the perormances 3here is on(y one routing cache ta$(e even i you have severa( routing

ta$(es conigured 3he cache is 'here the kerne( saves the resu(ts o the recent routing (ookups itmakes 6t saves on(y (ookup resu(ts or a speciic 6/ address, it does not saves routing inormation

a$out su$nets 3he routing cache can $e manipu(ated 'ith ip route as another ta$(e 6t can $e

vie'ed $y ip route s3ow cac3e and (ushed $y ip route #lus3 cac3e 3he cache is the irst

routing ta$(e used $y the kerne( every time it makes a (ookup 6ts used even $eore the (oca(

routing ta$(e

$amples of routin tables

ere is an e7amp(e o routing ta$(es:

• 3he local routin table disp(ayed $y iproute2 

D ip route s3ow table localbroadcast 2.2++.2++.2++ dev lo proto kernel scope link src 2.0.0.local ,2.68.+.* dev et30 proto kernel scope 3ost src ,2.68.+.*broadcast ,2.68.+.0 dev et30 proto kernel scope link src ,2.68.+.*

broadcast 2.0.0.0 dev lo proto kernel scope link src 2.0.0.broadcast ,2.68.+.2++ dev et30 proto kernel scope link src ,2.68.+.*local 2.0.0. dev lo proto kernel scope 3ost src 2.0.0.local 2.0.0.0/8 dev lo proto kernel scope 3ost src 2.0.0.

• 3he main routin table disp(ayed $y iproute2 

D ip route s3ow table main2.6..0/2 via ,2.68.+.2+* dev et30,2.68.+.0/2 dev et30 proto kernel scope link src ,2.68.+.*2.0.0.0/8 dev lo scope linkde#ault via ,2.68.+.2 dev et30

• 3he main routin table disp(ayed $y the route command

D route -nPernel (5 routin" table)estination ateway enmask <la"s 4etric ?e# 'se (#ace2.6..0 ,2.68.+.2+* 2++.2++.2++.0 ' 0 0 0 et30,2.68.+.0 0.0.0.0 2++.2++.2++.0 ' 0 0 0 et302.0.0.0 0.0.0.0 2++.0.0.0 ' 0 0 0 lo0.0.0.0 ,2.68.+.2 0.0.0.0 ' 0 0 0 et30

Rules and policies

"*8

Page 139: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 139/174

3he ru(es are used to te(( the kerne( 'hat action to take or each kind o net'ork packet 3he actionis oten to use a custom routing ta$(e, $ut it may a(so $e speciic actions such as t3row,

unreac3able, pro3ibit, black3ole 3he ru(es is the p(ace 'here to use the advanced packet

matching ere are the parameters that you can use to decide 'hich routing ta$(e to use:

• the %5 source address and the %5 destination address 

• the inress device, 6 mean 'here the packet comes rom

• the AOS 93ype 5 Service, its part o the 6/ packet header

• the fwmark number 9ire'a(( mark 6ts an attri$ute that can $e changed in neti(ter, you

have to use ipta$(es to do that

$amples of rules

• #(( the packets rom "L%"28""0K;%0 shou(d $e use the routing ta$(e named rtOta$(e"

ip rule add #rom ,2.68..0/2 table rtMtable

• #(( the packets rom "L%"281" to "M%"2""KK shou(d not $e routed and unreac3able 

must $e returned via 6C./:

ip rule add #rom ,2.68.+. to 2.6..00 unreac3able

• #(( the packets rom "L%"281" shou(d not $e routed:

ip rule add #rom ,2.68.+. pro3ibit

• #(( the packets that 'ere marked 'ith 'mark@" $y neti(ter 9you can do that 'ith ipta$(es

shou(d $e routed to rtOta$(eOads(

ip rule add #wmark table rtMtableMadsl

• #(( the packets that 'ere marked 'ith 'mark@% $y neti(ter 9you can do that 'ith ipta$(es

shou(d $e routed to rtOta$(eOca$(e

ip rule add #wmark 2 table rtMtableMcable

• Bou can remove an e7isting ru(e using a synta7 simi(ar to the add su$command ere is

ho' to remove the (ast ru(e 'e added:

ip rule del #wmark 2 table rtMtableMcable

.ow rules are processed

3he kerne( supports up to *%M2M ru(es +y deau(t on(y the o((o'ing ru(es are used:

D ip rule0 #rom all lookup local*266 #rom all lookup main*26 #rom all lookup de#ault

3he ru(es are e7ecuted in the order, rom priority K to priority *%M2M 6t means the irst ru(e 9ru(e Kis the irst one to $e e7ecuted, and it drives a(( the packet to the (oca( routing ta$(e, in order to

uick(y process packets that have to $e de(ivered (oca((y 3he main and de#ault routes are the (ast

ones to $e used or the (ookup So the main routing ta$(e 'i(( $e used on(y i no custom routeound a va(id match or a net'ork packet 6n other 'ords, a(( the packets that do not match the

"*L

Page 140: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 140/174

ru(es speciied $y ip rule 'i(( use the main routing ta$(e 3he deau(t routing ta$(e is empty $y

deau(t Bou can use it i you 'ant to speciy routes or packets that do not match any o the

 previous routes

+e careu(: even i you on(y have c(assic routing ta$(es on your system, the deau(t ru(es areimportant Removing the deau(t ru(es 'ou(d $reak the c(assic routing, since the packet cou(d not

access the main routing ta$(e

)hen you create ru(es, you can speciy the priority Dust 'ith priority xxx 6 you dont speciy

the priority, the (ast avai(a$(e num$er 'i(( $e attri$uted 6t means the irst ne' ru(es to $e created'i(( $e *%M21, *%M20,

$ample of rules

ere is the (ist o ru(es 'e get i 'e e7ecute a(( the ru(es given in the previous section:

D ip rule s3ow

0 #rom all lookup local*26 #rom all #wmark 0x2 lookup rtMtableMcable*262 #rom all #wmark 0x lookup rtMtableMadsl*26* #rom ,2.68.+. pro3ibit*26 #rom ,2.68.+. to 2.6..00 unreac3able*26+ #rom ,2.68..0/2 lookup rtMtable*266 #rom all lookup main*26 #rom all lookup de#ault

.ow to oranie t"e routin tables

eep in mind that a packet can check mu(tip(e routing ta$(e, each routing ta$(e can have mu(tip(e

routes So in case no route match in the irst routing ta$(e, other ta$(es 'i(( $e checked in order toind the right route or a packet So you dont have to dup(icate the routes o the main routing ta$(e

in the custom ta$(es

5ne good 'ay to manage the dierent routing ta$(es is to do use the o((o'ing method:

• Bou add a(( the norma( routes $ased on the destination in the main routing ta$(e

• Bou Dust add one deau(t route in each o the other routing ta$(e

3hat 'ay, you end up 'ith something uite simp(e, and there is Dust one route or each ru(e, andthe (ist o ru(es is simi(ar to a master routing ta$(e

Sysresccd-1etworkin-$1-Destination-port-

routin

From SystemRescueCd

Jump to: navigation, search

"0K

Page 141: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 141/174

Contents

[hide

• " #$out destination-port routing

• % E7amp(e o net'orking environment

• * 5vervie' o the routing

• 0 .arking the packets 'ith ipta$(es• 1 Routing the marked packets

o 1" Create ne' routing ta$(es

o 1% Ase the ne' ta$(es 'ith po(icy routing

• 2 =inu7 net'ork parameters

• M Source Net'ork-#ddress-3rans(ation 9SN#3

• 8 3rou$(eshooting

o 8" Check your ire'a((

o 8% =ogging packets 'ith ipta$(es

o 8* Ase a net'ork snier

o 80 Routing coniguration on Saturn

• L &etai(ed Dourney o a routed packet

• "K Comp(ete script that conigures the router

@bout destination-port routin

6n norma( cases, routing on 3C/;6/ is $ased on the destination 6/ address 3his artic(e ocuses onho' to make routing choices $ased on the destination port 6t can $e used to sp(it the traic

 $et'een severa( (inks 6ts very useu( on net'ork 'ith important (oads For instance you may 'ant

to route the SS traic using one #&S= (ink, and the 'e$ traic on another #&S= (ink 6t may

a(so prevent the interactive sessions rom $ecoming unresponsive 6 a(( the outgoing packets arerouted to a sing(e #&S= (ink 'ith no traic contro(, your ssh;te(net;vnc session may $ecome

unresponsive as soon as someone is do'n(oading a (arge i(e on your net'ork )ith this techniue

you can route a(( the interactive traic to a dedicated (ine in order to keep uick packettransmissions 'ith the server

Bou dont need anything specia( in order to get the advanced routing to 'ork 6t shou(d 'ork on a((

(avours o =inu7 that comes 'ith a %2 kerne( 9not sure i it 'orks 'ith (inu7-%0 #(( the eaturesthat 'e use are in the main(ine kerne(, so you dont need a speciic kerne( patch Bou must $e

careu( 'ith the net'orking options on(y i you compi(e your o'n kerne( Bou 'i(( a(so need the

iproute% package and the $asic net'orking too(s to $e insta((ed, $ut its the case 'i(( a(( the maDor

(inu7 distri$utions

$ample of networkin environment

3o e7p(ain ho' 'e do destination-port routing, 'e 'i(( use the o((o'ing net'ork environment:

• 3here are three machines in the net'ork: saturn, Dupiter, neptune

• Jupiter is the main router o this net'ork #(( the net'orking setup is done on that machine

"0"

Page 142: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 142/174

• 3here are t'o (inks $et'een Jupiter and Neptune 6n this e7amp(e 'e are Dust using simp(e

ethernet (inks or testing 3hese (inks cou(d $e e7terna( (inks 9#ds(, ca$(e, i 'e used

 pu$(ic 6/ addresses at their ends 3he routing setup on Jupiter 'ou(d $e the same

• Saturn and Neptune are (ocated at the ends o the net'ork )e 'ant Saturn to send packets

to Neptune using the t'o (inks

• 3he purpose o this artic(e is to make a(( the net'ork coniguration on Jupiter #(( the

routing decisions are made on these machines 6t 'i(( not $e necessary to make advanced

routing on either Saturn or Neptune

• )e 'ant one kind o packets to Neptune to $e sent through the irst (ink 9the ssh traic or

instance, so a(( the 3C/ packets 'ith dport@%%, and an other kind o packets to Neptune to

 $e sent through the second (ink 9(ets say the 'e$ traic, so a(( the 3C/ packets 'ith

dport@8K• )e 'ant the routing to $e symmetric 6t means that once a 3C/ connection is esta$(ished

 $et'een Saturn and Neptune, 'e 'ant a(( the packets that $e(ongs to that 3C/ stream to go

through the same (ink )e dont 'ant to use asymmetric routing 6n asymmetric routing the

 packets rom Saturn to Neptune cou(d use (ink", and the rep(ies to these packets cou(d $esent through the second (ink 6t cou(d 'ork i the Reverse /ath Fi(tering is turned o, $ut it

'ou(d means that the packets rom Neptune to Saturn do not respect the routing that the

administrator 'ants to have

• #(( the tests are made 'ith Saturn $eing the c(ient and Neptune acts as a server 6 mean a((

the 3C/ connections are esta$(ished $y Saturn

• 3o make this net'ork environment simp(er, 'e conigured a dummyK interace on Neptune

'ith "M%"2""KK 3he purpose is to sp(it the traic rom Saturn 9source address is"L%"28"1M* to Neptune 9destination address is "M%"2""KK and to spread it $et'een

the t'o (inks 6n the rea( (ie you 'i(( pro$a$(y have a (ot o machines $ehind Neptune 3he

dummyK interace a((o's us to have an 6/ address on Neptune that is not re(ated to the t'o(inks 6t gives the i((usion that "M%"2""KK is an address o a remote computer $ehind

 Neptune and $ehind the t'o (inks

"0%

Page 143: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 143/174

Overview of t"e routin

 No', (ets see ho' 'e can do destination port routing 3he o(d route and the recent iproute2 

too(s provide no option to se(ect the packets using the destination port +ut ip rule comes 'ith an

interesting option that uses the attri$utes o a packet to decide ho' to route it

)e 'i(( use the #wmark attri$ute to do that 3his attri$ute does not $e(ong to the 6/ header packet

3his attri$ute is on(y stored in the memory o the (oca( machine 'hich 'orks on the packet 6tmeans it 'i(( Dust $e dropped as soon as the packets (eaves the router #ny'ay its a(( 'e need

since this attri$ute can $e used $y $oth net#ilter and iproute2 3he irst thing to do it to use theadvanced packet matching options provided 'ith ipta$(es and neti(ter to mark the packets 5ncethe packet is marked 'e can use iproute% to make po(icy routing and use this attri$ute

5$vious(y the packet must have $een marked $y neti(ter $eore it reaches the routing code 3hats

'hy its important to remem$er 'hen neti(ter 'orks on the packets Neti(ter has ive hooks in the

kerne( net'ork stack 6t means there are ive p(aces 'here the neti(ter unctions can 'ork on the packets ere are 'hat kind o packets can $e seen $y each o the ive hooks:

• 5R$ROEA%1*: a(( the incoming packets 'hatever the destination address is

"0*

Page 144: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 144/174

Page 145: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 145/174

iptables -t man"le -$ 5?&?:';( -i et30 -p tcp -m tcp --dport 80 -I 4$?P--set-mark 2

ere is the comp(ete code that c(eans the ta$(e irst, and that do (ogging:

iptables -t man"le -<iptables -t man"le -Xiptables -t man"le - !:M<74$?Piptables -t man"le -$ !:M<74$?P -I !: --lo"-pre#ix Niptables-mark N --lo"-level in#oiptables -t man"le -$ !:M<74$?P -I 4$?P --set-mark iptables -t man"le - !:M<74$?P2iptables -t man"le -$ !:M<74$?P2 -I !: --lo"-pre#ix Niptables-mark2 N --lo"-level in#oiptables -t man"le -$ !:M<74$?P2 -I 4$?P --set-mark 2iptables -t man"le -$ 5?&?:';( -i et30 -p tcp -m tcp --dport 22 -I!:M<74$?Piptables -t man"le -$ 5?&?:';( -i et30 -p tcp -m tcp --dport 80 -I!:M<74$?P2

Routin t"e marked packets3o route the packets using the mark attri$ute, 'e have to use the ip rule command 6ts named

 po(icy routing )e have to create secondary routing ta$(es that 'i(( $e used 'hen the mark

attri$ute o a packet match a ru(e

Create new routin tables

First, 'e have to create these t'o routing ta$(es $y editing ;etc;iproute%;rtOta$(es ere is the code

that automatica((y creates t'o ta$(es ca((ed rtMlink and rtMlink2

i# cat /etc/iproute2/rtMtables A "rep -C NU2+Nt3en  ec3o N2+ rtMlinkN @@ /etc/iproute2/rtMtables#ii# cat /etc/iproute2/rtMtables A "rep -C NU2+2Nt3en  ec3o N2+2 rtMlink2N @@ /etc/iproute2/rtMtables#i

ere is the (ist o the routing ta$(es you shou(d have on Jupiter:

K -----------/etc/iproute2/rtMtables------------K reserved values

2++ local2+ main2+* de#ault0 unspecK custom routes2+2 rtMlink22+ rtMlink

 No' 'e must popu(ate these t'o routing ta$(es 3he $est thing to do is Dust to add one deau(t

route in each ta$(e Each deau(t route drive the packet to the ethernet card 'here the (ink to use is

"01

Page 146: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 146/174

connected 3hat 'ay, 'hen a packet 'ith dport@%% o((o's the deau(t route 'ritten in rtMlink,

it 'i(( $e sent to Neptune through device eth" )e a(so use ip route #lus3 to $e sure that the

ta$(e is empty

ip route #lus3 table rtMlinkip route add table rtMlink de#ault dev et3ip route #lus3 table rtMlink2

ip route add table rtMlink2 de#ault dev et32

Ese t"e new tables wit" policy routin

 No' 'e have to use the ip rule command to say 'hat to do 'ith the marked packets 3he

o((o'ing (ines say that the packets having the mark 'mark@" must o((o' the routing

instructions o the routing ta$(e named rtMlink, and the packets 'ith the second mark must use

rtMlink2 #t the end 'e (ush the routing cache to $e sure that the ne' ru(es are taken into

account

ip rule del #rom all #wmark 2 2@/dev/null

ip rule del #rom all #wmark 2@/dev/nullip rule add #wmark table rtMlinkip rule add #wmark 2 table rtMlink2ip route #lus3 cac3e

ere is the (ist o a(( ru(es ater these commands are e7ecuted:

K ip rule s3ow0 #rom all lookup local*26 #rom all #wmark 0x2 lookup rtMlink2*26+ #rom all #wmark 0x lookup rtMlink*266 #rom all lookup main*26 #rom all lookup de#ault

Hinu network parameters

3here are t'o net'ork parameters that have to $e checked i you 'ant your router to $ehaves ase7pected First 'e 'ant to $e sure that the kerne( running on Jupiter is conigured to route the

 packets 3o ena$(e routing on 6/v0 you must set ipOor'ard to " 9" means ena$(ed, K means

disa$(ed

ec3o @A /proc/sys/net/ipv/ipM#orward

Bou must a(so disa$(e Reverse /ath Fi(tering 6ts an option ena$(ed $y deau(t that increases the

security and prevent ip spooing $y checking that the source address o the incoming packetsmatch the routing ta$(e on the (oca( machine Since 'e are doing a comp(e7 setup, this option

'ou(d (ead to drop our packets, so it must $e disa$(ed

ec3o 0 @A /proc/sys/net/ipv/con#/all/rpM#ilter

3hese changes 'i(( $e (ost i you re$oot your server Bou can either ensure that is automatica((y

e7ecuted $y a script at $oot time, or you can edit your net'ork coniguration i(es to $e sure that

"02

Page 147: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 147/174

these changes 'i(( $e kept ater re$oot 5n 4entoo and Redhat you have to edit

/etc/sysctl.con#:

K /etc/sysctl.con#KK &nables packet #orwardin"net.ipv.ipM#orward = K )isable reverse pat3 #ilterin"net.ipv.con#.all.rpM#ilter = 0

Source 1etwork-@ddress-Aranslation =S1@A>

 No' the packets rom Saturn to Neptune shou(d $e routed as e7pected +ut there is sti(( one pro$(em to so(ve 3he rep(ies sent $y Neptune to Saturn 'i(( ignore the advanced routing and 'i((

a('ays $e sent through the same (ink, the one that match the route to "L%"28"1M* that is

conigured on Neptune )hen Neptune receives packets rom Saturn, the source address is

"L%"28"1M* Since there is no advanced routing conigured on Neptune, the packets to Saturn Dust o((o' the norma( route

3his is a case o asymmetric routing 3he packets rom Saturn to Neptune having dport@8K are

routed through the second (ink $ecause o the advanced routing on Jupiter #nd the rep(ies to these

 packets are sent through the irst (ink Dust $ecause its norma( routing 5ne so(ution to this pro$(em'ou(d $e to conigure the advanced routing on Neptune as 'e(( as Jupiter +ut 'e 'anted to keep

the coniguration as simp(e as possi$(e and 'e on(y 'ant to conigure advanced routing on

 Neptune

3he $est thing to do is to conigure SN#3 9Source Net'ork-#ddress-3rans(ation on Jupiter so

that a(( packets sent through (ink" or (ink% comes 'ith a re'ritten source address )e 'ant to

source address o the packets rom (ink" to $e "K*M"%1* and the source address o the packets

rom (ink% 'i(( $e "K*M%%1* 3hat 'ay Neptune 'i(( receive packets 'ith a source address thatmatch the (ink they come rom )hen Neptune rep(ies to the reuests coming rom (ink" or (ink% it

'i(( Dust use the source address seen in these packets as the ne' destination address

Bou can a(so notice that the SN#3 invo(ves an imp(icit &N#3 9&estination Net'ork-#ddress-

3rans(ation )hen Jupiter receives a packet on eth% 9the interace 'here the second (ink isconnected, it 'orks $ecause the destination address is "K*M%%1* 3his is a rep(y to a packet

rom Saturn 9"L%"28"1M*, so 'e 'ant Jupiter to change the destination address, and to or'ard

it to Saturn 3his is done $y the imp(icit &N#3

6ts important to notice that the Source address N#3 is e7ecuted in /5S3R5A36N4 3hat 'ay its

e7ecuted ater the routing, 'hich is the p(ace 'here 'e drive each packet to the right device 9eithereth" or eth% on Jupiter 3he SN#3 ipta$(e ru(e use the <outgoing device< match to determine 'hat

source address must $e 'ritten in the packet header

6n case you are using #&S= (inks $et'een Jupiter and Neptune, you 'i(( $e orced to use pu$(ic 6/

addresses outside o your (oca( net'ork .ost modems can do N#3 or you 6n that case you dont

have to 'orry a$out that

ere is the code to conigure SN#3 on Jupiter:

"0M

Page 148: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 148/174

Page 149: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 149/174

Even i L1] o the net'orking coniguration has to $e done on the router 9Jupiter dont orget toset a route to Neptune on Saturn 6t may $e necessary o Jupiter is not the deau(t gate'ay on

Saturn ere is 'hat to do on Saturn:

ip route add 6.6..00 via ,2.68.+.2+*

Detailed Lourney of a routed packet3o have a $etter understanding o ho' this advanced routing coniguration 'orks, (ets take an

e7amp(e o a net'orking packet sent rom Saturn to Neptune )e consider the user on Saturn'ants to connect to Neptune via ssh 6n our e7amp(e the ssh packets are supposed to $e routed

through the second (ink on Jupiter

• 5n Saturn, an user runs ss3 6.6..00 to connect to Neptune

• Saturn inds that the packets to 6.6..00 must $e routed via "L%"28"1M%1* so the

(ink (ayer on Saturn sends the packet to Jupiter 3his packet contains

ip.src=,2.68.+.*1 ip.dst=2.6..001 tcp.dport=22

5n Jupiter, the packet is irst processed in /RER5A36N4 3he instruction 'e added inman"le 'ith L-i et30 -p tcp -m tcp --dport 80 -I 4$?P --set-mark 2L is

e7ecuted and the mark=2 attri$ute is 'ritten in the packet inormation in the memory o

Jupiter

• 5n Jupiter the routing code inds that the packet is not sent to its (oca( address so the packet

is routed 6t o((o's the ru(es invo(ved in po(icy routing, and the packet hits the ru(e that

says Lpackets 3avin" t3e attribute mark=2 must #ollow use t3e routin"

table named rtMlink2L Since the deau(t route in this routing ta$(e is Lde#ault dev

et32L the packet is sent to the device named eth%

• 5n Jupiter, in /5S3R5A36N4, the packet matches L-i et30 -o et32L so L-I $;

--to-source 0.*.2.2+*L is e7ecuted 3he SN#3 code re'rites the source address in

the packet:o !$FOR$ S1@A: ipsrc@"L%"28"1M*, ipdst@"M%"2""KK, tcpdport@%%

o @FA$R S1@A: ipsrc@"K*M%%1*, ipdst@"M%"2""KK, tcpdport@%%

• 3he packet is sent rom Jupiter to Neptune 'ith ipsrc@"K*M%%1*, ipdst@"M%"2""KK,

tcpdport@%%

• 5n Neptune the packet is de(ivered to the (oca( ssh service $ecause the destination ip is

"M%"2""KK and it is a (oca( ip address 3he ssh server accepts the connection and rep(ies

'ith another packed 3he rep(y is sent to address that 'as the source address in the uery

 packet, so the ne' packet is sent to "K*M%%1* 3he rep(y packet is sent 'ith the o((o'ingattri$utes: ipsrc@"M%"2""KK, ipdst@"K*M%%1*, tcpsport@%%

• 5n Neptune, the routing code inds that "K*M%%1* $e(ongs to the su$net o eth% So 3he

 packet is sent to Jupiter through eth%• Jupiter receives the rep(y rom Neptune on eth% 3he packet hits the imp(icit &N#3 code

that is e7ecuted 'hen there is a SN#3 3he &estination N#3 rep(aces the destination

address in the rep(y packet 'ith the address that 'as in the header $eore its re'ritten $y

the SN#3 code:

o !$FOR$ D1@A: ipsrc@"M%"2""KK, ipdst@"K*M%%1*, tcpsport@%%

o @FA$R D1@A: ipsrc@"M%"2""KK, ipdst@"L%"28"1M*, tcpsport@%%

• 5n Jupiter the routing code kno's that the packet to "L%"28"1MK;%0 must $e de(ivered

through ethK

"0L

Page 150: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 150/174

• Jupiter sends the rep(y rom Neptune to Saturn through ethK 'ith ip.src=2.6..001ip.dst=,2.68.+.*1 tcp.sport=22 

• Saturn receives the rep(y rom Neptune and Saturn sends a ne' 3C/ packet,

Complete script t"at confiures t"e router

ere is the script to e7ecute on Jupiter to conigure the destination port routing:

K/bin/bas3

ec3o @A /proc/sys/net/ipv/ipM#orwardec3o 0 @A /proc/sys/net/ipv/con#/all/rpM#ilter

iptables -t man"le -<iptables -t man"le -Xiptables -t man"le -$ 5?&?:';( -i et30 -p tcp -m tcp --dport 22 -I 4$?P--set-mark iptables -t man"le -$ 5?&?:';( -i et30 -p tcp -m tcp --dport 80 -I 4$?P--set-mark 2

iptables -t nat -<iptables -t nat -Xiptables -t nat -$ 5:;?:';( -o et3 -I $; --to-source 0.*..2+*iptables -t nat -$ 5:;?:';( -o et32 -I $; --to-source 0.*.2.2+*

i# cat /etc/iproute2/rtMtables A "rep -C NU2+Nt3en  ec3o N2+ rtMlinkN @@ /etc/iproute2/rtMtables#ii# cat /etc/iproute2/rtMtables A "rep -C NU2+2Nt3en  ec3o N2+2 rtMlink2N @@ /etc/iproute2/rtMtables#i

ip route #lus3 table rtMlinkip route add table rtMlink de#ault dev et3ip route #lus3 table rtMlink2ip route add table rtMlink2 de#ault dev et32

ip rule del #rom all #wmark 2 2@/dev/nullip rule del #rom all #wmark 2@/dev/nullip rule add #wmark table rtMlinkip rule add #wmark 2 table rtMlink2ip route #lus3 cac3e

"1K

Page 151: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 151/174

Sysresccd-1etworkin-$1-%ptables-and-

netfilter-load-balancin-usin-connmark 

From SystemRescueCd

Jump to: navigation, search

Contents

[hide

• " #$out connmark (oad-$a(ancing

• % E7amp(e o net'orking environment

• * Reuirements

• 0 o' this (oad $a(ancing 'orks

• 1 5vervie' o the (oad $a(ancing

• 2 .arking the packets 'ith connmarko 2" #$out the neti(ter ta$(es

o 2% 3he connection states

o 2* 3he statistic match

o 20 3he connmark target

o 21 6nitia(iHation o a ne' connection

o 22 /ackets o an e7isting connection

o 2M 3he 'ho(e ipta$(es marking code

• M Routing the marked packets

o M" Create ne' routing ta$(es

o M% Ase the ne' ta$(es 'ith po(icy routing

• 8 =inu7 net'ork parameters

• L Source Net'ork-#ddress-3rans(ation 9SN#3

• "K 3rou$(eshooting

o "K" Check your ire'a((

o "K% =ist the current connections detai(s

o "K* =ogging packets 'ith ipta$(es

o "K0 =ogging packets 'ith ipta$(es

o "K1 Ase a net'ork snier

o "K2 Routing coniguration on Saturn

"" Comp(ete code o the (oad-$a(ancing script

@bout connmark load-balancin

3his artic(e e7p(ains ho' to make (oad $a(ancing on a router on =inu7-%2 using neti(ter and

ipta$(es 'ith the connmark modu(e 3he purpose is to sho' ho' 'e can use severa( internet

connections to provide a aster internet access to a(( the machines o a (oca( net'ork )e 'ant a((the outgoing connections to $e spread across a(( the avai(a$(e (inks #(( the routing has to $e made

on a sing(e router machine, there is no need to change the coniguration on the machines o the

"1"

Page 152: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 152/174

(oca( net'ork 6t shou(d 'ork on a(( (avours o =inu7 that comes 'ith a recent (inu7-%2 kerne(Bou 'i(( a(so need the iproute% package and the $asic net'orking too(s to $e insta((ed, $ut its the

case 'i(( a(( the maDor (inu7 distri$utions

$ample of networkin environment

3o e7p(ain ho' 'e do (oad-$a(ancing using the connmark modu(e, 'e 'i(( use the o((o'ingnet'ork environment:

• 3here is (oca( net'ork 9"L%"28"1MK;%0 made o our desktop machines running various

operating systems such as )indo's and =inu7 3hese machines are names Saturn,

&esktop%, &esktop* #(( the e7amp(es 'i(( $e $ased on Saturn, and the other desktops 'i(( $ehave the same 'ay #(( these machines are using Jupiter 9"L%"28"1M%1* as the deau(t

gate'ay 3here is no advanced routing 'ork to do on these desktops

• 3he router o the net'ork is Jupiter 6t has three ethernet interaces 3he irst one is ethK

9"L%"28"1M%1*, and its connected to the (oca( net'ork 3he other interaces are eth"

9"K*M"%1* and eth% 9"K*M%%1* 3hey are connected to t'o ethernet modems

connected to t'o ads( (inks #(( the interesting ire'a((ing and routing is done on Jupiter• Some'here e(se there is a server named Neptune connected to internet 3here is no direct

(ink $et'een the (oca( net'ork and Neptune Neptune Dust acts as a norma( server 'ith no

speciic routing coniguration 6t is Dust used as a mere remote server in this artic(e For

instance, it can $e a 'e$ server running #pache, responding to reuests made on porttcp;8K 6t 'i(( a(so 'ork 'ith any other service (istening on any port

• 3he purpose o this artic(e is to sho' ho' 'e can $a(ance the connections on Jupiter to use

the 'ho(e avai(a$(e $and'idth provided $y the t'o ads( (inks #(( the connections are

initiated $y the desktops connected to the (oca( net'ork, and a(( connections are made to Neptune 5 course, it 'ou(d 'ork on any remote server, $ut 'e Dust need one machine to

act as the remote server or the tests

• 6n the diagram, 'e are using interna( 6/ addresses 9"L%"28"1Ma, "K*M$c, "M%"2"d6n a rea( environment a(( the interaces connected to internet 'i(( pro$a$(y $e a pu$(ic 6/address 6t can a(so $e private addresses in case the modems are 'orking in N#3 mode 6n

that case each modem has t'o 6/ addresses: the private interna( address on the ethernet

interace, and the pu$(ic 6/ address on the )#N interace

• 3his artic(e e7p(ains ho' to make (oad-$a(ancing $et'een t'o (inks, $ut o$vious(y you can

do the same thing 'ith as many (inks as you 'ant

• 3he tests have $een made on a router running gentoo (inu7 'ith a %2%0 kerne( and

ipta$(es-"0K

"1%

Page 153: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 153/174

Re0uirements

Bou 'i(( need a recent (inu7-%2 kerne( and a recent ipta$(es version since 'e are using advanced

neti(ter modu(es that have $een introduced or changed in recent (inu7-%2 versions ere are the

eatures 'e 'i(( need:

the neti(ter C5NN.#R target modu(e is used to mark the packets that $e(ongs to aconnection 6t has $een introduced in (inu7-%2"%

• the neti(ter statistic match modu(e is used to decide 'hich (ink to use 3his eature has

 $een merged in (inu7-%2"8 Fortunate(y RE=1 9Redhat Enterprise =inu7 1 is $ased on(inu7-%2"8 so this eature is avai(a$(e in RE=1

• you a(so need an ipta$(es versions that supports the statistic match 6t is avai(a$(e in

ipta$(es-"0K, and pro$a$(y in o(der versions as 'e(( 3o kno' i your ipta$(es supports it,you can either have a (ook at man iptables or check that there is a i(e named

libxtMstatistic.so in /lib/iptables or /lib6/iptables on your system

"1*

Page 154: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 154/174

• it seems the o(d ipta$(es versions supports the same eature in a modu(e named

libxtMnt3.so 3he nt3 and random matches have $een merged in recent ipta$(es into a

modu(e named statistic

.ow t"is load balancin works

 Neti(ter is a stateu( ire'a(( 6t means it is a$(e to kno' 'hich connection an 6/ packet $e(ongsto 3he connections are managed $y the connection tracking modu(e 9connmark 6ts important

that 'e respect the connections 'hen routing the packets #(( the 6/ packets o one connection

must $e routed through the same (ink 6 'e route the packets o one connection through t'odierent (inks, it 'ou(d $reak the connection 3his is 'hy neti(ter has a state sta$(e in memory 6t

uses it to remem$er 'hat is the state o a connection, and that 'ay i can identiy a(( the packets

that $e(ongs to that connection

Everytime a ne' connection is created 'e 'i(( choose 'hich (ink to use 6n that e7amp(e t'o (inkscan $e used to route the packets on Jupiter So 'e 'i(( have to choose $et'een (ink" and (ink%

5nce the choice is made, 'e route the packets to either ethK 9interace connected to the (ink" or

eth" 9interace connected to the (ink% 5nce the routing decision has $een taken on the irst 6/ packet o the connection, 'e 'i(( have to 'rite 'hat the decision is in the ire'a(( state ta$(e so

that 'e can do the same routing on the ne7t packets o this connection

)e must notice that the neti(ter connection tracking system is a$(e to 'ork on A&/ packets 3he

A&/ transport is oten said to $e <non connected mode< $ecause there is no seuence num$er inthe packets +ut the connection tracking considers that A&/ packets 'ith the same

source;destination 6/-addresses;ports are part o a connection So the (oad $a(ancing 'i(( $e a$(e to

'ork on A&/ traic as 'e(( as 3C/

3he (oad $a(ancing 'orks at the connection (eve( 3he routing decision 9'hich (ink to use is taken

regard(ess o 'hat the 6/ addresses or 'hat the ports are 6t means it 'i(( not take the source 6/ ;destination 6/ ; source port ; destination port into account, so the (oad $a(ancing is done or a(( the

c(ient computers the same 'ay, and it 'orks or a(( the services 6ts important $ecause it meansthat the (oad $a(ancing 'i(( $e eicient even 'hen on(y one desktop o the (oca( net'ork is using

the net'ork Jupiter 'i(( Dust spread a(( the incoming connections rom the (oca( net'ork 9ethK to

the avai(a$(e (inks 9eth" and eth%, 'hoever the users are

Anortunate(y, the (oad $a(ancer 'i(( not $e a$(e to eicient(y spread the incoming packets in casethere is a sing(e connection that reuires a (ot o $and'idth 6ts Dust not possi$(e to do that,

 $ecause routing the packets o one connection to more than one (ink 'ou(d $reak the tcp

connection 3he receiver 'ou(d sees 6/ packets 'ith dierent source 6/ addresses, and it 'ou(d

drop the packets

Overview of t"e load balancin

 No', (ets see ho' 'e can do routing to $a(ance the packets 3he o(d route and the recent

iproute2 too(s a(( 'ork at the 6/ (eve( 3he pro$(em is the connections depend on the source and

destination ports, 'hich are decided at the transport (eve( 93C/ and A&/

"10

Page 155: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 155/174

3o so(ve that pro$(em, 'e 'i(( use the neti(ter connection tracking 9conntrack and connectionmarking 9connmark modu(es 3hey 'i(( identiy 'hich 6/ packets $e(ongs to 'hich tcp;udp

connection, and these modu(es 'i(( $e used to put a mark on these packets 3his mark is the

#wmark attri$ute 6n this artic(e 'e may reer to this attri$ute using either #wmark or Dust mark

eep in mind that this is the same attri$ute 3his attri$ute is not part o the 6/ header, its Dust in the

router memory 6n the second stage o the (oad $a(ancing, the routing 'i(( use this mark to kno' to

'hich ethernet device the packet must $e routed iproute2 is the package that 'e 'i(( use to make

advanced routing 3he ip rule command is used to make po(icy routing, and its a$(e make 6/

routing $ased on the #wmark attri$ute

5$vious(y the packet must have $een marked $y neti(ter $eore it reaches the routing code 3hats'hy its important to remem$er 'hen neti(ter 'orks on the packets Neti(ter has ive hooks in the

kerne( net'ork stack 6t means there are ive p(aces 'here the neti(ter unctions can 'ork on the

 packets ere are 'hat kind o packets can $e seen $y each o the ive hooks:

• 5R$ROEA%1*: a(( the incoming packets 'hatever the destination address is

• 5OSAROEA%1*: a(( the outgoing packets 'hatever the source address is

• FORW@RD: a(( the packets that are routed

• %15EA: a(( the packets that are sent to the (oca( machine

• OEA5EA: a(( the packets sent $y the (oca( machine

So i 'e mark the packets at /5S3R5A36N4, the routing code 'i(( not see the mark and the

advanced routing 'i(( have no eect 3hats 'hy 'e must 'ork in the /RER5A36N4 hook orincoming routed packets, and in the 5A3/A3 hook i 'e 'ant to route the packets sent $y the

router itse(

"11

Page 156: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 156/174

#arkin t"e packets wit" connmark 

@bout t"e netfilter tables

 Neti(ter and ipta$(es 'ork 'ith three ta$(es:

• filter: the most popu(ar ta$(e, its most(y used or ire'a((ing, to accept or reDect packets• nat: its used or Net'ork #ddress 3rans(ation

• manle: its most(y used to modiy net'ork packets

)e 'i(( 'ork 'ith the mang(e ta$(e since 'e 'ant to change an attri$ute o a packet 9the 'mark

A"e connection states

# neti(ter match is a modu(e that inspects a packets any that says 'hether or not it matches a

criteria neti(ter e7ecutes an action associated 'ith a match on(y 'hen the match returns true 3his

is ho' the connection tracking modu(e gives access to the state o the connection 3his is done via

-m state ere are the various states:

• 1$W: the packet is initiating a ne' connection 9it may $e a SBN packet in 3C/

• $SA@!H%S.$D: the packet is associated 'ith a connection 'hich has seen packets in

 $oth directions

• R$H@A$D: the packet is starting a ne' connection 'hich is associated 'ith an e7isting

connection 9it may $e a data connection i F3/

• %1?@H%D: the packet is not associated 'ith a va(id connection

3hese states are important since 'e must take a routing decision or ne' packets on(y, and keepthe current decision or packet that are part o an e7isting connection

A"e statistic matc"

3he statistic neti(ter modu(e provide t'o modes: nt3 and random:

• nt": this mode a((o's you kno' kno' 'hat is the inde7 o the packet in the (ist o received

 packets 6n other 'ords, you kno' i its the irst, the second, the third, the ourth, Bou

can use the option named every to reset the counter 'hen it reaches a va(ue 3hat 'ay the

inde7es associated 'ith the packets can $e something (ike: 1 21 *1 1 21 *1 1 21 *1

... 'hen every is *

random: this mode a((o's you to se(ect random packets Bou can provide a pro$a$i(itysuch as K** i you 'ant to gra$ **] o the packets

6n o(d (inu7;ipta$(es versions, these t'o modes 'ere imp(emented in t'o dierent modu(es So

you may need to change the ipta$(es instructions i you are using a (inu7 kerne( prior to %2"8

A"e connmark taret

#n ipi(ter target is a modu(e that runs an action )e 'i(( need $oth the .#R target to put a

mark on a packet, and C5NN.#R to manage the neti(ter state ta$(e:

"12

Page 157: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 157/174

• -I 4$?P --set-mark: this action is used to 'rite the 'mark on an 6/ packet 3he va(ue

o the mark is given as a parameter o this action

• -I 9:4$?P --save-mark: this action is used 'rite the 'mark o a packet in the state

ta$(e 9rom packet to state ta$(e• -I 9:4$?P --restore-mark: this action is used to 'rite 'mark o the state ta$(e in the

ip packet 9rom state ta$(e to packet

%nitialiation of a new connection

)e 'ant to set the 'mark attri$ute on a packet everytime 'e receive a packet that initiates a ne'

connection 3o do that 'e 'i(( use the -m state --state &7 match and the associated actions

'i(( $e to set the mark in the 6/ packet and to save the mark in the state sta$(e so that 'e can reuse

it (ater or other packet o this connection

3he C5NN.#R target provides an option named --set-mark X that is supposed to set the

'mark on a packet 6t did not 'ork during the tests, the mark 'as sti(( K 3hats 'hy 'e 'i(( usethe o((o'ing target instead: -I 4$?P --set-mark

• First, 'e use this match to se(ect the packets that initiates a ne' connection: -m state

--state &7 ere is an e7amp(e o 'hat the conntrack modu(e can do 'hen it e7ecutes

a match such as -m state --state &7:

o the conntrack code sees that the current tcp packet is rom "L%"28"1M*:01%*8 to

"M%"2""KK:8K

o the modu(e inds no e7isting tcp connection rom "L%"28"1M*:01%*8 to

"M%"2""KK:8K in the neti(ter state ta$(e, so it considers the state as NE), it

creates a ne' entry in the state ta$(e and it returns true

o neti(ter sees that the match returned true, so the action associated 'ith the match

'i(( $e e7ecuted

• 5nce a packet has $een se(ected $y the previous match, 'e 'ant to use the .#R target to

set the 'mark attri$ute in the packet, and 'e a(so 'ant to use the C5NN.#R target tosave the 'mark that is associated 'ith the ne' connection )e create t'o ne' chains

named C5NN.#R" and C5NN.#R% 9one or each (ink since there are t'o targets

associated 'ith one match ere is an e7amp(e o 'hat the connmark target can do 'hen ite7ecutes a ru(e such as -I 9:4$?P --save-mark:

o the connmark modu(e sees that the current tcp packet is rom "L%"28"1M*:01%*8

to "M%"2""KK:8K

o the modu(e inds the state ta$(e entry that has Dust $een created or the ne'

connection rom "L%"28"1M*:01%*8 to "M%"2""KK:8K

o it saves the 'mark attri$ute seen in the packet to the copy o this attri$ute in thestate ta$(e entry

ere are the ipta$(es instructions 'e use to mark the ne' packets:

K initialise two c3ains t3at will put t3e mark on t3e packet and keep it inmemoryiptables -t man"le - 9:4$?Piptables -t man"le -$ 9:4$?P -I 4$?P --set-mark iptables -t man"le -$ 9:4$?P -I 9:4$?P --save-mark

"1M

Page 158: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 158/174

Page 159: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 159/174

K initialise two c3ains t3at will put t3e mark on t3e packet and keep it inmemoryiptables -t man"le - 9:4$?Piptables -t man"le -$ 9:4$?P -I 4$?P --set-mark iptables -t man"le -$ 9:4$?P -I 9:4$?P --save-mark

iptables -t man"le - 9:4$?P2iptables -t man"le -$ 9:4$?P2 -I 4$?P --set-mark 2

iptables -t man"le -$ 9:4$?P2 -I 9:4$?P --save-mark

K "et t3e mark on packet t3at belon"s to an existin" connectioniptables -t man"le -$ 5?&?:';( -i et30 -p tcp Z  -m state --state &;$%!(O&)1?&!$;&) -I 9:4$?P --restore-mark

K i# t3e mark is zero i# means t3e packet does not belon"s to any existin"connectioniptables -t man"le -$ 5?&?:';( -p tcp -m state --state &7 Z  -m statistic --mode nt3 --every 2 --packet 0 -I 9:4$?Piptables -t man"le -$ 5?&?:';( -p tcp -m state --state &7 Z  -m statistic --mode nt3 --every 2 --packet -I 9:4$?P2

Routin t"e marked packets

3o route the packets using the mark attri$ute, 'e have to use the ip rule command 6ts named

 po(icy routing )e have to create secondary routing ta$(es that 'i(( $e used 'hen the mark

attri$ute o a packet match a ru(e

Create new routin tables

First, 'e have to create these t'o routing ta$(es $y editing ;etc;iproute%;rtOta$(es ere is the code

that automatica((y creates t'o ta$(es ca((ed rtMlink and rtMlink2

i# cat /etc/iproute2/rtMtables A "rep -C NU2+Nt3en  ec3o N2+ rtMlinkN @@ /etc/iproute2/rtMtables#ii# cat /etc/iproute2/rtMtables A "rep -C NU2+2Nt3en  ec3o N2+2 rtMlink2N @@ /etc/iproute2/rtMtables#i

ere is the (ist o the routing ta$(es you shou(d have on Jupiter:

K -----------/etc/iproute2/rtMtables------------

K reserved values2++ local2+ main2+* de#ault0 unspecK custom routes2+2 rtMlink22+ rtMlink

 No' 'e must popu(ate these t'o routing ta$(es 3he $est thing to do is Dust to add one deau(t

route in each ta$(e Each deau(t route drive the packet to the ethernet card 'here the (ink to use is

"1L

Page 160: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 160/174

connected 3hat 'ay, 'hen a packet marked 'ith 'mark@" o((o's the deau(t route 'ritten in

rtMlink, it 'i(( $e sent to Neptune through device eth" )e a(so use ip route #lus3 to $e sure

that the ta$(e is empty

ip route #lus3 table rtMlinkip route add table rtMlink de#ault dev et3ip route #lus3 table rtMlink2

ip route add table rtMlink2 de#ault dev et32

Ese t"e new tables wit" policy routin

 No' 'e have to use the ip rule command to say 'hat to do 'ith the marked packets 3he

o((o'ing (ines say that the packets having the mark 'mark@" must o((o' the routinginstructions o the routing ta$(e named rtMlink, and the packets 'ith the second mark must use

rtMlink2 #t the end 'e (ush the routing cache to $e sure that the ne' ru(es are taken into

account

ip rule del #rom all #wmark 2 2@/dev/nullip rule del #rom all #wmark 2@/dev/nullip rule add #wmark table rtMlinkip rule add #wmark 2 table rtMlink2ip route #lus3 cac3e

ere is the (ist o a(( ru(es ater these commands are e7ecuted:

K ip rule s3ow0 #rom all lookup local*26 #rom all #wmark 0x2 lookup rtMlink2*26+ #rom all #wmark 0x lookup rtMlink*266 #rom all lookup main*26 #rom all lookup de#ault

Hinu network parameters

3here are t'o net'ork parameters that have to $e checked i you 'ant your router to $ehaves ase7pected First 'e 'ant to $e sure that the kerne( running on Jupiter is conigured to route the

 packets 3o ena$(e routing on 6/v0 you must set ipOor'ard to " 9" means ena$(ed, K means

disa$(ed

ec3o @A /proc/sys/net/ipv/ipM#orward

Bou must a(so disa$(e Reverse /ath Fi(tering 6ts an option ena$(ed $y deau(t that increases the

security and prevent ip spooing $y checking that the source address o the incoming packetsmatch the routing ta$(e on the (oca( machine Since 'e are doing a comp(e7 setup, this option

'ou(d (ead to drop our packets, so it must $e disa$(ed

ec3o 0 @A /proc/sys/net/ipv/con#/all/rpM#ilter

3hese changes 'i(( $e (ost i you re$oot your server Bou can either ensure that is automatica((y

e7ecuted $y a script at $oot time, or you can edit your net'ork coniguration i(es to $e sure that

"2K

Page 161: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 161/174

Page 162: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 162/174

Aroubles"ootin

ere is 'hat you can do in case it does not 'ork:

C"eck your firewall

6n this artic(e 'e considered the packet i(tering is not ena$(ed on your router and on your net'ork6n case you are using ipta$(es a(ready, you 'i(( have to check that its consistent 'ith the ne'

ipta$(es ru(es invo(ved in the destination port routing 6t does not means that you have to keep your

ire'a(( 'ide open to get the (oad $a(ancing to 'ork, it Dust means that the i(tering may distur$ the(oad $a(ancing in case its not correct(y conigured

Hist t"e current connections details

3he connection tracking modu(e e7ports very useu( inormation a$out the connections state ta$(e

Bou can read the i(e /proc/net/ipMconntrack that contains a(( important attri$utes a$out the

current connections, inc(uding the 'mark attri$ute:

D cat /proc/net/ipMconntracktcp 6 ,6 ;(4&M7$(; src=,2.68.+.* dst=2.6..00 sport=+20*

dport=80 packets=6 bytes= src=2.6..00 dst=0.*..2+*sport=80 dport=+20* packets= bytes=,*8 G$'?&)H mark= use=

tcp 6 ,6 ;(4&M7$(; src=,2.68.+.* dst=2.6..00 sport=+20*+dport=80 packets=6 bytes= src=2.6..00 dst=0.*..2+*

  sport=80 dport=+20*+ packets= bytes=,*8 G$'?&)H mark= use=tcp 6 ,6 ;(4&M7$(; src=,2.68.+.* dst=2.6..00 sport=+20*, dport=80  packets=6 bytes= src=2.6..00 dst=0.*..2+* sport=80  dport=+20*, packets= bytes=,*8 G$'?&)H mark= use=tcp 6 ,6 ;(4&M7$(; src=,2.68.+.* dst=2.6..00 sport=+20*6  dport=80 packets=6 bytes= src=2.6..00 dst=0.*.2.2+*

  sport=80 dport=+20*6 packets= bytes=,*8 G$'?&)H mark=2 use=tcp 6 ,6 ;(4&M7$(; src=,2.68.+.* dst=2.6..00 sport=+20*8  dport=80 packets=6 bytes= src=2.6..00 dst=0.*.2.2+*  sport=80 dport=+20*8 packets= bytes=,*8 G$'?&)H mark=2 use=

Hoin packets wit" iptables

6n case you have pro$(ems, you may 'ant to ena$(e the (ogging so that you can see a(( the packets

that goes through a speciic neti(ter instruction 3o ena$(e (ogging, you can rep(ace a simp(e

ipta$(es action 9such as C5NN.#R 'ith a customiHed chain 9such as =54OF).#REverytime a packet is marked you 'i(( a(so have a messages 'ritten in your (ogs For instance, you

can rep(ace this simp(e ipta$(es command:

iptables -t man"le -$ 5?&?:';( -i et30 -p tcp Z  -m state --state &;$%!(O&)1?&!$;&) -I 9:4$?P --restore-mark

)ith the o((o'ing chain:

K create a new c3ain to bot3 restore t3e mark and lo" t3e packetiptables -t man"le - ?&;:?&4$?Piptables -t man"le -$ ?&;:?&4$?P -I 9:4$?P --restore-mark

"2%

Page 163: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 163/174

iptables -t man"le -$ ?&;:?&4$?P -I !: --lo"-pre#ix Nrestore-mark N --lo"-level in#o

K restore t3e #wmark to packet t3at belon"s to an existin" connectioniptables -t man"le -$ 5?&?:';( -i et30 -p tcp Z  -m state --state &;$%!(O&)1?&!$;&) -I ?&;:?&4$?P

6ts important that you e7ecutes -I 9:4$?P --restore-mark $eore -I !: --lo"-pre#ix

Nrestore-mark N $ecause you 'ant to have the detai(s o the packet attri$utes 'hen it has

a(ready $een changed Anortunate(y the deau(t !: match does not disp(ay the 'mark attri$ute

So it may $e diicu(t to kno' 'hether or not the mark in the packet is 'hat you e7pect )hat you

can do is you can edit the source code o the !: target in the kerne( sources, $ut it means you

have to recompi(e it ere is 'hat to change:

root>Iupiter /usr/src/linux-2.6.2.0 D di## -u net/ipv/net#ilter/iptM!:.000net/ipv/net#ilter/iptM!:.new--- net/ipv/net#ilter/iptM!:.old 2008-0+-* ,0*8.000000000 ]000]]] net/ipv/net#ilter/iptM!:.new 2008-06-0 62,2+.000000000 ]000>> -+616 ]+618 >>  printkEL?9=Du.Du.Du.Du );=Du.Du.Du.Du L1

  (5'$)Ei3-@saddrF1 (5'$)Ei3-@daddrFFR

] printkEL<74$?P=Du L1 Eunsi"ned intFskb-@markFR]  /B 4ax len"t3 6 L!&=6++*+ ;:=0x<< 5?&9=0x<< ;;!=2++ ()=6++*+ L B/  printkEL!&=Du ;:=0xD02X 5?&9=0xD02X ;;!=Du ()=Du L1  nto3sEi3-@totMlenF1 i3-@tos ^ (5;:M;:M4$P1

Bou can a(so disa$(e (ogging o attri$utes that you consider use(ess since the messages are very

detai(ed and hard to read ere is 'hat you can get 'ith the patched =54 target:

iptables-mark (=et30 :';= ?9=,2.68.+.* );=2.6..00 <74$?P=

()=+*00 5;=26 )5;=80restore-mark (=et30 :';= ?9=,2.68.+.* );=2.6..00 <74$?P= ()=+*05;=26 )5;=80restore-mark (=et30 :';= ?9=,2.68.+.* );=2.6..00 <74$?P= ()=+*025;=26 )5;=80restore-mark (=et30 :';= ?9=,2.68.+.* );=2.6..00 <74$?P= ()=+*0*5;=26 )5;=80restore-mark (=et30 :';= ?9=,2.68.+.* );=2.6..00 <74$?P= ()=+*05;=26 )5;=80restore-mark (=et30 :';= ?9=,2.68.+.* );=2.6..00 <74$?P= ()=+*0+5;=26 )5;=80

Hoin packets wit" iptables

6n case you have pro$(ems, you may 'ant to ena$(e the (ogging so that you can see a(( the packets

that goes through a speciic neti(ter instruction 3o ena$(e (ogging, you can rep(ace a simp(e

ipta$(es action 9such as C5NN.#R 'ith a customiHed chain 9such as =54OF).#REverytime a packet is marked you 'i(( a(so have a messages 'ritten in your (ogs For instance, you

can rep(ace this simp(e ipta$(es command:

iptables -t man"le -$ 5?&?:';( -i et30 -p tcp Z  -m state --state &;$%!(O&)1?&!$;&) -I 9:4$?P --restore-mark

"2*

Page 164: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 164/174

)ith the o((o'ing chain:

K create a new c3ain to bot3 restore t3e mark and lo" t3e packetiptables -t man"le - ?&;:?&4$?Piptables -t man"le -$ ?&;:?&4$?P -I 9:4$?P --restore-markiptables -t man"le -$ ?&;:?&4$?P -I !: --lo"-pre#ix Nrestore-mark N --lo"-level in#o

K restore t3e #wmark to packet t3at belon"s to an existin" connectioniptables -t man"le -$ 5?&?:';( -i et30 -p tcp Z  -m state --state &;$%!(O&)1?&!$;&) -I ?&;:?&4$?P

6ts important that you e7ecutes -I 9:4$?P --restore-mark $eore -I !: --lo"-pre#ix

Nrestore-mark N $ecause you 'ant to have the detai(s o the packet attri$utes 'hen it has

a(ready $een changed Anortunate(y the deau(t !: match does not disp(ay the 'mark attri$ute

So it may $e diicu(t to kno' 'hether or not the mark in the packet is 'hat you e7pect )hat you

can do is you can edit the source code o the !: target in the kerne( sources, $ut it means you

have to recompi(e it ere is 'hat to change:

root>Iupiter /usr/src/linux-2.6.2.0 D di## -u net/ipv/net#ilter/iptM!:.000net/ipv/net#ilter/iptM!:.new--- net/ipv/net#ilter/iptM!:.old 2008-0+-* ,0*8.000000000 ]000]]] net/ipv/net#ilter/iptM!:.new 2008-06-0 62,2+.000000000 ]000>> -+616 ]+618 >>  printkEL?9=Du.Du.Du.Du );=Du.Du.Du.Du L1  (5'$)Ei3-@saddrF1 (5'$)Ei3-@daddrFFR

] printkEL<74$?P=Du L1 Eunsi"ned intFskb-@markFR]  /B 4ax len"t3 6 L!&=6++*+ ;:=0x<< 5?&9=0x<< ;;!=2++ ()=6++*+ L B/  printkEL!&=Du ;:=0xD02X 5?&9=0xD02X ;;!=Du ()=Du L1  nto3sEi3-@totMlenF1 i3-@tos ^ (5;:M;:M4$P1

Bou can a(so disa$(e (ogging o attri$utes that you consider use(ess since the messages are very

detai(ed and hard to read ere is 'hat you can get 'ith the patched =54 target:

iptables-mark (=et30 :';= ?9=,2.68.+.* );=2.6..00 <74$?P=()=+*00 5;=26 )5;=80restore-mark (=et30 :';= ?9=,2.68.+.* );=2.6..00 <74$?P= ()=+*05;=26 )5;=80restore-mark (=et30 :';= ?9=,2.68.+.* );=2.6..00 <74$?P= ()=+*025;=26 )5;=80restore-mark (=et30 :';= ?9=,2.68.+.* );=2.6..00 <74$?P= ()=+*0*5;=26 )5;=80restore-mark (=et30 :';= ?9=,2.68.+.* );=2.6..00 <74$?P= ()=+*0

5;=26 )5;=80restore-mark (=et30 :';= ?9=,2.68.+.* );=2.6..00 <74$?P= ()=+*0+5;=26 )5;=80

Ese a network sniffer

Bou can use a snier such as tcpdump 9conso(e or 'ireshark 9graphica( mode to check 'hat

 packets are transmitted and 'ith 'hich attri$utes

Routin confiuration on Saturn

"20

Page 165: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 165/174

Even i L1] o the net'orking coniguration has to $e done on the router 9Jupiter dont orget toset a route to Neptune on Saturn 6t may $e necessary o Jupiter is not the deau(t gate'ay on

Saturn ere is 'hat to do on Saturn:

ip route add 6.6..00 via ,2.68.+.2+*

Complete code of t"e load-balancin scriptK/bin/bas3

ec3o @A /proc/sys/net/ipv/ipM#orwardec3o 0 @A /proc/sys/net/ipv/con#/all/rpM#ilter

K #lus3 all iptables entriesiptables -t #ilter -<iptables -t #ilter -Xiptables -t nat -<iptables -t nat -Xiptables -t man"le -<iptables -t man"le -Xiptables -t #ilter -5 (5'; $99&5;iptables -t #ilter -5 :';5'; $99&5;iptables -t #ilter -5 <:?7$?) $99&5;

K initialise c3ains t3at will do t3e work and lo" t3e packetsiptables -t man"le - 9:4$?Piptables -t man"le -$ 9:4$?P -I 4$?P --set-mark iptables -t man"le -$ 9:4$?P -I 9:4$?P --save-markiptables -t man"le -$ 9:4$?P -I !: --lo"-pre#ix Niptables-mark N --lo"-level in#o

iptables -t man"le - 9:4$?P2iptables -t man"le -$ 9:4$?P2 -I 4$?P --set-mark 2

iptables -t man"le -$ 9:4$?P2 -I 9:4$?P --save-markiptables -t man"le -$ 9:4$?P2 -I !: --lo"-pre#ix Niptables-mark2 N --lo"-level in#o

iptables -t man"le - ?&;:?&4$?Piptables -t man"le -$ ?&;:?&4$?P -I 9:4$?P --restore-markiptables -t man"le -$ ?&;:?&4$?P -I !: --lo"-pre#ix Nrestore-mark N --lo"-level in#o

iptables -t nat - $;iptables -t nat -$ $; -I !: --lo"-pre#ix Nsnat-to-0.*..2+* N --lo"-level in#oiptables -t nat -$ $; -I $; --to-source 0.*..2+*

iptables -t nat - $;2iptables -t nat -$ $;2 -I !: --lo"-pre#ix Nsnat-to-0.*.2.2+* N --lo"-level in#oiptables -t nat -$ $;2 -I $; --to-source 0.*.2.2+*

K restore t3e #wmark on packets t3at belon" to an existin" connectioniptables -t man"le -$ 5?&?:';( -i et30 -p tcp Z  -m state --state &;$%!(O&)1?&!$;&) -I ?&;:?&4$?P

K i# t3e mark is zero i# means t3e packet does not belon"s to an existin"connection

"21

Page 166: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 166/174

iptables -t man"le -$ 5?&?:';( -p tcp -m state --state &7 Z  -m statistic --mode nt3 --every 2 --packet 0 -I 9:4$?Piptables -t man"le -$ 5?&?:';( -p tcp -m state --state &7 Z  -m statistic --mode nt3 --every 2 --packet -I 9:4$?P2

iptables -t nat -$ 5:;?:';( -o et3 -I $;iptables -t nat -$ 5:;?:';( -o et32 -I $;2

i# cat /etc/iproute2/rtMtables A "rep -C NU2+Nt3en

ec3o N2+ rtMlinkN @@ /etc/iproute2/rtMtables#ii# cat /etc/iproute2/rtMtables A "rep -C NU2+2Nt3en

ec3o N2+2 rtMlink2N @@ /etc/iproute2/rtMtables#i

ip route #lus3 table rtMlink 2@/dev/nullip route add table rtMlink de#ault dev et3ip route #lus3 table rtMlink2 2@/dev/nullip route add table rtMlink2 de#ault dev et32

ip rule del #rom all #wmark 0x lookup rtMlink 2@/dev/nullip rule del #rom all #wmark 0x2 lookup rtMlink2 2@/dev/nullip rule del #rom all #wmark 0x2 2@/dev/nullip rule del #rom all #wmark 0x 2@/dev/nullip rule add #wmark table rtMlinkip rule add #wmark 2 table rtMlink2

ip route #lus3 cac3e

Sysresccd-manual-en !ackup and transferyour data usin rsync

From SystemRescueCd

Jump to: navigation, search

Contents

[hide• " 5vervie'

• % +asic usage

o %" i(e copy on a (oca( machine

o %% remote $ackup in standa(one mode

o %* remote $ackup over ssh

• * Saving i(es 'ith interruptions

o *" 3ranserring thousands o sma(( i(es

o *% 3ranserring i(es 'ith margina( connections

• 0 Aseu( rsync options

"22

Page 167: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 167/174

o 0" -a, --archive: preserve $asic attri$utes

o 0% --progress: sho' progress during transer

o 0* -v, --ver$ose: (ist i(es Ase t'ice or more detai(s

o 00 -7, --one-i(e-system: dont cross i(esystem $oundaries

o 01 -H, --compress: compress i(e data during the transer

o 02 --inp(ace and --partia(

o 0M --e7c(ude@pattern: e7c(ude i(es matching pattern• 1 Rsync return status

• 2 6nsta(( and coniguring the rsync daemon

• M .S )indo's and cyg'in

• 8 Asing rsync regu(ar(y to minimiHe the impact o a catastrophe

o 8" #dditiona( useu( options:

8"" --de(ete: remove de(eted i(es rom destination

8"% -u, --update: skip i(es that are ne'er on the destination 8"* --remove-source-i(es: sender removes synchroniHed i(es 9non-dir

8"0 -c, --checksum: compare $ased on checksum, not Dust modiication-

time ^ siHe

o 8% #gain, reer to Rsync documentation

Overview

Rsync is an open source i(e synchroniHation program &esigned to maintain a mirror o a

directory, it is a very advanced tool that can $e used to make $ackups, or to copy i(es to anotherdisk or host in the event o a hard'are or sot'are catastrophe

3he advantages o rsync over a(ternate transer methods inc(ude:

" efficiency: i a version o a i(e a(ready e7ists at the destination, on(y changed portions aretranserred 3his signiicant(y reduces resource reuirements and e(apsed time especia((y

'ith (arge i(es 6t uses an inte((igent a(gorithm that detects redundancies 'hich minimiHesnet'ork (oad

% robustness: in environments 'ith margina( connections or random hard'are ai(ures

9especia((y disks that $ecome non-operationa( ater heating up , rsync can resume transersthat 'ere interrupted

* fleibility: options inc(ude e7c(usion (ists, <dry run< to veriy options, tuning o compares

to detect changes, various methods to hand(e (inks and more0 runs on =inu7, Ani7 and under .S )indo's 'ith cyg'in

Rsync has e' dra'$acks:

" .ost(y nota$(e, since it is so (e7i$(e that there are many options, some o 'hich are

comp(ementary, some are contradictory 3he u(( documentation or Rsync is e7tensive and

shou(d $e read severa( times% 3he destination i(esystem must support the attri$utes )ith archiving, the attri$utes are

stored in the archive, and the archive can $e on any i(esystem

"2M

Page 168: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 168/174

Rsync is provided 'ith SystemRescueCd and this documentation is intended to provide useu(inormation and e7amp(es or use during the recovery process #ter understanding these you 'i((

ind rsync useu( to increase system re(ia$i(ity during norma( operations See <Asing rsync

regu(ar(y to minimiHe the impact o a catastrophe<

!asic usae

rsync can $e run as server 9'hen started 'ith --daemon or as c(ient to make copies o i(es on a

(oca( machine or across the net'ork to another host 3he recommended options inc(ude:

• --pro"ress disp(ays activity or monitoring progress

• --arc3ive preserve $asic attri$utes 9permissions, o'ner, type [ sym$o(ic (ink 'i(( $e

 preserved as a (ink +e very careu( 'ith the trai(ing s(ash

• --xattrs preserve eItended attri$utes -X 

• --acls preserve #ccess Contro( =ists -$ 

• --3ard-links preserve hard (inks 9dont treat them as i(es -O 

• --compress in (ight data 9 no eect on destination -z 

file copy on a local mac"ine

5n(y one rsync process is invo(ved or (oca( $ackups ere is an e7amp(e 'hich preserves a((

attri$utes 9inc(uding 7tended ones and #C=s:

rsync --arc3ive --xattrs --acls --3ard-links --pro"ress --compress Z  /3ome/mydir/data/ /backups/data-2008080/

remote backup in standalone mode

6 rsync is insta((ed as a daemon 9(istening on port tcp;8M* on e7amp(ecom, the c(ient running at

myhost can either:

" pu(( i(es rom the daemon

% push i(es to the daemon

ere is an e7amp(e having the c(ient can push a directory to a remote host 9preserving attri$utes,

#C=s and hard (inks 9using sing(e (etter options:

rsync -aX$Oz --pro"ress /3ome/mydata/ example.com$$mybackups/data-2008080/

3he c(ient cou(d a(so do'n(oad the i(es rom the remote hosts:

rsync -aX$Oz --pro"ress example.com$$mybackups/data-2008080/ /3ome/mydata/

 Notice t'o co(ons $et'een the remote host and the path

remote backup over ss"

"28

Page 169: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 169/174

Page 170: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 170/174

-u --update must N53 used 'ith --inplace as the partia( destination i(e 'ou(d $e considered

the same as than the origina( i(e and skipped

Rsync uses a very eicient a(gorithm to compare the source i(e 'ith the destination i(e and on(y

transers the dierent parts o the i(e 3o transer severa( versions o the same i(es on a regu(ar $asis, copy the o(d version 9that you have a(ready transerred to the ne' destination i(e, and rsync

'i(( skip a(( the common parts

)6th these options, rsync can $e interrupted then resumed &ata 'hich has $een transerred is

 preserved

ere is an e7amp(e o good command to copy a directory 'ith (arge i(es to a remote host:

rsync --arc3ive --partial --inplace --pro"ress--compress Z  /3ome/bi"#iles/ 4Y4(??:?mybackups/bi"#iles/

Check or updates to rsync at [" 

Eseful rsync options

rsync has a (ot o options ere a Dust a e' 'hich app(y to recovering a ai(ed system

-a/ --arc"ive: preserve basic attributes

?ery important /reserves i(es attri$utes 9permissions, times and type #s a resu(t, a sym$o(ic(ink 'i(( $e copied as a (ink, 'ithout --arc3ive the contents o the source i(e are copied in the

destinationP N+: ard (inks, e7tended attri$utes 97attr, and #C=s9#ccess Contro( =ists are not

 preserved 'ith this option, see -O$X 

--proress: s"ow proress durin transfer

-v/ --verbose: list files7 Ese twice for more details

-/ --one-file-system: dont cross filesystem boundaries

/rocess on(y one i(esystem 6mportant 'hen processing a i(esystem 9e7: /  'ith mounted

vo(umes &eau(t processes i(esystems 'ith mount points 'ithin the source speciication

-/ --compress: compress file data durin t"e transfer

Rsync can compress the data that are transerred to reduce net'ork activity 3he destination i(e

'i(( $e the same as the origina( Ase it or remote transers 'hen synching i(es 'hich areuncompressed and 'i(( have a (arge compression ratio 9eg: (arge te7t i(es, C& images or ra'

 partition images 3his option is not eicient on i(es 'hich are a(ready compressed: Hip, gH, $H%,

taH, Dpeg, pd, 3his 'i(( cause a signiicant increase in the C/A usage on $oth sourcing and

destination systems

"MK

Page 171: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 171/174

--inplace and --partial

Ase these options to transer (arge i(es and insure that the transer 'i(( resume at a restart point in

case o connection ai(ure See the sections a$out 3ranserring (arge i(es or more detai(s

--eclude+pattern: eclude files matc"in pattern

Ase this option to e7c(ude i(es or directories rom the transer For instance temporary i(es orcache directories

Rsync return status

3he return status must $e checked to determine 'hether or not the transer 'as successu( )hen

rsync returns K, it means that the transer 'as successu( #ny other va(ue indicates an error

Some errors 'hich may indicate a recovera$(e pro$(em inc(ude:

• %%: Error a((ocating core memory $uers• %*: /artia( transer due to error

%nstall and confiurin t"e rsync daemon

3he rsync c(ient 'i(( on(y transer data to an rsync server

+e sure to see Rsync documentation or a(( the options

3he coniguration deau(t (ocation is either /etc/rsyncd.con# or /etc/rsync/rsyncd.con#

#ter changing the coniguration, send a A/ signa( using kill -O'5 Spid-o#-rsync@

Severa( options are avai(a$(e to restrict connections :

• reuire a pass'ord to connect

• a((o' on(y severa( speciic 6/ addresses to connect

•  provide read-on(y access to the c(ient

ere is an e7amp(e o $asic secured coniguration:

K ======================/etc/rsyncd.con#======================pid #ile = /var/run/rsyncd.pidread only = yesuid = root"id = root

Gs3areH  pat3 = /mnt/s3are  read only = yes  3osts allow = my3ost1 0.88.+.0/2

"M"

Page 172: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 172/174

GbackupsH  pat3 = /var/tmp/catalyst/tmp  read only = no  3osts allow = mybi""ie1 0.88.+.0/2

Groot#sH  pat3 = /  read only = yes

  3osts allow = my3ost1 0.88.+.0/2

GuploadH  pat3 = /upload  read only = no  3osts allow = 2.6.0.0/6

#S Windows and cywin

3he rsync daemon can $e run on an .S )indo's system $y using cyg'in 'hich provides a (inu7

environment .inima( inormation is provided here to get you started

3o insta(( cyg'in, run the setupe7e program ound on the 'e$site

3he hard disks as seen as /cy"drive/c/, /cy"drive/d/,

C(ick on the cyg'in icon to run a $ash she(( ere is the command to use:

cy"runsrv.exe -( Lcy"rsyncdL -p /usr/bin/rsync.exe -a L--con#i"=/etc/rsyncd.con# --daemon --no-detac3L

3hen, start the ne' service run services.msc and start the service named <cygrsyncd<

Esin rsync reularly to minimie t"e impact of a catastrop"e

3he previous sections o this document ocus on the eatures and operation o rsync to he(p recover

a system

ere 'e present additiona( inormation 'e thought 'ou(d $e useu(

rsync is a uti(ity that maintains a mirror o a i(esystem Apdated regu(ar(y, the mirror can $e a

maDor asset or recovering a ai(ed system

ere are some addition notes or using rsync:

" rsync can make remote $ackups o your data i(es on 'indo's, or it can rep(icate 'indo's

system $ackups created via nt$ackup

% Com$ined 'ith =. snapshots to make on(ine $ackups 'hich are consistent* ?arious backup strateies: u((, dierentia( $ackups, incrementa(s

+ackups can save on(y the i(es 'hich have $een modiied since the previous $ackup

"M%

Page 173: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 173/174

" run rsync on a server every night to make a $ackups o its root i(e system rsync 'i(( pro$a$(y comp(ain a$out i(es 'hich have $een de(eted during the transer 9(ike temporary

i(es

consider the return status %* and %0 as 'arnings on a (ive system

3he rsync daemon can $e insta((ed in a dedicated (isten mode 9tcp port 8M* aving 7inetd conigured to (isten on the $eha( o rsync uses (ess memory and is more secure 6t a(so means

rsync is started and the coniguration i(e read on each connection so changes 'i(( eected on the

ne7t connection

rsync traps intr so pressing _C stops 'hen the current i(e is comp(eted Ase the (ess common uit_T to have it uit no'

@dditional useful options:

--delete: remove deleted files from destination

)hen synchroniHing to an e7isting destination, i(es in the destination directory 'i(( $e removed i

they are not in the source directory 9 3he i(es have $een de(eted +y default i(es no (onger in the

source remain in t"e destination Consider the scenario in 'hich i(es are versioned $y date andare de(eted as a ne' one is created 9 /trans#ers/'%4(;;&)-200M0M0+.input   3he deau(t

'i(( not remove o(d versions and they 'i(( accumu(ate 3his 'i(( cause the destination to not $e a

<mirror< o the source and the space reuired or the destination 'i(( increase 'ith each run

/rocessing a sing(e run 'ith this option 'i(( de(ete a(( accumu(ated i(es

-u/ --update: skip files t"at are newer on t"e destination

&eines this run to $e an update o an e7isting destination Ase this option i i(es have $eenmodiied in the destination directory For instance, i you are migrating data rom an o(d server to

a ne' one, and i peop(e have a(ready started 'orking on the ne' server Ase --update to prevent

over'riting changes 'ith an o(der version

--remove-source-files: sender removes sync"ronied files =non-dir>

.ove data to the destination +y deau(t, rsync makes a copy (eaving the origina( intact )ith

--remove-source-#iles, the source i(es to $e de(eted i the transer 'as successu(

-c/ --c"ecksum: compare based on c"ecksum/ not Lust modification-time M sie

rsync uses the i(e modiication-time and siHe to make the comparison 'hen updating e7isting

directories # i(e that e7ists in the destination directory 'ith the same name, date and siHe is

considered to $e the same 3his is accurate in near(y a(( cases 3he comparison is very uick $ecause on(y the i(e attri$utes are read 6n rare cases this is incorrect 3here are some uti(ities

'hich modify a file and retain the original modification time 9the graphic editor iranvie' provides

an option to do this 6 the modiication does not change the siHe o the i(e 9very rare rsync 'i((erroneous(y consider the source and destination i(es to $e identica( and not transer the i(e

Speciy --c3ecksum to orce rsync to generate a checksum o the i(es and compare the checksum

"M*

Page 174: SysRecCD Quick

8/12/2019 SysRecCD Quick

http://slidepdf.com/reader/full/sysreccd-quick 174/174

to determine i the i(es are the same +e warned that this 'i(( add signiicant C/A time and 6;5activity at $oth the source and destination since the entire contents o $oth i(es must $e read to

generate the checksum 3he e(apsed time 'i(( signiicant(y increase 'hen using --checksum #n

occasiona( run, immediate(y ater a successu( $ackup, 'ith --checksum is useu( in (ocatingdirectories containing i(es in 'hich the deau(t comparison is incorrect #s a secondary run, e'

i(es shou(d $e $acked up and i run a 'ith a nice priority and a (o' ionice priority on $oth the

c(ient and server the impact o the increased C/A uti(iHation can $e minimiHed #na(ysis o thei(es transerred in this run 'i(( reve( directories 'hich regu(ar(y reuire a separate Do$ to correct(y

 $ackup su$t(e changes

)ith the deau(t $ehavior 9comparison $ased on modiication-time and siHe interrupting the

transer and resuming 'i(( skip a(( the i(es 'hich have a(ready $een copied,ie rsync 'i(( resumethe transer 'here it (et o

@ain/ refer to Rsync documentation

or the most current and comp(ete inormation