Vous êtes sur la page 1sur 6

HOW TO INCREASE HARD DISK SPACE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The Problem and Its Solution ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ I have an 8 GB HDD, 4GB

is already installed with FC5 Linux, I ran out of disk space on /tmp while trying to do a liveCD iso image. The live cd iso image was being created in /tmp. The solution is to partition another partition on the remaining space on the HDD and then delete the /tmp directory and re-mount /tmp on the new partition At start my partitions are as follows: /dev/hda1 /dev/hda2 I plan to create an extended partition /dev/hda3 and create a logical partition within it called /dev/hda5 Note that for IDE drives, logical partitions begin with 5, the numbers 1 - 4 are for primary partitions and extended partitions. Extended partitions are merely containers for logical partition. So, at the end, I should get something like this: /dev/hda1 /dev/hda2 /dev/hda3

-->

/dev/hda5

logical partition

Then to delete /tmp and recreate it then add an entry in /etc/fstab as follows: /dev/hda5 /tmp ext3 defaults 0 0

THE PROCESS IN DETAIL: ~~~~~~~~~~~~~~~~~~~~ So i do this first: fdisk /dev/hda type n to create new partition select e

for extended partition then select 3 for 3rd partition. Since there is already /dev/hda1 and /dev/hda2. An extended partition /dev/hda3 is now created. You must now create a logical partition inside the /dev/hda3 extended partition. fdisk again and select create logical partition. Use the default cylinder numbers. If you did not create a logical partition, and mke2fs -j /dev/hda3 you will get an error: "Invalid argument passed to ext2 library while setting up superblock" This is because /dev/hda3 is only a container for logical drives. Then select t, to toggle partition ID, type L to list types. select 85 for Linux Extended. Then z to write to disk and exit. Then reboot. The whole trasaction is reproduced below: -------------------start----------------------[root@fc5lpi /]# fdisk /dev/hda The number of cylinders for this disk is set to 1027. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) Command (m for help): p Disk /dev/hda: 8455 MB, 8455200768 bytes 255 heads, 63 sectors/track, 1027 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot /dev/hda1 * /dev/hda2 Start 1 511 End 510 559 Blocks 4096543+ 393592+ Id 83 82 System Linux Linux swap / Solaris you did this:

Command (m for help): p Disk /dev/hda: 8455 MB, 8455200768 bytes 255 heads, 63 sectors/track, 1027 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System

/dev/hda1 /dev/hda2

1 511

510 559

4096543+ 393592+

83 82

Linux Linux swap / Solaris

Command (m for help): m Command action a toggle a bootable flag b edit bsd disklabel c toggle the dos compatibility flag d delete a partition l list known partition types m print this menu n add a new partition o create a new empty DOS partition table p print the partition table q quit without saving changes s create a new empty Sun disklabel t change a partition's system id u change display/entry units v verify the partition table w write table to disk and exit x extra functionality (experts only) Command (m for help): n Command action e extended p primary partition (1-4) e Partition number (1-4): 1 Partition 1 is already defined. Command (m for help): n Command action e extended p primary partition (1-4) e Partition number (1-4): 2 Partition 2 is already defined.

Delete it before re-adding it.

Delete it before re-adding it.

Command (m for help): n Command action e extended p primary partition (1-4) e Partition number (1-4): 3 First cylinder (560-1027, default 560): Using default value 560 Last cylinder or +size or +sizeM or +sizeK (560-1027, default 1027): 793 Command (m for help): p Disk /dev/hda: 8455 MB, 8455200768 bytes 255 heads, 63 sectors/track, 1027 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot /dev/hda1 * /dev/hda2 Start 1 511 End 510 559 Blocks 4096543+ 393592+ Id 83 82 System Linux Linux swap / Solaris

/dev/hda3

560

793

1879605

Extended

Command (m for help): m Command action a toggle a bootable flag b edit bsd disklabel c toggle the dos compatibility flag d delete a partition l list known partition types m print this menu n add a new partition o create a new empty DOS partition table p print the partition table q quit without saving changes s create a new empty Sun disklabel t change a partition's system id u change display/entry units v verify the partition table w write table to disk and exit x extra functionality (experts only) Command (m for help): t Partition number (1-5): 3 Hex code (type L to list codes): L 0 Empty 1 FAT12 2 XENIX root (FAT3 XENIX usr (FAT4 FAT16 <32M (FAT5 Extended 6 FAT16 7 HPFS/NTFS . 8 AIX 9 AIX bootable a OS/2 Boot Manag b W95 FAT32 c W95 FAT32 (LBA) e W95 FAT16 (LBA) f W95 Ext'd (LBA) 10 OPUS 12/16/ 11 Hidden FAT12 b 12 Compaq diagnost 14 Hidden FAT16 <3 16 Hidden FAT16 17 Hidden HPFS/NTF auto 18 AST SmartSleep 1b Hidden W95 FAT3 1c Hidden W95 FAT3 Hex code (type L to 1e 24 39 3c 40 41 42 4d 4e 4f 50 51 52 53 54 55 56 5c 61 63 64 Hidden W95 FAT1 80 NEC DOS 81 Plan 9 82 PartitionMagic Venix 80286 PPC PReP Boot SFS QNX4.x QNX4.x 2nd part QNX4.x 3rd part OnTrack DM OnTrack DM6 Aux CP/M OnTrack DM6 Aux OnTrackDM6 EZ-Drive Golden Bow Priam Edisk SpeedStor GNU HURD or Sys Novell Netware 83 84 85 86 87 88 8e 93 94 9f a0 a5 a6 a7 a8 a9 ab b7 Old Minix be Minix / old Lin bf Linux swap / So c1 Linux OS/2 hidden C: c4 c6 Solaris boot Solaris DRDOS/sec DRDOS/sec DRDOS/sec Syrinx Non-FS data CP/M / CTOS / Dell Utility BootIt DOS access DOS R/O SpeedStor BeOS fs EFI GPT EFI (FATLinux/PA-RISC SpeedStor SpeedStor DOS secondary Linux raid LANstep BBT

Linux extended c7 NTFS volume set da NTFS volume set db Linux plaintext Linux LVM Amoeba Amoeba BBT BSD/OS IBM Thinkpad hi FreeBSD OpenBSD NeXTSTEP Darwin UFS NetBSD Darwin boot BSDI fs de df e1 e3 e4 eb ee ef f0 f1 f4 f2 fd

65 Novell Netware b8 70 DiskSecure Mult bb 75 PC/IX list codes): 83

BSDI swap fe Boot Wizard hid ff

You cannot change a partition into an extended one or vice versa Delete it first. Command (m for help): p Disk /dev/hda: 8455 MB, 8455200768 bytes 255 heads, 63 sectors/track, 1027 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot /dev/hda1 * /dev/hda2 /dev/hda3 Start 1 511 560 End 510 559 793 Blocks 4096543+ 393592+ 1879605 Id 83 82 5 System Linux Linux swap / Solaris Extended

Command (m for help): fdisk /dev/hda <to create logical partition /dev/hda5> . . . ------------------end------------------------Then I did this: mke2fs -j /dev/hda5 the -j option is to create ext2 filesystem. Then I deleted /tmp, but tar cvf the contents first. Then recreate it : mkdir /tmp Then, I did: mount -t ext3 /dev/hda5 Then, chmod 777 /tmp Tested the directory, startx to see if system can write to it. Everything went well. So I edited /etc/fstab by adding the last line as follows: /tmp ext3 defaults 0 0 /tmp

/dev/hda5

and reboot to see if it works. Everything worked like a charm! I did df -h to check disk space and was happy to note the increaed /tmp directory.

Vous aimerez peut-être aussi