LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-16-2009, 01:01 AM   #1
rahulmishra1312
LQ Newbie
 
Registered: Mar 2009
Posts: 10

Rep: Reputation: Disabled
How to create file systems at run time


Hi,

I've only a root file system of 100 GB on my Red Hat Linux PC.
Now I want it to break down into 2 or more file systems. Can it be done at run time, If yes then what are the steps for doing so.

Thanks
Rahul
 
Old 04-16-2009, 01:32 AM   #2
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,278

Rep: Reputation: 148Reputation: 148
Filesystem means a method for storing and organizing computer files and the data(windows using NTFS & FAT, Linux using ext2 & ext3) here you want to partation your disk. try with gparted it may be helpful
http://gparted.sourceforge.net/
 
Old 04-16-2009, 01:41 AM   #3
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 66
You cannot do this live. But offline, gparted should indeed be able to do what you want. Don't forget to do backups.

Yves.
 
Old 04-16-2009, 01:50 AM   #4
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,039

Rep: Reputation: 98
It depends on your Red Hat installation, if you chose to use LVM when you installed Red Hat, then you can reduce the size of the partition whilst it is running (although I would ensure I had a clean backup before making the attempt). You could then create a new partition on the free space.

This is possible because the disk is allocated to LVM and LVM is changing how it's utilising the disk.

I don't believe you should use Gparted or other methods of changing partition size (fdisk) if you are using LVM.

EDIT: Cannot reduce whilst running only increase

Last edited by Disillusionist; 04-17-2009 at 11:20 AM.
 
Old 04-16-2009, 02:22 AM   #5
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 66
Disillusionist is right about LVM. However, to my knowledge, it doesn't apply to the “/” (aka. root) partition. Besides, although resizing partitions in a live system is possible, I don't know of a filesystem that allows resizing while mounted (hence the “/” restriction).

Yves.
 
Old 04-16-2009, 02:28 AM   #6
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,039

Rep: Reputation: 98
I have resized mounted partitions on RHEL with LVM (even when being actively used), although I have never tried on the / partition.
 
Old 04-17-2009, 01:50 AM   #7
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 66
That is good news! How did you do that, and with what filesystem?

Yves.
 
Old 04-17-2009, 01:58 AM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
To do a reduce on an LVM / ext3 system

Code:
df -h /data
umount /data
e2fsck -f /dev/vg0/data
resize2fs /dev/vg0/data 128M
lvreduce -L 128M /dev/vg0/data
mount /dev/vg0/data /data
df h /data
Always take 1+ backups before starting and try not to be using that fs.
Might not work on '/', you'd probably reboot & use 'linux rescue' mode from the install DVD; should be mounted under /mnt/sysimage
 
Old 04-17-2009, 11:17 AM   #9
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,039

Rep: Reputation: 98
Quote:
Originally Posted by theYinYeti View Post
That is good news! How did you do that, and with what filesystem?

Yves.
You can increase the size of a logical volume whilst it is mounted, what you can't do is decrease the size whilst it is mounted

On RHEL (same for CentOS) go into system-config-lvm

Select the volume to be modified, and click Edit Properties.

Set the new size and click OK

If you are reducing the size, you will be told that the filesystem needs to be unmounted and asked if it's ok to unmount the filesystem and continue, if you are increasing it will just continue.

Just tested and increased size of / on the fly

You can even run df -k on the mount point and watch as the size is increased

Last edited by Disillusionist; 04-17-2009 at 11:23 AM.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need some detail information on Hard Real-Time Systems and Soft real-Time Systems. LinuxInfo General 3 09-22-2008 03:25 AM
Red hat Install: "No valid devices found on which to create new file systems" Lucky_69 Linux - Software 1 02-06-2007 09:19 PM
Is it possible to create a new syslog file at boot time? snuffy115 Debian 1 12-22-2006 08:12 PM
How to create a run-time executable from another exec + inputs? R00ts Linux - General 3 02-18-2006 04:52 PM
Error: No valid devices to create new file systems Lossenelin Linux - Hardware 6 09-27-2002 12:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:30 AM.

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