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 :D). 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 As you see the second SATA HDD because its new, has no partitions... Any idea how to create one using a terminal:Pengy: Many thanks and sry for my :newbie: ! |
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) |
Quote:
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 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 ;) |
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 |
All times are GMT -5. The time now is 07:29 AM. |