Unix Technical Forum

SEO

vBulletin Search Engine Optimization


Go Back   Unix Technical Forum > Unix Operating Systems > Gentoo Linux Support

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-21-2008, 11:26 AM
jf
 
Posts: n/a
Default changing hdd

Hi u all,

Does anybody know the best way ( the more simple and.....the faster ) to
copy all my linux, except boot partition, to a new hard disk ?
My PC is like that :

- primary master -> 200 Go ( grub+Windows XP !)
- secondary master -> 40 Go ( linux gentoo on several partitions "/"
"/home" etc..)

I'd like to change this 2nd HD wich is becoming very slow, and.... narrow
.. The new one will be at least 80 Go, but I can create the same partitions
I've on my Linux HD.
The question is : wich is the safest way replace the disk, and start with a
working linux ?

thanks in advance,
cu,
jf



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-21-2008, 11:27 AM
Aragorn
 
Posts: n/a
Default Re: changing hdd

On Saturday 06 May 2006 10:09, jf stood up and spoke the following words
to the masses in /alt.os.linux.gentoo...:/

> Hi u all,
>
> Does anybody know the best way ( the more simple and.....the faster
> ) to copy all my linux, except boot partition, to a new hard disk ?
> My PC is like that :
>
> - primary master -> 200 Go ( grub+Windows XP !)
> - secondary master -> 40 Go ( linux gentoo on several partitions "/"
> "/home" etc..)
>
> I'd like to change this 2nd HD wich is becoming very slow, and....
> narrow
> . The new one will be at least 80 Go, but I can create the same
> partitions I've on my Linux HD.
> The question is : wich is the safest way replace the disk, and start
> with a working linux ?


It may not be what you really want, but the best approach - at least, in
my opinion - would be to install the new disk while the old one is
still in place and use /dd/ - see the /man/ page - to copy the entire
disk onto the new one in one go.

This will include the partition table and all filesystems as it's a
low-level copy, similar to what a Norton Ghost would do - or so I'm
told, I've never used Norton Ghost and I don't have any Windows on my
machine.

After the copy, you remove the old disk and you put the new one on the
same controller and channel - e.g. secondary master or primary slave -
where the other one does. That way, your */etc/fstab* and GRUB entries
will still be correct. You will of course have 40 GB of unused space
on that disk after the copy.

Hope this was helpful... ;-)

--
With kind regards,

*Aragorn*
(Registered GNU/Linux user # 223157)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-21-2008, 11:27 AM
Aragorn
 
Posts: n/a
Default Re: changing hdd - erratum

On Sunday 07 May 2006 01:38, I stood up and spoke the following words to
the masses in /alt.os.linux.gentoo...:/

> [...]
>
> After the copy, you remove the old disk and you put the new one on the
> same controller and channel - e.g. secondary master or primary slave -
> where the other one does. [...]


That should of course read "... on the same controller where the other
one used to be". Sorry for my butterfingering - it's getting late over
here... ;-)

--
With kind regards,

*Aragorn*
(Registered GNU/Linux user # 223157)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-21-2008, 11:27 AM
Arthur Hagen
 
Posts: n/a
Default Re: changing hdd

jf <cestpasjihef@free.fr> wrote:
> Hi u all,
>
> Does anybody know the best way ( the more simple and.....the faster
> ) to copy all my linux, except boot partition, to a new hard disk ?
> My PC is like that :
>
> - primary master -> 200 Go ( grub+Windows XP !)
> - secondary master -> 40 Go ( linux gentoo on several partitions "/"
> "/home" etc..)
>
> I'd like to change this 2nd HD wich is becoming very slow, and....
> narrow . The new one will be at least 80 Go, but I can create the
> same partitions I've on my Linux HD.
> The question is : wich is the safest way replace the disk, and start
> with a working linux ?


If you use dd, like Aragorn recommended, you won't be able to increase more
than the last partition of your disk (if the file system supports growing,
that is). So no, since you have several partitions, I wouldn't recommend
that.

Add the new disk, partition it with the partitions in the same order as your
original disk, boot to a liveCD, and mount both the old and new partitions.

What kind of file system? If ext2/3 or xfs, you can use dump/restore or
xfsdump/xfsrestore to copy the files over and still retain all attributes,
special files, quotas, streams and everything else. For xfs, the following
should work:
xfsdump -J - /old | xfsrestore -J - /new

If using reiserfs, there's no dump utility (among the plethora of missing
things which makes it my least favourite file system), and you can't do much
better than a tar through a pipe:
cd /old && tar cpf - . | (cd /new && tar xvpf -)

(You may have to use --numeric-owner if the user IDs on your liveCD don't
match the ones you've used)

After copying over the data, change your existing grub/lilo to point to the
new disk instead of the old, or (if daring) remove the old drive, put the
new one in instead, and boot. I'd keep the old disk -- even if slow, an
extra drive is always useful. :-)

Regards,
--
*Art

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-21-2008, 11:27 AM
jf
 
Posts: n/a
Default Re: changing hdd

Arthur Hagen wrote:

> .....
> If you use dd, like Aragorn recommended, you won't be able to increase
> more than the last partition of your disk (if the file system supports
> growing,

........
> Add the new disk, partition it with the partitions in the same order as
> your original disk, boot to a liveCD, and mount both the old and new
> partitions.
> ..............

.................
> new one in instead, and boot. I'd keep the old disk -- even if slow, an
> extra drive is always useful. :-)
>
> Regards,


Thanks, I'll have a deeper look on your fulla answer

regards,

jf
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-21-2008, 11:27 AM
jf
 
Posts: n/a
Default Re: changing hdd - erratum

Aragorn wrote:

> On Sunday 07 May 2006 01:38, I stood up and spoke the following words to
> the masses in /alt.os.linux.gentoo...:/
>
>> [...]
>>
>> After the copy, you remove the old disk and you put the new one on the
>> same controller and channel - e.g. secondary master or primary slave -
>> where the other one does. [...]

>
> That should of course read "... on the same controller where the other
> one used to be". Sorry for my butterfingering - it's getting late over
> here... ;-)
>


I had made the correction, it's OK - But, using dd, as Arthur Hagen says,
will make me keep the same partition size, except the last one.
BTW, you're lucky you can avoid using Winndows, I'd like that, but my PC is
also used for work, and....

regards,
jf
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-21-2008, 11:27 AM
Anton Ertl
 
Posts: n/a
Default Re: changing hdd

"Arthur Hagen" <art@broomstick.com> writes:
>What kind of file system? If ext2/3 or xfs, you can use dump/restore or
>xfsdump/xfsrestore to copy the files over and still retain all attributes,
>special files, quotas, streams and everything else.


But then you have to use the same file system on source and
destination, right?

I have used GNU tar successfully in the past, it does the right thing
for device files (any other special files you had in mind?), I have
not used quota, not sure what happened to streams and everything else
(ACLs? Other funny attributes?), but that was some time ago. Do
modern distributions use the things not supported by tar more than old
distributions?

- anton
--
M. Anton Ertl Some things have to be seen to be believed
anton@mips.complang.tuwien.ac.at Most things have to be believed to be seen
http://www.complang.tuwien.ac.at/anton/home.html
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-21-2008, 11:27 AM
Aragorn
 
Posts: n/a
Default Re: changing hdd - erratum

On Sunday 07 May 2006 16:13, jf stood up and spoke the following words
to the masses in /alt.os.linux.gentoo...:/

> Aragorn wrote:
>
>> On Sunday 07 May 2006 01:38, I stood up and spoke the following words
>> to the masses in /alt.os.linux.gentoo...:/
>>
>>> [...]
>>>
>>> After the copy, you remove the old disk and you put the new one on
>>> the same controller and channel - e.g. secondary master or primary
>>> slave -
>>> where the other one does. [...]

>>
>> That should of course read "... on the same controller where the
>> other one used to be". Sorry for my butterfingering - it's getting
>> late over here... ;-)
>>

>
> I had made the correction, it's OK - But, using dd, as Arthur Hagen
> says, will make me keep the same partition size, except the last one.


That is also what I said. ;-) Yet, I was assuming that the replacement
of the hard disk was a matter of technical reliability, rather than one
of running out of diskspace. ;-)

Arthur's advice is solid and valid, of course. ;-)

> BTW, you're lucky you can avoid using Winndows, I'd like that, but my
> PC is also used for work, and....


I've never been stuck to Windows the way most people are. I have only
ever used Windows in a limited way - Windows 3.x for six months and
Windows NT 4.0 Workstation for about two and a half years - as a kind
of phase in search of "the right operating system for me".

On my first PC - a Brother slimline desktop with an AMD 80386DX
processor - I opted for OS/2 where everyone else at the time was using
MS-DOS and Windows 3.x.

On my Pentium II, I've used Windows NT - while everyone else used Win95
and Win98 - because I was too unaware of GNU/Linux at the time - it was
still in its infancy back then - and I didn't have an Internet
connection. Proprietary Unix was very expensive as well. But in the
end, that machine served as a GNU/Linux-only box. I've actually only
used a dual-boot set-up for about a month.

I've never been one to adopt choices made by others as being those that
would apply to me - this probably has to do with my Asperger's Syndrome
- and so I've never allowed myself to get hooked by a particular
operating system I didn't want to use to begin with. ;-)

There is nothing whatsoever that would require me to have Windows on my
machine. I even pick my hardware solely in function of compatibility
with GNU/Linux.

People do send me MS-Office documents via e-mail sometimes, but
OpenOffice can handle those pretty well, and if need be, then I can
save a spreadsheet or a text document in a Microsoft-compatible format
with it.

And well... if I get some proprietary multimedia format in my e-mail -
which typically will be for Windows Media Player - and I can't open
it, then too bad for the one who sent it to me. If it really matters
to them that I see it, then they should make use of open standards. ;-)

You know, it's kind of like smoking... Non-smokers are in the majority
and I understand all their arguments. Yet if they want courtesy from
smokers, then they should show courtesy _to_ smokers as well.

Using GNU/Linux is more or less the same. It's just healthier. ;-)

--
With kind regards,

*Aragorn*
(Registered GNU/Linux user # 223157)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 02-21-2008, 11:27 AM
jf
 
Posts: n/a
Default Re: changing hdd - erratum

Aragorn wrote:

> There is nothing whatsoever that would require me to have Windows on my
> machine. I even pick my hardware solely in function of compatibility
> with GNU/Linux.
>
> People do send me MS-Office documents via e-mail sometimes, but
> OpenOffice can handle those pretty well, and if need be, then I can
> save a spreadsheet or a text document in a Microsoft-compatible format
> with it.
>
> And well... if I get some proprietary multimedia format in my e-mail -
> which typically will be for Windows Media Player - and I can't open
> it, then too bad for the one who sent it to me. If it really matters
> to them that I see it, then they should make use of open standards. ;-)
>
> You know, it's kind of like smoking... Non-smokers are in the majority
> and I understand all their arguments. Yet if they want courtesy from
> smokers, then they should show courtesy _to_ smokers as well.
>
> Using GNU/Linux is more or less the same. It's just healthier. ;-)
>


About the hd replacement, yes, it is a matter of reliability, but it is
always good to get more space

About using windows or not, as I said, you're lucky. I need it for my job,
and have no choice. But as soon as I use my PC for personal matters, it is
Gentoo. But I have to admit that sometimes, things are not as simple that
you can think : I'm still unable to get my 5.1 audio system to work with
linux, too bad...for me

regards,
jf
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 02-21-2008, 11:27 AM
Arthur Hagen
 
Posts: n/a
Default Re: changing hdd

Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
> "Arthur Hagen" <art@broomstick.com> writes:
>> What kind of file system? If ext2/3 or xfs, you can use
>> dump/restore or xfsdump/xfsrestore to copy the files over and still
>> retain all attributes, special files, quotas, streams and everything
>> else.

>
> But then you have to use the same file system on source and
> destination, right?


Same file system family, yes. But you can do ext2 -> ext3 or xfs -> xfs_rt
too, and the size of the partition doesn't have to be the same, like with
dd.

> I have used GNU tar successfully in the past, it does the right thing
> for device files (any other special files you had in mind?), I have
> not used quota, not sure what happened to streams and everything else
> (ACLs? Other funny attributes?), but that was some time ago. Do
> modern distributions use the things not supported by tar more than old
> distributions?


Many security applications use ACLs, if present. Many sysadmins do too --
for as few as four users, it's way easier to assign access rights to to
Peter, Paul, Mary and Chong according to need, than having to create
eleven(!) different groups with the possible combinations. ACLs are not
preserved by tar.
Also, if you share out to Windows or MacOS, there's metadata stored with the
files, like MacOS' resource fork, or Windows' system/hidden/archive bits or
ownership (if Samba is set up correctly).
For xfs, there's also attributes like SGI_XFSDUMP_SKIP_FILE which can be
(optionally) used to make dumps skip certain files.

Regards,
--
*Art

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 01:59 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
UnixAdminTalk.com

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603