Prev | Current Page 550 | Next

Christopher Negus

"Linux Bible, 2008 Edition: Boot up to Ubuntu, Fedora, KNOPPIX, Debian, openSUSE, and 11 Other Distributions"

In Linux, fdisk is a menu-based command. To use fdisk to list
all your partitions, type the following (as root user):
# fdisk ??“l
Disk /dev/sda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 4833 38716650 83 Linux
/dev/sda3 4834 4865 257040 82 Linux swap
To see how each partition is being used on your current system, type the following:
# df ??“h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 37G 5.4G 30G 16% /
/dev/sda1 99M 8.6M 86M 10% /boot
none 61M 0 61M 0% /dev/shm
From the output of df, you can see that the root of your Linux system (/) is on the /dev/sda2
partition and that the /dev/sda1 partition is used for /boot.
Before using fdisk to change your partitions, I strongly recommend running the df ??“h
command to see how your partitions are currently being defined. This will help reduce
the risk of changing or deleting the wrong partition.
To use fdisk to change your partitions, you need to identify the hard disk you are partitioning. For
example, the first IDE hard disk is identified as /dev/sda. So, to partition your first IDE hard drive,
you can begin (as root user) by typing:
# fdisk /dev/sda
For different hard drive types or numbers, /dev/sda is replaced by the name of the device you
want to work with.


Pages:
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