LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Viewing Partitions (https://www.linuxquestions.org/questions/linux-general-1/viewing-partitions-481013/)

carlosinfl 09-06-2006 02:06 PM

Viewing Partitions
 
We have a old RH9 Mail server we're going to retire and in its place add a Dell Server running RHEL4 ES. Is there a command where I can view how the disk is partitioned so I can determine if we need to make changes?

The mail server will house 300 users so if you also would like to add your recommended partitions with Dual 146GB SCSI drives running RAID1.

Thanks!

zhangmaike 09-06-2006 02:35 PM

Yes: fdisk.

See man fdisk.

carlosinfl 09-06-2006 02:52 PM

How does FDISK differ from the following command...it appears you have to convert the output from FDISK before you can understand it...

FDisk is the reason why I could never get a Slackware install because I never could understand how big I should make each partition using that format...very confusing.

Code:

df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2            1012M  256M  705M  27% /
/dev/sda1              99M  26M  69M  27% /boot
/dev/sda3              99G  18G  77G  19% /home
none                1009M    0 1009M  0% /dev/shm
/dev/sda6              32G  33M  30G  1% /share
/dev/sda9            4.0G  52M  3.7G  2% /tmp
/dev/sda8              16G  1.5G  14G  10% /usr
/dev/sda7              32G  3.7G  27G  13% /var
/dev/sda5              32G  852M  30G  3% /web


zhangmaike 09-06-2006 03:13 PM

The difference:
Code:

root@thinkpad:/home/zmk# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda8              11G  3.8G  6.2G  38% /
/dev/sda7              29G  7.9G  19G  30% /home
/dev/sda6              30G  4.2G  25G  15% /usr/local
tmpfs                252M  36K  251M  1% /tmp
tmpfs                252M  20K  251M  1% /var/run
tmpfs                252M    0  252M  0% /dev/shm
root@thinkpad:/home/zmk# fdisk -l

Disk /dev/sda: 80.0 GB, 80026361856 bytes
240 heads, 63 sectors/track, 10337 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1              1        9753    73732648+  5  Extended
/dev/sda2            9754      10337    4415040  12  Compaq diagnostics
/dev/sda5              1        133    1005417  82  Linux swap
/dev/sda6            134        4296    31472248+  83  Linux
/dev/sda7            4297        8265    30005608+  83  Linux
/dev/sda8            8266        9753    11249248+  83  Linux
root@thinkpad:/home/zmk#

df lists the free space of all mounted partitions, fdisk will edit/list ALL partitions (even if not mounted) without listing partitions that are on different disks or only in memory (like my various tmpfs mounts). If all you need is to know the layout of partitions, or the size of your drive, fdisk will suffice. If you want to know the amount of disk space available on each partition (something else altogether), df is what you need.

As for your past experiences with fdisk:
fdisk will accept partition sizes in meg. Instead of entering an ending cylinder number, enter +somenumberM. For example, a 256 meg partition would be +256M.

Knowing that, using fdisk is pretty simple. All commands are one letter long - just type the letter, press enter, and answer the very human-readable prompts. If you don't know which command to use, type m.

If you still can't stand fdisk, there's always cfdisk. cfdisk is identical to fdisk, except that it's curses based and provides a menu-like interface rather than prompts.

Quote:

FDisk is the reason why I could never get a Slackware install because I never could understand how big I should make each partition using that format...very confusing.
I usually just make the swap partition first, specifying a reasonable size, followed by the root partition of between 5-10G depending on the size of the drive. I then split the rest of the disk relatively evenly between /home and /usr/local.

carlosinfl 09-06-2006 04:57 PM

Thanks - that makes sence...


All times are GMT -5. The time now is 07:47 AM.