Sponsored Content
Top Forums Shell Programming and Scripting Virtual disk to create and partition Post 302419792 by pseudocoder on Saturday 8th of May 2010 09:25:20 PM
Old 05-08-2010
Debian

I guess you want to do that to get some more space for Minix (the Qemu guest machine)?
Do you have the Qemu Launcher installed? If so, then it's gonna be a pretty easy task.
I've successfully tested following steps with DSL as Qemu guest on FreeBSD host:

1. Creating the actual virtual disk on host:
Open a shell and go to a directory, where you want to create the virtual disk and type following command (In my case I wanted the virtual disk to be 1 GB "large")
Code:
qemu-img create virtdisc.img 1G

2. Open the Qemu Launcher, click on the button "Open" next to "Hard disk 1" entry, browse to the directory which is containing the image you have previously created, select the image and click the "Open" button.

3. Launch your Guest OS.

4. Now you need to check if the new created disk is recognized by your Guest OS. Run
Code:
dmesg | grep hd

to know that. If you're lucky, you will find a couple lines similar to these:
Code:
<4>hdb: attached ide-disk driver
<6>hdb: 2097152 sectors (1074 MB) w/256KiB Cache, CHS=130/255/63
<6>Partition check:
<6> hdb: unknown partition table

5. Right now you need to create a partition:
Code:
cfdisk -z /dev/hdb

The usage of this tool is pretty self-explanatory.

6. Reboot Guest OS

7. Check if the partition was successfully created, use "dmesg | grep hd" again. This time the hdb line will look slightly different:
Code:
<6> hdb: hdb1

Looks good ^^

8. It's time to format the partition:
Code:
mkfs /dev/hdb1

9. Mount your new virtual disk:
Code:
mount /dev/hdb1 /mnt/hdb1

10. Enjoy
Code:
df -h

This User Gave Thanks to pseudocoder For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Disk Partition

Hi All, While my LINUX SERVER installed we didnt' used all the space for partitions. with what tool I can create a new partition or mount point to use the free space. I tried the command fdisk and diskdruid. They are not working. Thanks in advance With Best regards, Varma. (2 Replies)
Discussion started by: jarkvarma
2 Replies

2. Solaris

New disk - how to partition?

Have a solaris x86 running solaris 9. Root disk - logical - mirrored. I added 2 more disks today - and I have mirrored them using array configuration utility. I did a reconfiguration boot - and now I can see the logical disk using format: I then partitioned this the way I wanted (I hope)... (4 Replies)
Discussion started by: frustrated1
4 Replies

3. HP-UX

Am I running in a virtual partition

How can I tell if HP-UX 11 is running in a virtual partition from the command line? (1 Reply)
Discussion started by: Midcain
1 Replies

4. Solaris

Disk Partition

I have 3 disks to partition in following file system. c1t1d0 = 72gb /prod1 /prod2 /prod3 /prod4 /prod5 I am first time using "format" command to do this. How can i name with specified size. -Adeel (1 Reply)
Discussion started by: deal732
1 Replies

5. Filesystems, Disks and Memory

Partition disk

Hi, Can I partition disk in use or would I damage the file store on it? Regards Mehrdad (1 Reply)
Discussion started by: mehrdad68
1 Replies

6. Linux

C++ Code to Access Linux Hard Disk Sectors (with a LoopBack Virtual Hard Disk)

Hi all, I'm kind of new to programming in Linux & c/c++. I'm currently writing a FileManager using Ubuntu Linux(10.10) for Learning Purposes. I've got started on this project by creating a loopback device to be used as my virtual hard disk. After creating the loop back hard disk and mounting it... (23 Replies)
Discussion started by: shen747
23 Replies

7. HP-UX

HP-UX Virtual Partition

Hi guys can someone please advise... are there 2 types of VM used in HP-UX? because i have seen 2 sets of commands the one uses hpvm* (hpvmstatus) then the other it starts with v* (vparstatus) (2 Replies)
Discussion started by: sbn
2 Replies

8. Red Hat

How to partition your disk?

Hello, I am a new member of the forum. I need an idea on how to partition the disk. My situation is as follows: I have two 3TB disks ognuno.In 6TB total then, but I have to do to force a RAID 1 so my space will be 3TB. I'll have to force install RedHat 5.8 and liquids is to be taken in... (4 Replies)
Discussion started by: Joaquin
4 Replies

9. Solaris

Solaris 10 virtual disk (ramdisk) create for sun4v (T-2000 simulator) architecture

have been trying to create a 2 GB ramdisk (virtual) to run on my T-2000 simulator (Legion) which has sun4v architecture. I have a SPARC workstation which runs on sun4u architecture with Solaris 10. I have created a ramdisk image using dd command, newfs, then used ufsrestore to restore the... (3 Replies)
Discussion started by: Zam_1234
3 Replies

10. Red Hat

Shrink LVM partition & create new Linux Primary partition

Hello All, I have a Red Hat Linux 5.9 Server installed with one hard disk & 2 Partitions created on it as follows, /boot - Linux Partition & another is LVM - One VG & under that 5-6 Logical volumes(var,opt,home etc). Here my requirement is to take out 1GB of space from LVM ( Any logical... (5 Replies)
Discussion started by: gr8_usk
5 Replies
All times are GMT -4. The time now is 02:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy