Unix Technical Forum

SEO

vBulletin Search Engine Optimization


Go Back   Unix Technical Forum > Unix Operating Systems > Linux Operating System

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-18-2008, 07:25 AM
Michael Hennebry
 
Posts: n/a
Default Where did dhcp go?

Recently I installed Fedora Core 3.
My machine has a CD-ROM drive and a CD-R drive.
The file systems on my single 40G disk are
Windows, ext2 and swap.
My hostname was a combination of cableone and
my IP address.
I put a data disk in my CD-ROM drive and
a blank CD-R in my CD-R drive.
As root I gave the command
readcd dev=ATA:1,0,0 -clone f=somefile

It hung.
somefile was created at 0 bytes.
somefile.toc became 50 bytes.

After a few minutes I was feeling murderous.
As root, I tried to kill the process with kill -9.
It didn't die.
kill didn't complain, it just didn't get the job done.
Repeated effort didn't help.

I tried umount /media/cdrom .
I expected to get a device busy error.
I did the third time.
The first umount hung.
The second had to be done in another window.
It finished.

readcd was still running,
as was the first umount.
Control-C didn't help either.

Eventually I resorted to reboot.

In the shutdown phase, I think I saw some things
like umount failed, device busy go by.
In the boot phase, I was told to run fsck,
so I did.
Absent any reason to do otherwise, I answered y
to all of its questions.

Rebooting eventually seemed to be successful.
Now my hostname is stmike.
Huh?
I'd seen that name before when Fedora thought
that I didn't have an internet connection
and wouldn't even offer DHCP.
Presumably Fedora knows better now, since I'm
using it and the internet to type this.

What's going on?
Why doesn't readcd like me?
Why couldn't I kill it?
What about umount?
Why did DHCP go away?
Where did stmike come from?
I never tell a computer my name is mike.
Even if I did, where would the st come from?

/etc/fstab looks like this:
# This file is edited by fstab-sync - see 'man fstab-sync' for details
LABEL=/1 / ext2 defaults
1 1
LABEL=/boot1 /boot ext2 defaults
1 2
none /dev/pts devpts gid=5,mode=620
0 0
none /dev/shm tmpfs defaults
0 0
LABEL=/home1 /home ext2 defaults
1 2
none /proc proc defaults
0 0
none /sys sysfs defaults
0 0
LABEL=/usr/local1 /usr/local ext2 defaults
1 2
LABEL=SWAP-hda5 swap swap defaults
0 0
/dev/hdd /media/cdrecorder auto
pamconsole,fscontext=system_ubject_r:removable_t ,ro,exec,noauto,managed
0 0
/dev/hdc /media/cdrom auto
pamconsole,fscontext=system_ubject_r:removable_t ,ro,exec,noauto,managed
0 0
/dev/fd0 /media/floppy auto
pamconsole,fscontext=system_ubject_r:removable_t ,exec,noauto,managed
0 0

Help.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-18-2008, 07:25 AM
Davide Bianchi
 
Posts: n/a
Default Re: Where did dhcp go?

On 2005-04-14, Michael Hennebry <hennebry@web.cs.ndsu.nodak.edu> wrote:
> As root I gave the command
> readcd dev=ATA:1,0,0 -clone f=somefile


If you wanted to copy the cd why didn't you do something like
dd if=/dev/cdrom of=somefile and then used cdrecord to slap the image on
the destination cd?

> As root, I tried to kill the process with kill -9.
> It didn't die.


It was probably stuck in some kernel function, so he wasn't going to die.

> Why did DHCP go away?
> Where did stmike come from?


You badly crashed some processes in a futile attempt at killing a process
that was a) running as root b) accessing low-level driver c) using kernel
functions. What do you expect?

Davide

--
How about some patent on "(a+b)^2 == a^2 + 2ab + b^2"? Choose free software!
-- Laurent Szyster
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-18-2008, 07:25 AM
Michael Hennebry
 
Posts: n/a
Default Re: Where did dhcp go?

Davide Bianchi wrote:
> On 2005-04-14, Michael Hennebry <hennebry@web.cs.ndsu.nodak.edu>

wrote:
> > As root I gave the command
> > readcd dev=ATA:1,0,0 -clone f=somefile

>
> If you wanted to copy the cd why didn't you do something like
> dd if=/dev/cdrom of=somefile and then used cdrecord to slap the image

on
> the destination cd?


Because I had no clue what that would do.
The examples in dd's info file leave me more puzzled than informed.
I am quite unsure what dd is supposed to
do with anything other than a plain file.
Also, I don't have a /dev/cdrom.
How about dd if=/dev/hdc of=/dev/hdd ?
Maybe cp dev/hdc dev/hdd ?

I still don't know what flags cdrecord should get after
dd if=/dev/hdc of=somefile .

The command sequence I was attempting came
almost verbatim from the man page for cdrecord.
Not only didn't it work, it did a fair amount of damage.

> > As root, I tried to kill the process with kill -9.
> > It didn't die.

>
> It was probably stuck in some kernel function, so he wasn't going to

die.
>
> > Why did DHCP go away?
> > Where did stmike come from?

>
> You badly crashed some processes in a futile attempt at killing a

process
> that was a) running as root b) accessing low-level driver c) using

kernel
> functions. What do you expect?


In the future what should I do about a process that is
a) running as root b) accessing a low-level driver
c) using kernel functions and d) hung?

What does any of that have to do with DHCP?
How do I get DHCP back?
I had it for a while after my most recent install.
Where did stmike come from?

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-18-2008, 07:25 AM
Davide Bianchi
 
Posts: n/a
Default Re: Where did dhcp go?

On 2005-04-14, Michael Hennebry <hennebry@web.cs.ndsu.nodak.edu> wrote:
> I am quite unsure what dd is supposed to do with anything other than
> a plain file.


dd is just a souped-up (or down) cp.

> Also, I don't have a /dev/cdrom.
> How about dd if=/dev/hdc of=/dev/hdd ?


Well... most distribution make a symlink called 'cdrom' to make things
more easy, if you don't have such link, just use the 'real' device name.
It's the same.

> I still don't know what flags cdrecord should get after
> dd if=/dev/hdc of=somefile .


somefile will be a full copy of the CD, filesystem and everything, you
can even mount it using mount -o ro,loop somefile /were/you/want/it and
browse his content. To write on the CD, use cdrecord dev=... somefile
(add speed= option or wathever you like).

> almost verbatim from the man page for cdrecord.


My man page doesn't report cdcopy at all.

> In the future what should I do about a process that is
> a) running as root b) accessing a low-level driver
> c) using kernel functions and d) hung?


I'm afraid that there is nothing you can do but to attempt a clean shutdown
of the machine. But a clean shutdown when something is stuck at the kernel
level is not always possible, so expect something to go wrong at the next
boot.

> How do I get DHCP back?


Well, if your machine was requesting ip from dhcp, you should have a
configuration file in /etc/ that report such option for your network card.
If you are using a red-hat derivative (IIRC from your previous post),
it should be in /etc/sysconfig/network-scripts and named something like
ifcfg-ethX (where X is the number of your network card), in there
you find BOOTPROTO=... that should be DHCP.

> Where did stmike come from?


Check /etc/sysconfig/network, probably when you get the IP from dhcp it
also overwrite your hostname.

Davide

--
I'm an apatheist. The question is no longer interesting, and the
answer no longer matters.
-- from alt.sysadmin.recovery
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-18-2008, 07:25 AM
Michael Hennebry
 
Posts: n/a
Default Re: Where did dhcp go?

Davide Bianchi wrote:
> On 2005-04-14, Michael Hennebry <hennebry@web.cs.ndsu.nodak.edu>

wrote:
> > I am quite unsure what dd is supposed to do with anything other

than
> > a plain file.

>
> dd is just a souped-up (or down) cp.


So dd doesn't have any device-specific knowledge built in?
It just issues reads and writes?
The block sizes just affect how much
it tries to read and write at a time?

> > Also, I don't have a /dev/cdrom.
> > How about dd if=/dev/hdc of=/dev/hdd ?


Would this actually work?

> > I still don't know what flags cdrecord should get after
> > dd if=/dev/hdc of=somefile .

>
> somefile will be a full copy of the CD, filesystem and everything,

you
> can even mount it using mount -o ro,loop somefile /were/you/want/it

and
> browse his content. To write on the CD, use cdrecord dev=... somefile
> (add speed= option or wathever you like).


If I understand this correctly, unless told otherwise,
cdrecord takes a file that is a byte-for-byte
copy of what is to go on the CD-R.
mkisofs's job is to make such a file
that corresponds to an ISO file system.

If I wanted, I could take any 800MB file and pass it to cdrecord.
If my CD-R is big enough, reading that CD-R back would just
be a matter of directly reading the correct /dev/* file.

> > almost verbatim from the man page for cdrecord.

>
> My man page doesn't report cdcopy at all.


>From man cdrecord:

To copy a CD in clone mode, first read the master CD using:

readcd dev=b,t,l -clone f=somefile

or (in case the CD contains many sectors that are unreadable by
inten-
tion) by calling:

readcd dev=1,0 -clone -nocorr f=somefile

will create the files somefile and somefile.toc. Then write
the CD
using:

cdrecord dev=1,0 -raw96r -clone -v somefile

> > How do I get DHCP back?

>
> Well, if your machine was requesting ip from dhcp, you should have a
> configuration file in /etc/ that report such option for your network

card.
> If you are using a red-hat derivative (IIRC from your previous post),
> it should be in /etc/sysconfig/network-scripts and named something

like
> ifcfg-ethX (where X is the number of your network card), in there
> you find BOOTPROTO=... that should be DHCP.


It is, ifcfg-eth0:
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes
TYPE=Ethernet
>
> > Where did stmike come from?

>
> Check /etc/sysconfig/network, probably when you get the IP from dhcp

it
> also overwrite your hostname.


/etc/sysconfig/network:
NETWORKING=yes
HOSTNAME=localhost.localdomain

Is the fact that I can get to the
internet evidence that DHCP is running?
Is a hostname of stmike evidence that it isn't running correctly?
I've seen the hostname stmike before, when I'd installed without giving
enough information to connect to the internet.
Where that name came from was a mystery to me then also.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 01-18-2008, 07:25 AM
Peter T. Breuer
 
Posts: n/a
Default Re: Where did dhcp go?

Michael Hennebry <hennebry@web.cs.ndsu.nodak.edu> wrote:
> Davide Bianchi wrote:
> > On 2005-04-14, Michael Hennebry <hennebry@web.cs.ndsu.nodak.edu>

> wrote:
> > > I am quite unsure what dd is supposed to do with anything other

> than
> > > a plain file.

> >
> > dd is just a souped-up (or down) cp.

>
> So dd doesn't have any device-specific knowledge built in?


None whatsever.

> It just issues reads and writes?


Exactly.

> The block sizes just affect how much
> it tries to read and write at a time?


That is one the ways in which it has more configurability than plain cp.
Yu can decide the blocksize, how much of the input t sip, how much f
the output to skip, how much to write, etc.

> > > Also, I don't have a /dev/cdrom.
> > > How about dd if=/dev/hdc of=/dev/hdd ?

>
> Would this actually work?


Why wouldn't it? It's just a "cp /dev/hdc /dev/hdd". All the data goes
from one side to the other.

> If I understand this correctly, unless told otherwise,
> cdrecord takes a file that is a byte-for-byte
> copy of what is to go on the CD-R.


Fine, yes.

> mkisofs's job is to make such a file
> that corresponds to an ISO file system.


Yes. You can take an existing cd instead, of course. And you don't have
to use an iso9660 file system!

> If I wanted, I could take any 800MB file and pass it to cdrecord.
> If my CD-R is big enough, reading that CD-R back would just
> be a matter of directly reading the correct /dev/* file.


Sure.

> /etc/sysconfig/network:
> NETWORKING=yes
> HOSTNAME=localhost.localdomain


That's the wrong name. "Localhost" means "me". You can't call yourself
"me" as a name. It's confusing! How will other people talk to you?

> Is the fact that I can get to the
> internet evidence that DHCP is running?


No. Dhcp is a server/broadcast client mechanism for configuring things
like yur IP address, netmask, hostname, etc. You can et yourself up for
internet use without it.

> Is a hostname of stmike evidence that it isn't running correctly?


?? No. I would have said it's evidence that something or someone has set
you a hostname that at least is more correct than "localhost"! Whether
DHCP did it or not you can check by looking in yur logs. Or just
checking your dhcp leases.

> I've seen the hostname stmike before, when I'd installed without giving
> enough information to connect to the internet.
> Where that name came from was a mystery to me then also.


If it was not you, it was someone else.

Peter
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 01-18-2008, 07:25 AM
Davide Bianchi
 
Posts: n/a
Default Re: Where did dhcp go?

On 2005-04-14, Michael Hennebry <hennebry@web.cs.ndsu.nodak.edu> wrote:
> It just issues reads and writes?


Yes.

> The block sizes just affect how much
> it tries to read and write at a time?


Yes.

>> > How about dd if=/dev/hdc of=/dev/hdd ?

> Would this actually work?


Always done this way, never had a problem.

> mkisofs's job is to make such a file
> that corresponds to an ISO file system.


Exactly.

> If I wanted, I could take any 800MB file and pass it to cdrecord.
> If my CD-R is big enough, reading that CD-R back would just
> be a matter of directly reading the correct /dev/* file.


Exactly.

>>From man cdrecord:


Hummm... my manpage doesn't report that, it does mention readcd
in the 'see also' section.

> It is, ifcfg-eth0:
> DEVICE=eth0
> BOOTPROTO=dhcp


then it should get his IP by dhcp.

> HOSTNAME=localhost.localdomain
> Is the fact that I can get to the
> internet evidence that DHCP is running?


Probably yes.

> Is a hostname of stmike evidence that it isn't running correctly?


Don't know your system enough to tell.
Davide

--
If at first you don't succeed, get a job with Microsoft.
-- Gareth Barnard
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 01-18-2008, 07:25 AM
Michael Hennebry
 
Posts: n/a
Default Re: Where did dhcp go?

Peter T. Breuer wrote:
> Michael Hennebry <hennebry@web.cs.ndsu.nodak.edu> wrote:


> > So dd doesn't have any device-specific knowledge built in?


> > > > Also, I don't have a /dev/cdrom.
> > > > How about dd if=/dev/hdc of=/dev/hdd ?

> >
> > Would this actually work?

>
> Why wouldn't it? It's just a "cp /dev/hdc /dev/hdd". All the data

goes
> from one side to the other.


Reasonable, but not obvious.
For all I knew bad things might happen if cp or dd
issued 3k reads and writes.

> > /etc/sysconfig/network:
> > NETWORKING=yes
> > HOSTNAME=localhost.localdomain

>
> That's the wrong name. "Localhost" means "me". You can't call

yourself
> "me" as a name. It's confusing! How will other people talk to you?


I know its wrong.
Others can ping me with my IP address, but ssh doesn't seem to work.
Eventually I got a Secure connection to 24.116.184.201 refused.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 01-18-2008, 07:25 AM
Nico Kadel-Garcia
 
Posts: n/a
Default Re: Where did dhcp go?


"Michael Hennebry" <hennebry@web.cs.ndsu.nodak.edu> wrote in message
news:1113518565.885758.74440@g14g2000cwa.googlegro ups.com...
> Peter T. Breuer wrote:
>> Michael Hennebry <hennebry@web.cs.ndsu.nodak.edu> wrote:

>
>> > So dd doesn't have any device-specific knowledge built in?

>
>> > > > Also, I don't have a /dev/cdrom.
>> > > > How about dd if=/dev/hdc of=/dev/hdd ?
>> >
>> > Would this actually work?

>>
>> Why wouldn't it? It's just a "cp /dev/hdc /dev/hdd". All the data

> goes
>> from one side to the other.

>
> Reasonable, but not obvious.
> For all I knew bad things might happen if cp or dd
> issued 3k reads and writes.


"cp -a" would copy the block device, not the contents of it.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 01-18-2008, 07:25 AM
Michael Hennebry
 
Posts: n/a
Default Re: Where did dhcp go?

Davide Bianchi wrote:
> On 2005-04-14, Michael Hennebry <hennebry@web.cs.ndsu.nodak.edu>

wrote:

> > It is, ifcfg-eth0:
> > DEVICE=eth0
> > BOOTPROTO=dhcp

>
> then it should get his IP by dhcp.


I can't find a dhcp executable anywhere.
There are dhclient, dhcp6c, and dhclient-script.
dhclient is the only one running.
According to ps its WCHAN is -.
Is that the way it is supposed to be?

> > HOSTNAME=localhost.localdomain
> > Is the fact that I can get to the
> > internet evidence that DHCP is running?

>
> Probably yes.
>
> > Is a hostname of stmike evidence that it isn't running correctly?

>
> Don't know your system enough to tell.


I finally found another reference to stmike.
It's listed in dhclient-eth0.leases.
There are two leases.
Each has the line
option host-name "stmike";
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 07:35 AM.


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