LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   mount file system (https://www.linuxquestions.org/questions/linux-newbie-8/mount-file-system-807358/)

kais1 05-12-2010 07:06 AM

mount file system
 
Dear all,

We are running RHEL ES 4.0


We have root file system with 600GB. we created a directory called
u01 inside root , now we want to mount this directory u01 inside root
as a new file system /u01 with 500 GB allocated to it..

How can I do this ?


Kai

MensaWater 05-12-2010 07:15 AM

If I read you correctly you're saying you want to take 500GB of the 600GB root and make it a separate filesystem mounted as /u01?

It doesn't work like that. You'd have to reduce the root filesystem to 100 GB then create a new filesystem of 500 GB and mount that. That is to say you don't allocate from root - you allocate from free space and if root has it all allocated then you don't have any free space.

Reducing a filesystem would depend on many things:
Is it a partition? a logical volume? a software raid (meta disk)?
How full is root currently?
How old is this filesystem?

Doing this for any filesystem would be tricky - doing it for root could be very tricky indeed. Reducing a filesystem or its underlying device can lose data depending on where it is on disk.

kais1 05-12-2010 07:18 AM

Quote:

Originally Posted by MensaWater (Post 3965678)
If I read you correctly you're saying you want to take 500GB of the 600GB root and make it a separate filesystem mounted as /u01?

It doesn't work like that. You'd have to reduce the root filesystem to 100 GB then create a new filesystem of 500 GB and mount that. That is to say you don't allocate from root - you allocate from free space and if root has it all allocated then you don't have any free space.

Reducing a filesystem would depend on many things:
Is it a partition? a logical volume? a software raid (meta disk)?
How full is root currently?
How old is this filesystem?

Doing this for any filesystem would be tricky - doing it for root could be very tricky indeed. Reducing a filesystem or its underlying device can lose data depending on where it is on disk.

Thanks for your patience and your elaborated answer,


If I read you correctly you're saying you want to take 500GB of the 600GB root and make it a separate filesystem mounted as /u01?

Yes

It doesn't work like that. You'd have to reduce the root filesystem to 100 GB then create a new filesystem of 500 GB and mount that. That is to say you don't allocate from root - you allocate from free space and if root has it all allocated then you don't have any free space.


How can I reduce the root file system t0 100GB ?

Reducing a filesystem would depend on many things:
Is it a partition? a logical volume? a software raid (meta disk)?

Its a logical volume


How full is root currently?

its only 5% filled.

How old is this filesystem?

New server installed 1 month back.



Kai

catkin 05-12-2010 07:22 AM

You need to
  1. set a 500 GB volume (partition, logical volume, RAID or NAS volume ...).
  2. create a file system in the new volume.
  3. stop accessing any files under /u01 (safest to change to single user mode).
  4. mount the new file system somewhere, e.g. /mnt.
  5. copy everything from /u01 to /mnt using rsync or tar.
    [*mv /u01 as /u01.old.
  6. mkdir /uo1.
  7. create an fstab entry to mount the new file system on /u01.
  8. mount /u01.
  9. start up all you normally use.
  10. Test.
  11. (when all good) remove /u01.old

EDIT: In the light of new information (There was only the OP when I started composing it) the above omits the really interesting part about shrinking root :)

bret381 05-12-2010 07:25 AM

you can use something like gparted to reduce filesystems and create new partitions etc. However, make SURE you backup EVERYTHING. It should be fine, but things do happen when you start messing with filesystems. I have never reduced a partition by 500GB so who knows what will happen.
After you have your new partition creaded you can mount that partition as your new filesystem. It's generally best to do all this during your setup of Linux, but it's not impossible to do.

catkin 05-12-2010 07:32 AM

Quote:

Originally Posted by kais1 (Post 3965680)
Its a logical volume

Just to confirm ... Created by LVM? Or a logical partition?

EDIT: and which file system type is used for / ?


All times are GMT -5. The time now is 05:19 AM.