Operating System - Linux
1827424 Members
3842 Online
109965 Solutions
New Discussion

Moving other filesystem from root filesystem

 
Charles Egbon
Regular Advisor

Moving other filesystem from root filesystem

Hi Friends,

Please, I have installed SuSE Linux 8.2 (i586) - Kernel 2.4.20-4GB (4). And configured it to my network. But on running the following command I discovered that: /usr, /home, /opt, /tmp, /var, and /proc filesystem are all in root (/) filesystem. How do I move/recreate these filesystem to different partition?

Thanks.

Charles.

linux:~ # df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda2 9614600 1789056 7825544 19% /
shmfs 62676 0 62676 0% /dev/shm
linux:~ # df -k /
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda2 9614600 1789056 7825544 19% /
linux:~ # ls -l /
total 110
drwxr-xr-x 20 root root 464 2005-01-04 09:37 .
drwxr-xr-x 20 root root 464 2005-01-04 09:37 ..
drwxr-xr-x 2 root root 2112 2004-11-24 05:07 bin
drwxr-xr-x 3 root root 416 2005-01-07 04:50 boot
drwxr-xr-x 29 root root 94792 2005-01-07 05:01 dev
drwxr-xr-x 52 root root 5696 2005-01-07 05:04 etc
drwxr-xr-x 3 root root 72 2004-11-24 05:36 home
drwxr-xr-x 7 root root 2664 2004-11-24 05:00 lib
drwxr-xr-x 4 root root 96 2003-03-18 09:49 media
drwxr-xr-x 2 root root 48 2003-03-18 09:49 mnt
drwxr-xr-x 6 root root 152 2004-11-24 05:18 opt
dr-xr-xr-x 70 root root 0 2005-01-04 09:36 proc
drwx------ 12 root root 576 2005-01-07 04:38 root
drwxr-xr-x 3 root root 7064 2004-11-24 05:05 sbin
drwxr-xr-x 4 root root 96 2004-11-24 04:50 srv
drwxrwxrwt 21 root root 696 2005-01-07 05:15 tmp
drwxr-xr-x 12 root root 344 2004-11-24 05:02 usr
drwxr-xr-x 14 root root 360 2004-11-24 04:53 var
linux:~ # more /etc/fstab
/dev/hda2 / reiserfs defaults 1 1
/dev/hda1 swap swap pri=42 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0
proc /proc proc defaults 0 0
usbdevfs /proc/bus/usb usbdevfs noauto 0 0
/dev/cdrom /media/cdrom auto ro,noauto,user,exec 0 0
/dev/fd0 /media/floppy auto noauto,user,sync 0 0
linux:~ #



7 REPLIES 7
Chris Xu
Trusted Contributor

Re: Moving other filesystem from root filesystem

First of all, you know you don't have to move those filesystems to different partitions. If you realy want to, you have to find out if there is free space on /dev/hda drive or if there are other free partitions or drives in the system. Please type "fdisk -l " to display your partition info and we will see what you got.

Chris
NiCK_76
Respected Contributor

Re: Moving other filesystem from root filesystem

Hi,
1/You must ensure that have enough space for make new patition or add new disk to your system.
2/Backup directory which you want to recreate.
3/Create new partition and restore data to new partition.
4/Mount the new partition to directory which you want to recreate.
5/Edit file /etc/fstab , and add new line, i.e.
/dev/hda4 /yourdir reiserfs defaults 1 1
instead of hda4 and /yourdir for your adapt to real system.

NiCK
just for fun
Charles Egbon
Regular Advisor

Re: Moving other filesystem from root filesystem

Hi Chris,

Here is the requested info:
linux:~ # fdisk -l

Disk /dev/hda: 10.1 GB, 10110320640 bytes
255 heads, 63 sectors/track, 1229 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 1 32 257008+ 82 Linux swap
/dev/hda2 * 33 1229 9614902+ 83 Linux
linux:~ #
Chris Xu
Trusted Contributor

Re: Moving other filesystem from root filesystem

Hi Charles,

It looks there is only 1 disk (/dev/hda)with 2 partitions (hda1 and hda2) in the system. I saw no free space nor available partitions for you to move the filesystems to different partitions. You have to add disk(s) and replace the 10G disk with a bigger one to accomplish your goal, if you realy want to do so.


Chris
NiCK_76
Respected Contributor

Re: Moving other filesystem from root filesystem

Hi Charles,

It seems haven't free space to recreate new partition. And I give you 2 suggestion.
1/ add new harddisk to recreate new partition and mount point , like my foregoing suggestion.
2/ backup useful and important data , and reinstall os , recreate appropriate size partition, then restore data

NiCK
just for fun
Charles Egbon
Regular Advisor

Re: Moving other filesystem from root filesystem

Hi Guys,

Thanks for all your suggestion, I think, I will just backup relevant files and reinstall the OS. Though, I have being trying to dodge from reinstallation and adding more hard drives.

Cheers.

Charles
Charles Egbon
Regular Advisor

Re: Moving other filesystem from root filesystem

Thanks guys for all the suggestions.