We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Linux 9 edit /etc/fstab change partition

qazakax
qazakax asked
on
Medium Priority
1,202 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

Comment
Watch Question

Networking Engineer
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Top Expert 2004

Commented:
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
Top Expert 2004

Commented:
Typo:
ln -s /var/db/var3

should read

ln -s /var/db /var3

Author

Commented:
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
Adrian DobrotaNetworking Engineer
CERTIFIED EXPERT

Commented:
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?

Author

Commented:
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
Adrian DobrotaNetworking Engineer
CERTIFIED EXPERT

Commented:
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)

Commented:
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??

Author

Commented:



>>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.

Author

Commented:
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

Author

Commented:
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" ?
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?

Adrian DobrotaNetworking Engineer
CERTIFIED EXPERT

Commented:
I never used LABEL so .... I can't give you any advice on that. Glad that you solved the problem

Author

Commented:

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?
Adrian DobrotaNetworking Engineer
CERTIFIED EXPERT

Commented:
won't harm
I guess you already saw that :)
ngopuGroup Technical Manager
CERTIFIED EXPERT

Commented:

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
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.