LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices

Reply
 
Search this Thread
Old 07-23-2007, 07:57 AM   #1
CoMMy
LQ Newbie
 
Registered: Jul 2007
Posts: 3

Rep: Reputation: 0
Remote HDD Partitioning+Formatting.


Hello,

As a fairly noob in Linux i have a noob question for you (probably the easiest thing for you experts ).

Well basically i have a new HDD installed on my remote server and im using the bash prompt on RHEL 4. The HDD has no partitions and i have no idea how to make one... The fdisk utility help does not specify how to make one!

Here is the output of sfdisk:

Code:
Disk /dev/sda: 9729 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/sda1   *      0+     24      25-    200781   83  Linux
/dev/sda2         25    5437    5413   43479922+  83  Linux
/dev/sda3       5438    6790    1353   10867972+  83  Linux
/dev/sda4       6791    9728    2938   23599485    5  Extended
/dev/sda5       6791+   8143    1353-  10867941   83  Linux
/dev/sda6       8144+   9496    1353-  10867941   83  Linux
/dev/sda7       9497+   9627     131-   1052226   83  Linux
/dev/sda8       9628+   9728     101-    811251   82  Linux swap

Disk /dev/sdb: 19457 cylinders, 255 heads, 63 sectors/track

sfdisk: ERROR: sector 0 does not have an msdos signature
 /dev/sdb: unrecognized partition
No partitions found

As you see the second SATA HDD because its new, has no partitions...

Any idea how to create one using a terminal

Many thanks and sry for my !

Last edited by CoMMy; 07-23-2007 at 07:58 AM.
 
Old 07-23-2007, 08:46 AM   #2
rtspitz
Member
 
Registered: Jan 2005
Location: germany
Distribution: suse, opensuse, debian, others for testing
Posts: 307

Rep: Reputation: 32
fdisk /dev/sdb

then type m (for help)

n: create partition (maximum of 4 primary partitions, extended is more flexible unless you need to boot from it)
 
Old 07-23-2007, 09:13 AM   #3
CoMMy
LQ Newbie
 
Registered: Jul 2007
Posts: 3

Original Poster
Rep: Reputation: 0
Thumbs up

Quote:
Originally Posted by rtspitz
fdisk /dev/sdb

then type m (for help)

n: create partition (maximum of 4 primary partitions, extended is more flexible unless you need to boot from it)
Thanks for this !

I tryied making a partition.. I made an extended one in the slot 1 i think.....
Code:
Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       19457   156288321    5  Extended

Command (m for help): v
312581806 unallocated sectors
Basically if you can guide me as to do what i need if its not too much trouble...

This HDD is a secondary slave.. Im guessing it should be extended. So my question is how can i make this disk fully operational and ready to write on (even how to mount it..)

Many thanks

Last edited by CoMMy; 07-23-2007 at 09:26 AM.
 
Old 07-23-2007, 02:27 PM   #4
rtspitz
Member
 
Registered: Jan 2005
Location: germany
Distribution: suse, opensuse, debian, others for testing
Posts: 307

Rep: Reputation: 32
ok.

fdisk /dev/sdb

Command (m for help):

--> n

Command action
l logical (5 or over)
p primary partition (1-4)


--> l

First cylinder (1-32768, default 1): 1

Last cylinder or +size or +sizeM or +sizeK (1-32768, default 32768):

--> +30000M (just an example for 30G)

repeat for every amount of logical partition(s) you like until all space is full.

--> w (write partitions to disk)

--> fdisk -l (shows all partitions found)

then create a filesystem on the partition(s) you've just set up.

--> mkfs.ext3 /dev/sdb5 (just an example, you can also use mkfs.reiserfs and others you like/need)

create an entry in /etc/fstab like:

/dev/sdb5 /MY-DATA-DISK ext3 acl,user_xattr 0 1

- if you don't want it to mount at boot you can add "noauto" to the options "acl,...."
- if it should be mountable by ordinary users add "user"
- the first digit (0) is called "dump flag", can be ignored, google for it if needed.
- the 2nd digit (1) is used for file system checks during boot if something has gone bad. 1 = first partition to check, 2 = second ....
- make sure /MY-DATA-DISK actually exists.

now decide which file permissions should be set on that directory

- set appropriate permissions on the mount-point with "chown" / "chmod". if you need access control lists (somewhat like in windoze) have a look at "setfacl" and "getfacl"

easy example:

owner: root (can do ANYTHING)
group: users (should be able to read, write, execute = change into directory)
others: nada

--> chown root.users /MY-DATA-DISK
--> chmod u+rwx,g+rwx,o-rwx /MY-DATA-DISK
--> ls -lsd /MY-DATA-DISK

drwxrwx--- 2 root users 4096 2007-07-23 21:39 MY-DATA-DISK/


for more detailled access control you need to use ACLs (access control lists).

some info here: http://www.suse.de/~agruen/acl/chapter/fs_acl-en.pdf

Last edited by rtspitz; 07-23-2007 at 02:54 PM.
 
  


Reply

Tags
fdisk, format, partition, terminal


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Formatting and Partitioning JonnyBlazed Mandriva 5 09-03-2004 07:03 AM
Formatting and Partitioning?!?!? JonnyBlazed Linux - Newbie 4 07-21-2004 01:05 PM
Partitioning and formatting ??? BajaNick General 5 12-25-2003 09:57 PM
partitioning ok, but formatting no go..... beginnerx Linux - Newbie 6 09-29-2003 11:00 AM
partitioning and formatting eculbert Linux - Newbie 3 09-10-2003 06:32 PM


All times are GMT -5. The time now is 07:05 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration