?
Solved

Linux 9 edit /etc/fstab change partition

Posted on 2004-04-07
17
Medium Priority
?
1,180 Views
Last Modified: 2008-03-10
hi,

my current partition:

/dev/sda3 20161204 1500600 17636464 8% /
/dev/sda1 101089 14509 81361 16% /boot
/dev/sda5 20161172 446512 18690520 3% /home
/dev/sda2 20161204 557656 18579408 3% /home2
/dev/sdb2 20161204 32828 19104236 1% /home3
/dev/sdb1 20161172 32828 19104204 1% /home4
none 769936 0 769936 0% /dev/shm
/dev/sdb5 10080488 1766976 7801444 19% /var
/dev/sdb3 10080520 123560 9444892 2% /var/db
/dev/sdb6 10072456 32828 9527960 1% /var2


i would like to change
/dev/sdb3 10080520 123560 9444892 2% /var/db
change /var/db to /var3


please give the step.

thanx alot

0
Comment
Question by:qazakax
  • 6
  • 5
  • 2
  • +3
16 Comments
 
LVL 14

Accepted Solution

by:
Adrian Dobrota earned 200 total points
ID: 10781338
as you said in the Qs title ... just vi on your /etc/fstab file and change /var/db string with /var3
if you don't want this change to be effective only after a  reboot, then just unmount and mount /dev/sdb3 to /var3
I guess something is slipping me here .... you already seem to know what to do.
0
 
LVL 12

Expert Comment

by:stefan73
ID: 10781365
Hi qazakax,
Simply change the mount point of /var/db to /var3:

umount /var/db
mkdir /var3
mount -t ext2 /dev/sdb3 /var3 # Assuming ext2 FS, replace with your FS of choice

In case you already installed software on /var/db, you can also create a soft link in place of the old mount point:

rmdir /var/db
ln -s /var3 /var/db

Or you can do it the other way around, leaving /var/db as it is and just create a soft link for /var3:
ln -s /var/db/var3
This requires the least changes.

In case you change your partition mount points, don't forget to change /etc/fstab accordingly.

Cheers,
Stefan
0
 
LVL 12

Expert Comment

by:stefan73
ID: 10781368
Typo:
ln -s /var/db/var3

should read

ln -s /var/db /var3
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:qazakax
ID: 10782316
hi,

i follow the steps:

umount /var/db
mkdir /var3
mount -t ext3 /dev/sdb3 /var3 # My linux is EXT3

YES, the partition /var3 is done.

BUT ! after reboot, the machine is totally down:(, cannot ssh login ....

Any idea
0
 
LVL 14

Expert Comment

by:Adrian Dobrota
ID: 10782521
I don't get it .... sdb3 partition is on the machine you're phisically working on and you can't ssh on that machine anymore or waht ??
have you modified fstab too?
0
 

Author Comment

by:qazakax
ID: 10783056
Hi,

Yes, i follow this step by step, ssh login into linux server,then

umount /var/db
mkdir /var3
mount -t ext3 /dev/sdb3 /var3

DONE, the/var3 is success created.

then i edit /etc/fstab,change
LABEL=/var/db     /var/db                 ext3    defaults        1 2
to
LABEL=/var3         /var3                   ext3    defaults        1 2


Then i reboot the machine, eventually machine fail to boot into the linux system, i cannot remotely ssh login in the linux system, so i not sure what happen.

The only thing i do is change the /etc/fstab ...

any idea
0
 
LVL 14

Expert Comment

by:Adrian Dobrota
ID: 10783131
what's the error message you're getting when it doesn't boots? If no err msg, then what's the ;atest things you can see on the screen (probably daemons starting)
0
 
LVL 5

Expert Comment

by:pbhj
ID: 10783287
It sounds like you had something important in that /var/db directory. Linux needs to find all the boot stuff to setup the initial environment. So you can't have a System.map or kernel bzImage on a second partition or anything like that. Also, perhaps you had some /etc files soft linked to files on the /var/db parition???

Did you put in the soft links that stefan suggested?

If you use knoppix or a recovery disc is there anything interesting in /var/log/syslog or /var/log/messages??
0
 

Author Comment

by:qazakax
ID: 10784910



>>what's the error message you're getting when it doesn't boots? If no err msg, then what's >>the ;atest things you can see on the screen (probably daemons starting)

Basically i using REMOTE ssh login, i never knows what is the error on the console.

The only thing i did is, i edit the fstab, and reboot the machine. the machine doesn't boot in to linux,
so i fail to remote login again after reboot.
0
 

Author Comment

by:qazakax
ID: 10785131
Ok basically this is my /etc/fstab

Do i need to change
#LABEL=/var3             /var3                   ext3    defaults        1 2
to
/dev/sdb3    /var3                   ext3    defaults        1 2


[root@etc]# cat /etc/fstab
LABEL=/                 /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
none                    /dev/pts                devpts  gid=5,mode=620  0 0
LABEL=/home             /home                   ext3    defaults        1 2
LABEL=/home2            /home2                  ext3    defaults        1 2
LABEL=/home3            /home3                  ext3    defaults        1 2
LABEL=/home4            /home4                  ext3    defaults        1 2
none                    /proc                   proc    defaults        0 0
none                    /dev/shm                tmpfs   defaults        0 0
LABEL=/var              /var                    ext3    defaults        1 2
LABEL=/var2             /var2                   ext3    defaults        1 2
#LABEL=/var3             /var3                   ext3    defaults        1 2
/dev/sda6               swap                    swap    defaults        0 0
/dev/cdrom              /mnt/cdrom              udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/fd0                /mnt/floppy             auto    noauto,owner,kudzu 0 0
0
 

Author Comment

by:qazakax
ID: 10785364
Hi,

I found the "silly problem",

instead of edit /etc/fstab, change it:
LABEL=/var/db     /var/db                 ext3    defaults        1 2
to
LABEL=/var3         /var3                   ext3    defaults        1 2

changing to this, the linux machine is running well after reboot!
/dev/sdb3          /var3                   ext3    defaults        1 2

what wrong with "LABEL" ?
0
 

Expert Comment

by:Kanogurth
ID: 10789375
i'm a new guy in this enviroment, and something isn't clear to me...
Is really necesary to put a LABEL with the mount points in the fstab? i use rh9 and recently i changed the fstab to see the windows partitions, with no problems? it was lucky?

0
 
LVL 14

Expert Comment

by:Adrian Dobrota
ID: 10789849
I never used LABEL so .... I can't give you any advice on that. Glad that you solved the problem
0
 

Author Comment

by:qazakax
ID: 10801534

changing to this,
LABEL=/var/db     /var/db                 ext3    defaults        1 2
to
/dev/sdb3          /var3                   ext3    defaults        1 2

afterchange the "LAbel", Will this harmful to system?
0
 
LVL 14

Expert Comment

by:Adrian Dobrota
ID: 10820619
won't harm
I guess you already saw that :)
0
 
LVL 4

Expert Comment

by:ngopu
ID: 15891060

No comment has been added to this question in more than 21 days, so it is now classified as abandoned..
I will leave the following recommendation for this question in the Cleanup topic area:

Accept kronostm 's comment as answer

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

Gopu N
EE Cleanup Volunteer
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension . This reminded me of questions that come up here at EE along the lines of, "How can I tell the type of file from its cont…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

589 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question