LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-17-2010, 08:22 AM   #1
richinsc
Member
 
Registered: Mar 2007
Location: Utah
Distribution: Ubuntu Linux (20.04)
Posts: 224

Rep: Reputation: 32
Reducing /tmp expanding /usr space


I have a request to shrink /tmp and expand /usr on a server. No problem, or so I thought. When I took a look at the partition table I saw this below.

Code:
/dev/cciss/c0d0p2     981M  216M  715M  24% /
udev                 1014M  136K 1014M   1% /dev
/dev/cciss/c0d0p1     102M     0  102M   0% /altboot
/dev/cciss/c0d0p6     145M  5.6M  132M   5% /dsm
/dev/cciss/c0d1p7     2.9G  634M  2.2G  23% /opt
/dev/cciss/c0d0p7     3.9G  2.5G  1.3G  67% /usr
/dev/cciss/c0d1p6     2.0G  233M  1.6G  13% /var
/dev/md0              187G  189M  177G   1% /tmp
And the following entries in fstab

Code:
/dev/disk/by-id/cciss-3600508b1001fffffa00c10a8ff970006-part2 /                    ext3       acl,user_xattr        1 1
/dev/disk/by-id/cciss-3600508b1001fffffa00c10a8ff970006-part1 /altboot             vfat       users,gid=users,umask=0002,utf8=true 0 0
/dev/disk/by-id/cciss-3600508b1001fffffa00c10a8ff970006-part6 /dsm                 ext3       acl,user_xattr        1 2
/dev/disk/by-id/cciss-3600508b1001fffffa0107e475dea0008-part7 /opt                 ext3       acl,user_xattr        1 2
/dev/md0             /tmp                 ext3       defaults              1 2
/dev/disk/by-id/cciss-3600508b1001fffffa00c10a8ff970006-part7 /usr                 ext3       acl,user_xattr        1 2
/dev/disk/by-id/cciss-3600508b1001fffffa0107e475dea0008-part6 /var                 ext3       acl,user_xattr        1 2
/dev/disk/by-id/cciss-3600508b1001fffffa00c10a8ff970006-part5 swap                 swap       defaults              0 0
/dev/disk/by-id/cciss-3600508b1001fffffa0107e475dea0008-part5 swap                 swap       defaults              0 0
proc                 /proc                proc       defaults              0 0
sysfs                /sys                 sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
usbfs                /proc/bus/usb        usbfs      noauto                0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0
/dev/fd0             /media/floppy        auto       noauto,user,sync      0 0
Question is how do I deal with resizing /tmp when it doesn't look to be part of the same device? I can only assume that there is some software raid going on maybe when I shift partions around and whatnot I am used to seeing /dev/sda or /dev/hdb like devices.

I'm looking for suggestions on how to got about shrinking /tmp and expanding /var without having to re-install the server. Since this server has no gui, it's going to be difficult as I only have gpart installed and not gparted which is more gui based.

Are the device id's /dev/disk/by-id/cciss-3600508b1001fffffa00c10a8ff970006 from a hardware raid solution while md0 is a software? I'm just trying to understand the id scheme to determine if these disks are part of the same set.

Last edited by richinsc; 03-17-2010 at 08:28 AM. Reason: Clarificaiton of question
 
Old 03-17-2010, 08:43 AM   #2
richinsc
Member
 
Registered: Mar 2007
Location: Utah
Distribution: Ubuntu Linux (20.04)
Posts: 224

Original Poster
Rep: Reputation: 32
After doing a bit more research I found that md0 is a software raid of disk from each of the others. I still don't understand how I am going to be able to use this info. I may just break up the md0 and have /usr be on the larger disk.

Code:
/dev/md0:
        Version : 00.90.03
  Creation Time : Fri Mar  5 20:02:46 2010
     Raid Level : raid0
     Array Size : 198659520 (189.46 GiB 203.43 GB)
   Raid Devices : 2
  Total Devices : 2
Preferred Minor : 0
    Persistence : Superblock is persistent

    Update Time : Fri Mar  5 20:02:46 2010
          State : clean
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

     Chunk Size : 64K

           UUID : d6be963d:b453b5c5:269d7caa:760f3029
         Events : 0.1

    Number   Major   Minor   RaidDevice State
       0     104        8        0      active sync   /dev/cciss/c0d0p8
       1     104       24        1      active sync   /dev/cciss/c0d1p8
 
Old 03-17-2010, 10:32 AM   #3
richinsc
Member
 
Registered: Mar 2007
Location: Utah
Distribution: Ubuntu Linux (20.04)
Posts: 224

Original Poster
Rep: Reputation: 32
I think I figured out a way for this, I'll document it for all to see.
 
Old 03-17-2010, 10:37 AM   #4
avtandil_k
Member
 
Registered: Feb 2010
Distribution: CentOS,openSUSE
Posts: 30

Rep: Reputation: 16
Thanks! I actually marked this thread to check out later what people said because I have no idea how to do that.
 
Old 03-18-2010, 11:34 AM   #5
richinsc
Member
 
Registered: Mar 2007
Location: Utah
Distribution: Ubuntu Linux (20.04)
Posts: 224

Original Poster
Rep: Reputation: 32
1. df -h
Code:
Filesystem            Size  Used Avail Use% Mounted on
/dev/cciss/c0d0p2     981M  216M  715M  24% /
udev                 1014M  136K 1014M   1% /dev
/dev/cciss/c0d0p1     102M     0  102M   0% /altboot
/dev/cciss/c0d0p6     145M  5.6M  132M   5% /dsm
/dev/cciss/c0d1p7     2.9G  634M  2.2G  23% /opt
/dev/cciss/c0d0p7     3.9G  2.5G  1.3G  67% /usr
/dev/cciss/c0d1p6     2.0G  233M  1.6G  13% /var
/dev/md0              187G  189M  177G   1% /tmp
2. cat /etc/fstab
Code:
/dev/disk/by-id/cciss-3600508b1001fffffa00c10a8ff970006-part2 /                    ext3       acl,user_xattr        1 1
/dev/disk/by-id/cciss-3600508b1001fffffa00c10a8ff970006-part1 /altboot             vfat       users,gid=users,umask=0002,utf8=true 0 0
/dev/disk/by-id/cciss-3600508b1001fffffa00c10a8ff970006-part6 /dsm                 ext3       acl,user_xattr        1 2
/dev/disk/by-id/cciss-3600508b1001fffffa0107e475dea0008-part7 /opt                 ext3       acl,user_xattr        1 2
/dev/md0             /tmp                 ext3       defaults              1 2
/dev/disk/by-id/cciss-3600508b1001fffffa00c10a8ff970006-part7 /usr                 ext3       acl,user_xattr        1 2
/dev/disk/by-id/cciss-3600508b1001fffffa0107e475dea0008-part6 /var                 ext3       acl,user_xattr        1 2
/dev/disk/by-id/cciss-3600508b1001fffffa00c10a8ff970006-part5 swap                 swap       defaults              0 0
/dev/disk/by-id/cciss-3600508b1001fffffa0107e475dea0008-part5 swap                 swap       defaults              0 0
proc                 /proc                proc       defaults              0 0
sysfs                /sys                 sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
usbfs                /proc/bus/usb        usbfs      noauto                0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0
/dev/fd0             /media/floppy        auto       noauto,user,sync      0 0
3. fdisk -l
4. umount /tmp
5. mdadm --misc -D /dev/md0
6. mdadm --manage -S /dev/md0
7. mdadm --manage /dev/md0 --remove
8. mv /etc/mdadm.conf /etc/mdadm.old10
9. cfdisk /dev/disk/by-id/cciss-3600508b1001fffffa00c10a8ff970006
10. cfdisk /dev/disk/by-id/cciss-3600508b1001fffffa0107e475dea0008
11. Delete /dev/disk/by-id/cciss-3600508b1001fffffa0107e475dea0008-part8, Recreate logical partition
12. mkfs.ext3 /dev/disk/by-id/cciss-3600508b1001fffffa0107e475dea0008-part8
Code:
  
mke2fs 1.38 (30-Jun-2005)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
16891904 inodes, 33754565 blocks
1687728 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=37748736
1031 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424, 20480000, 23887872

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 26 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
14. vim /etc/fstab change /dev/md0 to part8, save changes
Code:
/dev/disk/by-id/cciss-3600508b1001fffffa00c10a8ff970006-part2 /                    ext3       acl,user_xattr        1 1
/dev/disk/by-id/cciss-3600508b1001fffffa00c10a8ff970006-part1 /altboot             vfat       users,gid=users,umask=0002,utf8=true 0 0
/dev/disk/by-id/cciss-3600508b1001fffffa00c10a8ff970006-part6 /dsm                 ext3       acl,user_xattr        1 2
/dev/disk/by-id/cciss-3600508b1001fffffa0107e475dea0008-part7 /opt                 ext3       acl,user_xattr        1 2
/dev/disk/by-id/cciss-3600508b1001fffffa0107e475dea0008-part8 /tmp                 ext3       defaults              1 2
/dev/disk/by-id/cciss-3600508b1001fffffa00c10a8ff970006-part7 /usr                 ext3       acl,user_xattr        1 2
/dev/disk/by-id/cciss-3600508b1001fffffa0107e475dea0008-part6 /var                 ext3       acl,user_xattr        1 2
/dev/disk/by-id/cciss-3600508b1001fffffa00c10a8ff970006-part5 swap                 swap       defaults              0 0
/dev/disk/by-id/cciss-3600508b1001fffffa0107e475dea0008-part5 swap                 swap       defaults              0 0
proc                 /proc                proc       defaults              0 0
sysfs                /sys                 sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
usbfs                /proc/bus/usb        usbfs      noauto                0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0
/dev/fd0             /media/floppy        auto       noauto,user,sync      0 0
15. mount /tmp
16. df -h
14. lsof /usr #Can't umount because of disk in use, thus can't expand
16. Drop into iLO Conosole to boot Single User Mode (Server is in Oregon, I'm in South Carolina)
17. Unable to use parted as it resided in /usr
18. Boot Knoppix (This took a long time to do remotely)
19. Resize using gparted
20. Reboot, Done
21. Login, check disks
Code:
df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/cciss/c0d0p2     981M  217M  715M  24% /
udev                 1014M  132K 1014M   1% /dev
/dev/cciss/c0d0p1     102M     0  102M   0% /altboot
/dev/cciss/c0d0p6     145M  5.6M  132M   5% /dsm
/dev/cciss/c0d1p7     2.9G  634M  2.2G  23% /opt
/dev/cciss/c0d1p8     127G  189M  121G   1% /tmp
/dev/cciss/c0d0p7      64G  2.5G   58G   5% /usr
/dev/cciss/c0d1p6     2.0G  234M  1.6G  13% /var
22. fdisk -l
Code:
Disk /dev/cciss/c0d0: 72.8 GB, 72833679360 bytes
255 heads, 63 sectors/track, 8854 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

           Device Boot      Start         End      Blocks   Id  System
/dev/cciss/c0d0p1               1          13      104391    c  W95 FAT32 (LBA)
/dev/cciss/c0d0p2              14         140     1020127+  83  Linux
/dev/cciss/c0d0p3             141        8854    69995205    f  W95 Ext'd (LBA)
/dev/cciss/c0d0p5             141         402     2104483+  82  Linux swap / Solaris
/dev/cciss/c0d0p6             403         421      152586   83  Linux
/dev/cciss/c0d0p7             422        8854    67738041   83  Linux

Disk /dev/cciss/c0d1: 145.6 GB, 145667358720 bytes
255 heads, 63 sectors/track, 17709 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

           Device Boot      Start         End      Blocks   Id  System
/dev/cciss/c0d1p1               1       17709   142247511    f  W95 Ext'd (LBA)
/dev/cciss/c0d1p5               1         262     2104452   82  Linux swap / Solaris
/dev/cciss/c0d1p6             263         517     2048256   83  Linux
/dev/cciss/c0d1p7             518         900     3076416   83  Linux
/dev/cciss/c0d1p8             901       17709   135018261   83  Linux
I apologize for not gathering output of steps 3 - 11 I wasn't thinking about this when I was doing steps. By the way the Server was an HP DL380 G3 I think... Might have been G4, can't remember.

Last edited by richinsc; 03-18-2010 at 11:35 AM. Reason: Improper syntax
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Available hard disk space reducing(consumed) extremely fast kagara Linux - Software 1 09-16-2008 07:37 AM
Disk space after expanding volume Corrado Linux - General 1 05-07-2007 02:16 PM
no /usr/tmp otoomet Debian 2 12-13-2005 01:08 PM
expanding file systems and disk space jmickens Linux - Enterprise 4 10-13-2005 12:04 PM
Reducing size of /usr/local/src jrdioko Linux - Software 8 06-09-2005 10:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration