LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   / filesystem out of space (https://www.linuxquestions.org/questions/linux-newbie-8/filesystem-out-of-space-791189/)

sunandwavs 02-24-2010 01:59 AM

/ filesystem out of space
 
hi,

i just installed Fedora 12 (via vbox 3.1.4). stupidly i started with 8G and, of course, ran out of space on the / filesystem. i added 8G to the drive which now shows as 17G.
based on the below outputs, it looks like i have 8G more space available on the drive. based on reading other posts it looks like i need to use parted to increase the size but not sure how to do that. any help appreciated.


Code:

[root@fedora12 ~]# fdisk -l

Disk /dev/sda: 17.2 GB, 17179869184 bytes
255 heads, 63 sectors/track, 2088 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00096fdc

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *          1          26      204800  83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              26        1044    8181098+  8e  Linux LVM

Disk /dev/dm-0: 6262 MB, 6262095872 bytes
255 heads, 63 sectors/track, 761 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disk /dev/dm-0 doesn't contain a valid partition table

Disk /dev/dm-1: 2113 MB, 2113929216 bytes
255 heads, 63 sectors/track, 257 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disk /dev/dm-1 doesn't contain a valid partition table

Code:

[root@fedora12 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_fedora12-lv_root
                      5.8G  5.0G  481M  92% /
tmpfs                1008M  420K 1007M  1% /dev/shm
/dev/sda1            194M  54M  131M  30% /boot
[root@fedora12 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_fedora12-lv_root
                      5.8G  5.0G  481M  92% /
tmpfs                1008M  420K 1007M  1% /dev/shm
/dev/sda1            194M  54M  131M  30% /boot

Code:

[root@fedora12 ~]# df -i
Filesystem            Inodes  IUsed  IFree IUse% Mounted on
/dev/mapper/vg_fedora12-lv_root
                      382768  206746  176022  55% /
tmpfs                218155      10  218145    1% /dev/shm
/dev/sda1              51200      44  51156    1% /boot

Code:

[root@fedora12 ~]# mount
/dev/mapper/vg_fedora12-lv_root on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/sda1 on /boot type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
gvfs-fuse-daemon on /home/steve/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=steve)

Code:

[root@fedora12 ~]# parted
GNU Parted 1.9.0
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print all                                                       
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sda: 17.2GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End    Size    Type    File system  Flags
 1      32.3kB  210MB  210MB  primary  ext4        boot
 2      210MB  8587MB  8377MB  primary              lvm


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/vg_fedora12-lv_swap: 2114MB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End    Size    File system    Flags
 1      0.00B  2114MB  2114MB  linux-swap(v1)


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/vg_fedora12-lv_root: 6262MB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End    Size    File system  Flags
 1      0.00B  6262MB  6262MB  ext4

(parted) q   


irmin 02-24-2010 02:10 AM

You are using LVM for your partition. The physical partition already occupies the whole disk. You have to use lvextend to increase the partition size:
Code:

lvextend -L 14G vg_fedora12/lv_root
Will change the size of your logical volume vg_fedora12/lv_root to 14GiB.
Then call 'resize2fs /dev/mapper/vg_fedora12-lv_root' and have a look at 'df -h' again.

i92guboj 02-24-2010 03:03 AM

It's an lvm issue as pointed above. I will only add that gparted (nor even parted itself) has not any lvm capabilities, other than recognizing the volumes. Besides that, note that once the lvm volume has grown you will probably need to grow the file system inside of it. lvm has nothing to do with the fs. For ext2/3 you'd use resize2fs. There are similar tools for other fs's.

EDITED: random link illustrating the thing.
http://tldp.org/HOWTO/LVM-HOWTO/extendlv.html

sunandwavs 02-24-2010 11:06 PM

lvextend errors
 
Thanks for the quick response. I ran lvextend and received this error. My guess is the additional 8G added needs to be initialized perhaps??

Code:

[root@fedora12 steve]# lvextend -v -L 14G vg_fedora12/lv_root
    Finding volume group vg_fedora12
    Archiving volume group "vg_fedora12" metadata (seqno 3).
  Extending logical volume lv_root to 14.00 GB
  Insufficient free space: 2091 extents needed, but only 0 available
[root@fedora12 steve]#


chrism01 02-24-2010 11:51 PM

Well, what those quotes seem to say is (approx nums):

1. the disk is 17GB of which
2. 200MB is /boot
3. 8GB is LVM split 2 ways:
3a. 2 GB swap
3b. 6 GB usable Linux ie '/'
4. 8.x GB unpartitioned

You'll need to use fdisk or parted to assign the rest of the disk (sda3) to a partition; type 8e (lvm).
Use the pvcreate to make it avail to lvm system.

pvcreate /dev/sda3
vgextend vg_fedora12 /dev/sda3
lvextend -L +8G /dev/vg_fedora12/lv_root
resize2fs -p /dev/vg_fedora12/lv_root


NB: in order to avoid wasted space, use a much larger num in the lvextend cmd eg 10. This will tell you you don't have 10GB avail,but it will tell you how many extents avail. To avoid cvt extents to bytes, use the -l (lower L) switch with the num of extents from the error msg eg

lvextend -l <num-extents-avail> /dev/vg_fedora12/lv_root


See also http://tldp.org/HOWTO/LVM-HOWTO/ (NB: you have V2 of LVM).

sunandwavs 02-25-2010 12:23 AM

pvcreate error
 
i ran pvcreate and received the below error. how do i define sda3?

Code:

[root@fedora12 steve]# pvcreate /dev/sda3
  Device /dev/sda3 not found (or ignored by filtering).


sunandwavs 02-25-2010 05:01 PM

Solved. I found the solution at the Fedora forums.

Fedora has a Palimpsest Disk Utility GUI (Applications>SystemTools>DiskUtility) under which the new space can be partitioned. Then you invoke the LVM GUI (System>Administration>LogicalVolumeManagement) where you initialize and then convert to LVM and then add to the existing LVM group.

Thanks for the help.


All times are GMT -5. The time now is 03:58 AM.