OpenVZ Forum


Home » General » Support » Additional partition in container?
Additional partition in container? [message #36497] Wed, 24 June 2009 20:09 Go to next message
SyRenity is currently offline  SyRenity
Messages: 7
Registered: March 2009
Junior Member
From: *neo.co.il
Hi.

Is it possible to add additional partition in the container?

Or just re-partition the existing one?

I'm asking this because I need to test an application working with 2 partitions, and looking to do it on OpenVZ container/

Thanks in advance!
Re: Additional partition in container? [message #36501 is a reply to message #36497] Thu, 25 June 2009 13:45 Go to previous messageGo to next message
SyRenity is currently offline  SyRenity
Messages: 7
Registered: March 2009
Junior Member
From: *neo.co.il
Hi.

Any idea of the above?

Regards.
Re: Additional partition in container? [message #36522 is a reply to message #36501] Mon, 29 June 2009 06:58 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
From: *sw.ru
Look at "--devnodes" parameter of "vzctl" utility.
Re: Additional partition in container? [message #36535 is a reply to message #36522] Mon, 29 June 2009 12:23 Go to previous messageGo to next message
SyRenity is currently offline  SyRenity
Messages: 7
Registered: March 2009
Junior Member
From: *neo.co.il
Hi.

Thanks for the advice.

If I understand this command correctly, it allows me to create device files which I can then access with the container, partition them and then mount.

Is this correct?

If yes, what would be the shortest way from creating the device to mounting it (a set of some commands would be nice)?

Thanks in advance!
Re: Additional partition in container? [message #36536 is a reply to message #36535] Mon, 29 June 2009 12:35 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
From: *sw.ru
Something like this:

# mkfs.ext3 /dev/sda1
# vzctl set 101 --devnodes sda --save
# vzctl set 101 --devnodes sda1 --save
# vzctl enter 101
# mount -t ext3 /dev/sda1 /mnt
Re: Additional partition in container? [message #36538 is a reply to message #36536] Mon, 29 June 2009 13:01 Go to previous messageGo to next message
SyRenity is currently offline  SyRenity
Messages: 7
Registered: March 2009
Junior Member
From: *neo.co.il
Hi.

It seems as I need to use a physical partition of host node?

My question was if it possible to partition the virtual space provided to me by the container, without involving the host node.

Thanks.
Re: Additional partition in container? [message #36541 is a reply to message #36538] Mon, 29 June 2009 15:10 Go to previous message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
From: *sw.ru
I don't quite understand what you want.
How would it possible "to partition virtual space"?
If it suits you, you may create loop device inside VE and mount it.

# vzctl set 101 --devnodes loop0:rw --save
# vzctl set 101 --devnodes loop1:rw --save
# vzctl set 101 --devnodes loop2:rw --save
# vzctl set 101 --devnodes loop3:rw --save
# vzctl enter 101
# dd if=/dev/zero of=/root/filesystem count=100000
# mkfs.ext3 /root/filesystem
# mount -t ext3 /root/filesystem /mnt/

Previous Topic: HN can not ping VE
Next Topic: [solved] nfs mount vs. mount --bind
Goto Forum:
  


Current Time: Sun Jul 12 10:01:14 GMT 2020