Solved

Linux 9 edit /etc/fstab change partition

Posted on 2004-04-07
17
1,133 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
17 Comments
 
LVL 14

Accepted Solution

by:
kronostm earned 50 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
 

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:kronostm
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:kronostm
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

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:kronostm
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:kronostm
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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now