LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Possible to mount LV? (https://www.linuxquestions.org/questions/linux-newbie-8/possible-to-mount-lv-852297/)

dtharmal 12-25-2010 01:08 AM

Possible to mount LV?
 
Alright, I'm a complete newbie when it comes to Linux. I've fooled around with some desktop distros before, but briefly. I set up a server a few months ago just as a first shot at this and it worked great, I had a full LAMP stack running, had vsftp running and everything was running smooth but I like poking so I poked in the wrong places and basically brought my setup to its knees and was forced to do a clean install. That being said, I'm a quick learner and am eager to learn more, but I've hid a roadblock as far as Google search help goes.

My goal: Give my old desktop new life as both a location for backing up with Time Machine, and a place to store, access (any maybe stream?) my files. (Streaming is obviously for media files, but I would like to be able to access it via FTP as well so I can just download the occasional file)

My setup: Pentium P4 3.2 GHz, 1GB RAM, 2 HDD (1x 160 GB, 1x 250GB)

My current issue: So I used the LVM to allocate 10GB of the 160GB HDD to actual install of Ubuntu Server 10.10, currently have a LAMP stack, OpenSSH, and Samba running.
I want to ideally use the rest of the 150 GB of the partition as the space for my Time Machine backups and the other HDD as my media storage. Here is my fdisk return:

Code:

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000382

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *          1          32      248832  83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              32      19458  156039169    5  Extended
/dev/sda5              32      19458  156039168  8e  Linux LVM

Disk /dev/sdb: 251.0 GB, 251000193024 bytes
179 heads, 63 sectors/track, 43472 cylinders
Units = cylinders of 11277 * 512 = 5773824 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1              1      43473  245117344+  83  Linux

Disk /dev/dm-0: 9521 MB, 9521070080 bytes
255 heads, 63 sectors/track, 1157 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/dm-0 doesn't contain a valid partition table

Disk /dev/dm-1: 473 MB, 473956352 bytes
255 heads, 63 sectors/track, 57 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/dm-1 doesn't contain a valid partition table

When I try to mount the second part of the LVM as a physical volume, I'm getting an issue that I can't use lvcreate while the group is active. I'm not sure if this is possible or even a good idea to start off with. Any suggestion is welcome, please keep in mind that this is my first attempt at setting up a server where I'm not following a tutorial word for word so I am oblivious to the obvious.

catkin 12-25-2010 01:37 AM

Please give more detail on "So I used the LVM to allocate 10GB of the 160GB HDD to actual install of Ubuntu Server 10.10". What is the output of lvdisplay?

dtharmal 12-25-2010 09:54 AM

Quote:

Originally Posted by catkin (Post 4202581)
Please give more detail on "So I used the LVM to allocate 10GB of the 160GB HDD to actual install of Ubuntu Server 10.10". What is the output of lvdisplay?

Sorry - here it is:

Code:

  --- Logical volume ---
  LV Name                /dev/799cfb/root
  VG Name                799cfb
  LV UUID                NC5Mj4-pxdx-EOES-VgdW-F2ga-PCl8-CuF6QY
  LV Write Access        read/write
  LV Status              available
  # open                1
  LV Size                8.87 GiB
  Current LE            2270
  Segments              1
  Allocation            inherit
  Read ahead sectors    auto
  - currently set to    256
  Block device          251:0
 
  --- Logical volume ---
  LV Name                /dev/799cfb/swap_1
  VG Name                799cfb
  LV UUID                asHll1-06UN-Qk0d-KBLy-2JEj-EpF7-sbtWvJ
  LV Write Access        read/write
  LV Status              available
  # open                1
  LV Size                452.00 MiB
  Current LE            113
  Segments              1
  Allocation            inherit
  Read ahead sectors    auto
  - currently set to    256
  Block device          251:1


dtharmal 12-25-2010 10:22 AM

So I did some more digging around and turns out I was just using the lvcreate command wrong (might have been the lack of sleep :S, who knows?) Anywho, I tried it this morning with the following:


Code:

sudo lvcreate -l 100%FREE -n timemachine 799cfb
(I was basically trying to allocate the remaining size of the PV to an LV to backup my time machine to). Now my lvdisplay returns:

Code:

  --- Logical volume ---
  LV Name                /dev/799cfb/root
  VG Name                799cfb
  LV UUID                NC5Mj4-pxdx-EOES-VgdW-F2ga-PCl8-CuF6QY
  LV Write Access        read/write
  LV Status              available
  # open                1
  LV Size                8.87 GiB
  Current LE            2270
  Segments              1
  Allocation            inherit
  Read ahead sectors    auto
  - currently set to    256
  Block device          251:0
 
  --- Logical volume ---
  LV Name                /dev/799cfb/swap_1
  VG Name                799cfb
  LV UUID                asHll1-06UN-Qk0d-KBLy-2JEj-EpF7-sbtWvJ
  LV Write Access        read/write
  LV Status              available
  # open                1
  LV Size                452.00 MiB
  Current LE            113
  Segments              1
  Allocation            inherit
  Read ahead sectors    auto
  - currently set to    256
  Block device          251:1
 
  --- Logical volume ---
  LV Name                /dev/799cfb/timemachine
  VG Name                799cfb
  LV UUID                kV13J1-t9X8-qVU2-01Ch-Vrk8-BQQ3-gw3RLn
  LV Write Access        read/write
  LV Status              available
  # open                0
  LV Size                139.50 GiB
  Current LE            35712
  Segments              1
  Allocation            inherit
  Read ahead sectors    auto
  - currently set to    256
  Block device          251:2


catkin 12-25-2010 10:27 AM

So you've got the LVs OK. I don't understand the two fdisk output lines like "Disk /dev/dm-0 doesn't contain a valid partition table" and how it might relate to LVs. Somehow Ubuntu always manages to make things more complicated that I think they should be!

dtharmal 12-25-2010 10:31 AM

Quote:

Originally Posted by catkin (Post 4202817)
So you've got the LVs OK. I don't understand the two fdisk output lines like "Disk /dev/dm-0 doesn't contain a valid partition table" and how it might relate to LVs. Somehow Ubuntu always manages to make things more complicated that I think they should be!

Yeah, I have no clue what they might be to be honest. I'm hoping it goes away once I format & partition the second hard drive. But I do agree with you, Ubuntu does makes things extremely complicated but I hear its one of the easiest distros for a beginner to use especially when setting up a home server. Got any other suggestions? I'm pretty much still at the set up stage so I'm willing to start from scratch if it will make life easier.

catkin 12-25-2010 10:45 AM

Having set up the LVs the next step is to format them with a file system. The question is "which devices are they"? What's the output of lvscan?

dtharmal 12-25-2010 10:48 AM

Quote:

Originally Posted by catkin (Post 4202825)
Having set up the LVs the next step is to format them with a file system. The question is "which devices are they"? What's the output of lvscan?

Code:

ACTIVE            '/dev/799cfb/root' [8.87 GiB] inherit
  ACTIVE            '/dev/799cfb/swap_1' [452.00 MiB] inherit
  ACTIVE            '/dev/799cfb/timemachine' [139.50 GiB] inherit

Seems like what I want it to be right? (Ignoring the second drive which I haven't partitioned yet)

catkin 12-25-2010 12:17 PM

LVs don't need partitioning -- they are in effect a single partition.

The swap partition does not need any further preparation (well -- I've never done so) -- it only needs adding to /etc/fstab as a swap partition, something like
Code:

/dev/799cfb/swap_1      swap          swap  defaults                  0 0
The timemachine you need to create file systems on with something like
Code:

mkfs.ext4 /dev/799cfb/timemachine
depending on which file system you want to use.

Is the /dev/799cfb/root LV already in use? df -hT would show.

All this with the caveat that I'm writing from ordinary Linux experience so it might fall foul of Ubuntu-isms.

dtharmal 12-25-2010 02:16 PM

Thanks a lot for the help! I have it set up perfectly now (after a lot of struggles..but most of it was setting up with AFP and whatnot)


All times are GMT -5. The time now is 02:34 PM.