1833055 Members
2640 Online
110049 Solutions
New Discussion

A couple of questions

 
carl_46
Advisor

A couple of questions

What command do yo use to verify wether you are running a 32 or 64 bit os?

How do you expand an / HFS file system? I know you can't just expand it because its mounted so I assume you boot from the CD and go to the shell, but then what?

What is chroot use for?

Regards
4 REPLIES 4
Andy Monks
Honored Contributor

Re: A couple of questions

Seb,

To check if you running 32/64 bit :-

a) file /stand/vmunix (if it says ELF then your 64 bit)
b) use getconf (can't remember which option)

To expand a HFS filesystem, first extend the logical volume using lvextend (this can be done online) and then extend the filesystem with 'extendfs' which can't be done online

As for chroot. Mainly used for ftp these days. The support media also uses it. I allows you to assume another directory as root. Obviously any commands you may want to use must be present under the new directory.

For example :-

chroot /tmp/myroot /usr/bin/sh

Will put you in the /tmp/myroot directory. However, it's now the root. So 'ls /' gives the contents of /tmp/myroot. However, Unless under /tmp/myroot/usr/bin' you have the ls command it won't work. If you have anon ftp setup cd ~ftp and browse under there (in etc, bin, usr) as anon ftp uses it
Andy Monks
Honored Contributor

Re: A couple of questions

getconf KERNEL_BITS
carl_46
Advisor

Re: A couple of questions

Oh yes I forgot my last question.

What is the function of a semaphore?

Regards
Alan Riggs
Honored Contributor

Re: A couple of questions

A semaphore is a structure in shared memory (a bit vecor, in most architectures). You can think of it like a toggle switch. A semaphore may be set or unset. Semaphores are used as a signal to the OS (or some other controlling program). Semaphores may be used for many purposes, but resource locking is one of the more common.