LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-09-2007, 06:22 PM   #1
fw12
Member
 
Registered: Mar 2006
Distribution: Fedora core, Ubuntu
Posts: 175

Rep: Reputation: 31
How to add new HDD to LVM


I have a new 200gb hdd that I need to add to my box.

The contents of my fstab is:

/dev/VolGroup00/LogVol00 / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
/dev/devpts /dev/pts devpts gid=5,mode=620 0 0
/dev/shm /dev/shm tmpfs defaults 0 0
/dev/proc /proc proc defaults 0 0
/dev/sys /sys sysfs defaults 0 0
/dev/VolGroup00/LogVol01 swap swap defaults 0 0


I've used fdisk to create a "Linux LVM" partition on the new hdd.

However, how do I get linux to add the new drive to the logical volume?

I have Fedora core 6.

TIA.

Last edited by fw12; 08-09-2007 at 06:32 PM.
 
Old 08-09-2007, 07:22 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,923

Rep: Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628
Have a look at the LVM guide on tldp.org - covers these sort of things.
Think I've seen similar on the Redhat and/or Fedora site as well.
 
Old 08-10-2007, 05:17 AM   #3
skimeer
Member
 
Registered: Jun 2007
Posts: 62
Blog Entries: 1

Rep: Reputation: 0
Quote:
Originally Posted by syg00
Have a look at the LVM guide on tldp.org - covers these sort of things.
Think I've seen similar on the Redhat and/or Fedora site as well.

I am having one simple doubt about LVM.Suppose one of the partition in LVM get removed then how to recover data from the LVM? Does LVM still exists?

Thanks
 
Old 08-10-2007, 05:43 AM   #4
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
Is there any reason that you didn't make a regular partition? It would have been a lot more straightforward. Not to mention convenience. If you ever need to access data from something like gparted, you'll find it impossible because gparted doesn't do LVM. Think of the risks this may involve. The only time I would recommend LVM is when people are running out of partitions on a certain disk or when they'll be resizing partitions a lot.

Last edited by jay73; 08-10-2007 at 05:45 AM.
 
Old 08-10-2007, 12:40 PM   #5
fw12
Member
 
Registered: Mar 2006
Distribution: Fedora core, Ubuntu
Posts: 175

Original Poster
Rep: Reputation: 31
Thanks for your answers.

I wasn't sure about the pros and cons of LVM. I think I'll go with a regular partition like jay73 said.

I also totally agree with skimeer. Is LVM like raid 5 where the removal of one drive/partition won't lead to data loss?
 
Old 08-10-2007, 02:58 PM   #6
fw12
Member
 
Registered: Mar 2006
Distribution: Fedora core, Ubuntu
Posts: 175

Original Poster
Rep: Reputation: 31
Problem

I'm having a strange problem mounting my newly created partition.

I used fdisk to create a primary "Linux" partition. All 200GB is one huge partition.

I then formatted the partition with:

# mkfs -t ext2 -j /dev/sdb1

Next, I created a directory:

# mkdir /mnt/media

Finally, I tried to mount my partition:

# mount -t ext3 /dev/sdb1 /mnt/media

Here is the error I received:

mount: /dev/sdb1 already mounted or /mnt/media is busy

OK, so I do:

# umount /dev/sdb1

Error:

umount: /dev/sdb1: not mounted

I tried fsck to see if something was wrong with the drive:

# fsck /dev/sdb1

Error:

fsck.ext3: Device or resource busy while trying to open /dev/sdb1
Filesystem mounted or opened exclusively by another program?

This is strange. It won't let me mount the partition because it says it's already mounted, but then says it's not mounted when I try to unmount.

What am I doing wrong?

Last edited by fw12; 08-10-2007 at 03:10 PM.
 
Old 08-10-2007, 03:11 PM   #7
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
You don't need to specify filesystem type for ext3 (just "mount /dev/sb1 etc"). But I would be surprised if it had anything to do with those error messages. If you run fdisk -l, do you see the new disk/partition or not?
 
Old 08-10-2007, 03:45 PM   #8
fw12
Member
 
Registered: Mar 2006
Distribution: Fedora core, Ubuntu
Posts: 175

Original Poster
Rep: Reputation: 31
fdisk -l shows the partition just fine.

This thread says something about removing evms package: http://www.linuxquestions.org/questi...d.php?t=251293

But I could not find evms on my system.

Rather than go through the headache of getting to the bottom of the problem, which seems to be related to FC6, I've decided to reinstall Linux with both drives in the computer. I'm doing that right now.

Thanks for helping me with the problem.
 
Old 08-10-2007, 06:02 PM   #9
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,923

Rep: Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628
Some thoughts:
- LVM is a virtualization layer - nothing to do with RAID. As is EVMS (E- Enterprise). If you lose a partition you lose data - same as a "normal" partition.
- the fsck problem is probably Fedora trying to be "helpful" - I've seen similar with Ubuntu. Force a "true" mount against the device (desktop icon maybe), then the umount should (might) work. PITA.
You could of course just reboot - fsck will be done on a new filesystem; can always be forced anyway.

I don't use LVM (or EVMS which can co-exist), but can see stuations where it would be useful.
 
Old 08-15-2007, 05:37 AM   #10
skimeer
Member
 
Registered: Jun 2007
Posts: 62
Blog Entries: 1

Rep: Reputation: 0
Question My Problem

Nice Discussion, but my problem has not solved,
If i have created LVM of three partitions Then one of the partition get damaged. my machine is not booting.showing fscsk error.How to deal with this? Any chance to recover the data.

Tahnks for the Help
 
Old 08-16-2007, 05:06 PM   #11
Gortex
Member
 
Registered: Nov 2005
Location: Enid Ok
Distribution: ubuntu 64 , debian , fedora core , vista ultimate 64, Winows 7 64 ultimate :p
Posts: 219

Rep: Reputation: 30
can you post the contents of your /dev folder ?

You might not be mounting it correctly due to LVM. If you have LVM installed and running on the Computer you cant mount the device directly like example "mount -t ext3 /dev/sdb1 /mountpoint
You would mount it by using something more like this mount /dev/LogGroup00/Logvol01 /mountpoint
or something to that effect.
 
Old 08-18-2007, 04:53 AM   #12
skimeer
Member
 
Registered: Jun 2007
Posts: 62
Blog Entries: 1

Rep: Reputation: 0
Question

Quote:
Originally Posted by Gortex View Post
can you post the contents of your /dev folder ?

You might not be mounting it correctly due to LVM. If you have LVM installed and running on the Computer you cant mount the device directly like example "mount -t ext3 /dev/sdb1 /mountpoint
You would mount it by using something more like this mount /dev/LogGroup00/Logvol01 /mountpoint
or something to that effect.
I am working with that LVM safely.I have mounted it with the same way as u have shown. mount -a command also worked successfully.thereafter one partition get deleted by one user & he restarted the machine. Now machine stops at fsck error prompt.any help to remount it or comment that entry from fsstab so i can boot the machine.

Thanks.
 
Old 08-18-2007, 05:31 PM   #13
Gortex
Member
 
Registered: Nov 2005
Location: Enid Ok
Distribution: ubuntu 64 , debian , fedora core , vista ultimate 64, Winows 7 64 ultimate :p
Posts: 219

Rep: Reputation: 30
So its just not booting due to the invalid fstab ?

If thats the case do you have a Live instalation cd ?

All you would need to do is boot from a live cd mount your old filesystem some where then vim the fstab really fast and remove the invalid information ?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mounting old HDD containing FC5 (LVM) ernst Fedora - Installation 7 10-25-2006 04:26 AM
need quick rply HDD LVM question winchester169 Linux - Hardware 1 07-27-2006 11:00 PM
Extending /home with additional HDD but no LVM derekluaxp Linux - Newbie 5 02-25-2006 09:35 AM
Add Disk to LVM Help!! gfem Fedora 2 02-07-2006 04:02 PM
Trying to add a third hard drive (hdd) and get Unable to open /dev/hdd MikeyCarter Linux - Hardware 4 12-26-2005 10:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration