LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-04-2007, 09:32 PM   #1
DataSheet
Member
 
Registered: Apr 2006
Posts: 36

Rep: Reputation: 15
what is raw device?


Hi there,
I have 15GB hard drive. I used 10GB for my Red Hat Linux and left 5GB as free.

/dev/hda1 = /boot = 100MB
/dev/hda2 = 1 = 9GB
/dev/hda3 = swap = 1024MB
free = 5GB

Now is this FREE space is called RAW device?

If in future I need to use that free space, how can I create a new partition on that one?

Thanks,
Data Sheet
 
Old 01-04-2007, 10:50 PM   #2
nilleso
Member
 
Registered: Nov 2004
Location: ON, CANADA
Distribution: ubuntu, RHAS, and other unmentionables
Posts: 372

Rep: Reputation: 31
fdisk /dev/hda
refer to: here

cheers
 
Old 01-04-2007, 11:31 PM   #3
Electro
LQ Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
The last unpartitioned space is called raw space. Yes, you can add a partition to it later. I suggest using cfdisk when creating partitions. After you create partition, use hdparm -z /dev/hda to rescan it, so you do not have to reboot to use the new partition.
 
Old 01-05-2007, 09:22 AM   #4
DataSheet
Member
 
Registered: Apr 2006
Posts: 36

Original Poster
Rep: Reputation: 15
Hi Electro,
Thanks for the suggestion. Does cfisk same as fdisk in windows?

So first I will create partition on Raw disk and then create file system on that one?

can this new partition could be under "/"?

since I have already given "fixed size" to "/", how can this new partition could be under "/" ?

Data Sheet
 
Old 01-05-2007, 09:54 AM   #5
Robert Diggs
Member
 
Registered: Dec 2006
Location: Florida
Distribution: The ones that come in magazines and books.
Posts: 136

Rep: Reputation: 15
Hey,

Yes, cfdisk is the Linux equivalent of fdisk in Windows. To my knowledge, I do not think you could do an extension of root. If you were to do another one, I believe it would to put another operating system on there.

Regards,

Brandon
 
Old 01-05-2007, 12:59 PM   #6
DataSheet
Member
 
Registered: Apr 2006
Posts: 36

Original Poster
Rep: Reputation: 15
cannot see /dev/raw on my RHLE 4

I have raw device on my hard disk but I cannnot do ls -l /dev/raw

when I do ls -l /dev/raw* , it only show me /dev/rawctl.

How can I accesss to /dev/raw device instead of /dev/rawctl ?

Thanks,
Data Sheet
 
Old 01-05-2007, 01:46 PM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,783

Rep: Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936Reputation: 5936
I typically use the word unallocted for space not already part of a partition on a hard drive. From your previous post I assumed that you wanted to create a partition and use it for data storage. Steps
create partition (cfdisk)
create filesystem (format using i.e. mke2fs -j /dev/hda4)
create directory to mount filesystem ( mkdir /data)
mount filesystem to a directory (mount -t ext3 /dev/hda4 /data)

You can use this space as a raw device but you still need to create a partition. You need to bind the partition to a raw device.
http://www.linux.org/docs/ldp/howto/...TO/rawdev.html

IMO a raw device is not the same thing as unallocated space on a hard drive. So what are you wanting to do?
 
Old 01-05-2007, 04:16 PM   #8
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
I've merged the two threads as one was a continuation of
the other (in other words: too closely related to be two
threads)


Cheers,
Tink
 
Old 01-05-2007, 05:52 PM   #9
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
I would like to point out that the fdisk in Linux is totally different to the one in Dos/Wind9x.

The Dos' fdisk is a simple partitioning program capable of dealing only either fat16 or fat32 filing systems according to the operating system that runs it. Win2k or XP ntfs system is treated as non-Dos partition no different to a Linux or a BSD partition by fdisk. The Dos version of fdisk does nothing except Dos partitions. In a Fat16 Dos operating system the fdisk can only partition a maximum size of 2Gb because it cannot address beyond that limit on any hard disk.

Linux fdisk program recognises over 100 partition types and is one of the most robust partitioning tools available in a PC. We can use it to partition for all MS systems, Linux, BSD and Solaris. If a Windows can't read a disk because its partition table has been corrupted the chances are Linux's fdisk can read it, repair it and restore the disk to the good health again.

To put it mildly one is a boy and the other is a man. We can't send a boy to do a man's job.
 
Old 01-06-2007, 02:26 PM   #10
DataSheet
Member
 
Registered: Apr 2006
Posts: 36

Original Poster
Rep: Reputation: 15
Post

create partition (cfdisk)
create filesystem (format using i.e. mke2fs -j /dev/hda4)
create directory to mount filesystem ( mkdir /data)
mount filesystem to a directory (mount -t ext3 /dev/hda4 /data)
------------------------------------------------------------------

I think Now I am getting little bit sense.
Actually I wanted this RAW device for Oracle ASM (Automated Storage Management) since Oracle recommend using RAW device for database data.

But I wanted to learn to create/delete partition, so I want to practice above commands.

Couple of questions though:

1. is cfdisk is same as fdisk in Linux?
2. how do you choose /dev/hda4 in format command? if I would already have /dev/hda4, then I would use /dev/hda5? how many hdan? I can create?
3. Can I delete the partition later on and leave it as RAW as it is now?

Thanks and I am learning Linux from you guys!!!!

Data Sheet
 
Old 01-06-2007, 04:03 PM   #11
DataSheet
Member
 
Registered: Apr 2006
Posts: 36

Original Poster
Rep: Reputation: 15
Post

ok....I proceeded one step further now...

root#fdisk /dev/hda
Command:n
Command action
e extended
p primary partitions(1-4)

I know I have only /boot as my primary partion, the other two "/" and SWAP are not primary paritions.

which option should I choose?

Data Sheet
 
Old 01-06-2007, 05:18 PM   #12
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
fdisk and cfdisk are two different programs in Linux

Use "fdisk-l" to display all the partitions of every disk.

In side fdisk, type m for menu, p for partition table etc.

Your steps listed out at the beginning show you have formatted /dev/hda4 correctly.

You can have up to hda63.

You can delete any of the partitions but do pay notice to their positions as you can turn a deleted partition into a dead space that cannot be linked to other parts of a hard disk.

If you find it confusing I suggest you have a swap partition and then one single partition for the whole of Linux with /boot being a subdirectory to "/". If you give one partition to a Linux installer to mount its "/" the installer will put everything inside the partition. So one partition for one Linux or one other operating system. Linux can boot from both logical and primary partition.

Last edited by saikee; 01-06-2007 at 05:22 PM.
 
Old 01-06-2007, 05:44 PM   #13
DataSheet
Member
 
Registered: Apr 2006
Posts: 36

Original Poster
Rep: Reputation: 15
thanks....

Data Sheet
 
Old 01-06-2007, 09:15 PM   #14
DataSheet
Member
 
Registered: Apr 2006
Posts: 36

Original Poster
Rep: Reputation: 15
I used fdisk /dev/hda command to create extended partition.......

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.

and when I do # mkfs.ext3 /dev/hda4
it says "could not stat /dev/hda4 --- no such file or directory

The device apparently does not exists; did you specify correctly?

any idea?

Data Sheet
 
Old 01-07-2007, 05:03 AM   #15
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
Why don't you try to use cfdisk instead. It is a lot more informative and I bet you wouldn't have the same trouble.

Believe or not all my partitioning skill was taught by this program.
 
  


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
Do we need partition table for RAW device masand Linux - Hardware 1 02-22-2006 06:52 PM
Cannot open master raw device MDColson Mandriva 1 12-31-2004 01:55 PM
ASE master db on raw device? Andrastus Linux - Enterprise 0 12-13-2004 04:20 AM
block device raw access rvilarl Programming 0 10-24-2004 12:53 PM
SuSE: How to create raw device stjacqd Linux - General 3 07-22-2004 06:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:58 AM.

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