nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

Create a new ext3 file system if a disk was added to the sys

This is a discussion on Create a new ext3 file system if a disk was added to the sys within the Linux software forums, part of the Linux Getting Started category; Hi! I had added a new disk. Current disk is has 3 partition root swap backup Now I want to ...


Go Back   nixCraft Linux Forum > Linux Getting Started > Linux software

Register FAQ Members List Calendar Forgotten your password? Mark Forums Read
  #1 (permalink)  
Old 07-23-2006, 09:34 PM
Member
User
 
Join Date: Feb 2005
Posts: 66
Rep Power: 0
chiku
Default Create a new ext3 file system if a disk was added to the sys

Hi!

I had added a new disk. Current disk is has 3 partition
root
swap
backup

Now I want to add new ext3 disk and call it as /home and move current /home directories to this new /home. How do I format disk. I am afraid that my data will be lost if /home is formatted

Please gimme some guidline...

thamks
__________________
There's no place like 127.0.0.1
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-23-2006, 09:55 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Ubuntu
Posts: 1,061
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

First backup the data. Do not run any one of the command w/o backup.

If your new disk name is /dev/hdb, type the command fdisk /dev/hdb to create a new parition
Code:
fdisk /dev/hdb
Save and reboot system into singe user mode (so that other user can not access /home)

Format /dev/hdb1 (assuming that you created only 1 partion)
Code:
mkfs.ext3 /dev/hdb1
Create mount point
Code:
mkdir /tmp/newhome
Mount /dev/hdb1
Code:
mount /dev/hdb1 /tmp/newhome
cd /tmp/newhome
cp -avr /home .
Now unmount /tmp/newhome
Code:
umount /tmp/newhome

Open /etc/fstab and append/modify following:
Code:
vi /etc/fstab
appen/modify /dev/hdb1
Code:
/dev/hdb1       /home               ext3    defaults,errors=remount-ro 0
Save the file

Goto /home directory
Code:
cd /home 
rm –rf *
Reboot the system. More info
http://www.cyberciti.biz/faqs/2006/0...filesystem.php
http://www.cyberciti.biz/faqs/2006/0...ention-and.php
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
File System Error During Boot svoltmer Ubuntu / Debian 3 02-21-2008 02:50 PM
HP-UX Create system recovery boot tape stewwalker HP-UX 4 01-16-2008 06:21 AM
Difference between ext2 and ext3 Linux file system nixcraft Getting started tutorials 0 05-18-2007 02:43 AM
Command to Check Linux File System lacloai Getting started tutorials 3 05-14-2007 06:45 PM
how to create multiple file in a single command selvam Shell scripting 3 07-26-2006 02:01 AM


All times are GMT +5.5. The time now is 01:30 AM.


Powered by vBulletin® Version 3.7.4 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36