LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-04-2008, 09:11 PM   #1
dgar
Member
 
Registered: Jun 2005
Location: Candia, NH
Distribution: Ubuntu, FC, RHE3, RHE4, CentOS
Posts: 121

Rep: Reputation: 15
How to provide a block device for partition in a hard drive image?


I'm configuring a kvm hosting machine with the following device stack:

Code:
    rootfs swap
       |    /
     lvol lvol
       | /
       vg
 boot  |
   \   pv
     \ |
    drbd
      |
    lvol
      |
     vg
      |
     pv
      |
    /dev/sda
      |
    3ware
     / \
    d1 d2
So here is the problem. The lvol is too small. I shut down the guestVM, unattached the drbd driver, and extended the lvol size.

Now how do I run resize2fs on the second partition of the hard drive image in the lvol? I found a neat trick to mount the partition with the following offest:

Code:
dan@xen:~$ sudo parted /dev/mapper/vg-ftl_www unit B print
[sudo] password for dan: 
Model: Linux device-mapper (dm)
Disk /dev/mapper/vg-ftl_www: 10737418240B
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start       End           Size          Type     File system  Flags
 1      32256B      106928639B    106896384B    primary  ext3         boot 
 2      106928640B  10733990399B  10627061760B  primary               lvm
Any ideas short of dumping the entire lvol, split it, resize and reassemble? Google has failed me, and it hasn't in a very, very long time.

Last edited by dgar; 12-04-2008 at 09:24 PM. Reason: Added fixedsys font
 
Old 12-04-2008, 09:17 PM   #2
dgar
Member
 
Registered: Jun 2005
Location: Candia, NH
Distribution: Ubuntu, FC, RHE3, RHE4, CentOS
Posts: 121

Original Poster
Rep: Reputation: 15
Smile Ahh, google has redeemed itself!

kpartx -a -v /dev/mapper/vg-ftl_www
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Using dd and gzip to create hard drive image but image is bigger than hard drive? banz Linux - Software 3 11-22-2008 04:25 AM
ram image not finding root block (3,1) partition fourcs Linux - General 4 05-26-2007 05:58 AM
mount partition from copied block device cs-cam Linux - General 0 09-23-2006 07:41 PM
Trying to partition hard drive umount: device is busy badgerbox76 Linux - Hardware 1 02-26-2006 02:28 AM
access an audio cd image as a block device carotinho Linux - Software 1 02-17-2005 06:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:07 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