LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Enterprise (http://www.linuxquestions.org/questions/linux-enterprise-47/)
-   -   expanding file systems and disk space (http://www.linuxquestions.org/questions/linux-enterprise-47/expanding-file-systems-and-disk-space-369346/)

jmickens 10-03-2005 08:58 AM

expanding file systems and disk space
 
I've inherited a RH Linux AS2.1 ES at a remote location. I've been using HP-UX 10.20 for years, but am pretty new to linux. I have a few questions hopefully someone can answer.

I need to expand disk space on one of the server's file systems. I believe there is unused disk space in the server. The following seems to indicate that as well:
[root@plaus07]# /sbin/fdisk -l

Disk /dev/sda: 255 heads, 63 sectors, 17834 cylinders
Units = cylinders of 16065 * 512 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 4 32098+ de Dell Utility
/dev/sda2 5 657 5245222+ 83 Linux
/dev/sda3 * 658 670 104422+ 83 Linux
/dev/sda4 671 17834 137869830 5 Extended
/dev/sda5 671 931 2096451 82 Linux swap
/dev/sda6 932 1192 2096451 82 Linux swap
/dev/sda7 1193 1453 2096451 82 Linux swap
/dev/sda8 1454 2106 5245191 83 Linux
/dev/sda9 2107 2921 6546456 83 Linux
/dev/sda10 2922 3052 1052226 83 Linux
/dev/sda11 3053 3117 522081 83 Linux

Disk /dev/sdb: 255 heads, 63 sectors, 71338 cylinders
Units = cylinders of 16065 * 512 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 2611 20972826 83 Linux
/dev/sdb2 2612 20887 146801970 83 Linux
/dev/sdb3 20888 24150 26210047+ 83 Linux
/dev/sdb4 24151 71338 379037610 f Win95 Ext'd (LBA)
/dev/sdb5 24151 24803 5245191 83 Linux
/dev/sdb6 24804 37857 104856223+ 83 Linux
/dev/sdb7 37858 38379 4192933+ 83 Linux

[root@plaus07]# df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/sda10 1035660 318868 664184 33% /
/dev/sda3 101107 34494 61392 36% /boot
none 2059344 0 2059344 0% /dev/shm
/dev/sda8 5162796 33740 4866800 1% /tmp
/dev/sda9 6443584 1640524 4475740 27% /usr
/dev/sda11 505605 449020 30481 94% /var
/dev/sda2 5162828 1422052 3478516 30% /home
/dev/sdb1 20641788 8678208 10914940 45% /online_arc
/dev/sdb3 25798712 3232384 21255828 14% /sas
/dev/sdb5 5162796 594308 4306232 13% /opt
/dev/sdb6 103210940 88974380 8993752 91% /prod
/dev/sdb7 4127076 32828 3884604 1% /backup
/dev/sdb2 144492840 28319208 108833536 21% /oracle

From this, it looks to me like sda is not using cylinders 3118 through 17834 and sdb is not using cylinders 38380 through 71338.

If this is the case, can I just use lvm to add disk space to /dev/sdb1? Can I create additional volumes on the unused cylinders?

Also, I'm used to doing disk management through SAM under HP-UX. Is there a similar utility, or at least one for the disk space, that I can use under Linux? Since the server is remote, I have to use XWin32 to SSH into the box to use any gui utilities. I've found a couple for user and printer management, but haven't spotted any disk managment ones yet.

Brian1 10-03-2005 10:39 AM

You can use the app called parted to expand and shrink partitions. Similiar to partition magic for windows. If you have a gui up then you can use qtparted for the frontend to parted.

Looks like the the last partition /dev/sda11 is pretty full. Looks like var is pretty same anyways. Depending on some configurations the local root mail box may have messages stating the partition is getting full. But not familiar with that distro version.

Things that can fill /var
One thing that could have the /dev/sda11 partition so full is log files under /var/log. Probalby the messages one is quite large and needs to be trimmed down. Also /var/spool/mail is where mailboxes are located. You can check those and see what size some are.

Also if you type ' df -h ' it will bee a little more easier to read.

Hope this helps
Brian

jmickens 10-05-2005 01:30 PM

Helps somewhat - thanks. In looking at my output from fdisk, does it look to you like I have additional disk space available?

If I needed to expand /var (which is /dev/sda11), how exactly would I do that ? I've never used parted before (nor fdisk under linux for that matter).

The biggest thing I need to do is to make /dev/sdb1 (/online_arc) 60GB instead of it's current 20GB. Can I add space to it, or do I have to create a new partition and move the file system?

# /sbin/parted /dev/sda print
Disk geometry for /dev/sda: 0.000-139900.000 megabytes
Disk label type: msdos
Minor Start End Type Filesystem Flags
1 0.031 31.376 primary FAT
2 31.377 5153.664 primary ext3
3 5153.665 5255.639 primary ext3 boot
4 5255.640 139894.145 extended
5 5255.670 7302.985 logical linux-swap
6 7303.017 9350.332 logical linux-swap
7 9350.363 11397.678 logical linux-swap
8 11397.709 16519.965 logical ext3
9 16519.997 22913.020 logical ext3
10 22913.051 23940.615 logical ext3
11 23940.646 24450.490 logical ext3

# /sbin/parted /dev/sdb print
Disk geometry for /dev/sdb: 0.000-559600.000 megabytes
Disk label type: msdos
Minor Start End Type Filesystem Flags
1 0.031 20481.306 primary ext3
2 20481.306 163842.604 primary ext3
3 163842.605 189438.354 primary ext3
4 189438.354 559592.270 extended lba
5 189438.385 194560.642 logical ext3
6 194560.673 296959.328 logical ext3
7 296959.359 301054.021 logical ext3

basemodel 10-07-2005 11:29 PM

You can add free space to the partition if you have spare free space available. The better alternative is to use LVM partitions next time (I know this is after the fact).

jmickens 10-13-2005 12:04 PM

sorry about the newbie question
 
I, unfortunately, didn't get to set up the server. LVM I am familiar with and would be able to do it. Can anyone tell me what exact steps I need to take to do what I need to do so I don't screw up this production server?


All times are GMT -5. The time now is 09:08 AM.