Working with fdisk

  1. Bring up the target disk
  2. bash-3.2# /sbin/fdisk /dev/sdb The number of cylinders for this disk is set to 234975. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK)
  3. enter "p" to print the disk info
  4. Command (m for help): p Disk /dev/sdb: 1932.7 GB, 1932735283200 bytes 255 heads, 63 sectors/track, 234975 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System
  5. Enter "n" for new partition on disk:
  6. Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-234975, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-234975, default 234975): 178475 Command (m for help): p Disk /dev/sdb: 1932.7 GB, 1932735283200 bytes 255 heads, 63 sectors/track, 234975 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdb1 1 178475 1433600406 83 Linux Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 2 First cylinder (178476-234975, default 178476): Using default value 178476 Last cylinder or +size or +sizeM or +sizeK (178476-234975, default 234975): Using default value 234975 Command (m for help): p Disk /dev/sdb: 1932.7 GB, 1932735283200 bytes 255 heads, 63 sectors/track, 234975 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdb1 1 178475 1433600406 83 Linux /dev/sdb2 178476 234975 453836250 83 Linux
  7. Once you have sliced out the partitions, enter "w" to write to the table.
  8. Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks.
  9. Now make the filesystem type you want this is for ext3
  10. >mkfs.ext3 /dev/sdb1 mke2fs 1.39 (29-May-2006) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) 78004224 inodes, 156005199 blocks 7800259 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=4294967296 4761 block groups 32768 blocks per group, 32768 fragments per group 16384 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 102400000 Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 23 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override.
  11. Now label the partition so you can mount it by a label rather than a physical path in vfstab
  12. >/sbin/tune2fs -L /data1 /dev/sdb1 tune2fs 1.39 (29-May-2006)
  13. Try and mount the new partitions:
  14. mount -a or mount -t ext3 /dev/sdb1 /data
  15. to find the # of disks: if running dell OMSA:
  16. /opt/dell/srvadmin/bin/omreport storage adisk controller=0
  17. Examples of mkfs.ext3 commands.
  18. go to this site to get the right command!! http://uclibc.org/~aldot/mkfs_stride.html mkfs.ext3 -b 4096 -E stride=32,stripe-width=224 <--- for 8 disks and 128k stripe mkfs.ext3 -b 4096 -E stride=32,stripe-width=160 <--- for 6 disks and 128k stripe actual command that worked, did not like the stripe-width option!! bash-3.2# /sbin/mkfs.ext3 -b 4096 -R stride=32 /dev/sdb1 mke2fs 1.39 (29-May-2006) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) 179208192 inodes, 358400101 blocks 17920005 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=4294967296 10938 block groups 32768 blocks per group, 32768 fragments per group 16384 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 102400000, 214990848 Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information:done This filesystem will be automatically checked every 33 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override.
  19. For Label issues stopping the mount run e2label or tune2fs
  20. bash-3.2# mount -a mount: special device LABEL=/data does not exist mount: special device LABEL=/db does not exist To fis this LABEL issue, either remove label and just put device name or run. e2label /dev/sdb1 /data or tune2fs -L /data /dev/sdb1
  21. If this just will not work I did this.
  22. bash-3.2# mount -t ext3 /dev/sdb1 /data bash-3.2# mount -t ext3 /dev/sdb1 /db bash-3.2# df -k Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda3 121900692 4007528 111600908 4% / /dev/sda1 101086 18002 77865 19% /boot tmpfs 24723840 0 24723840 0% /dev/shm /dev/sdb1 1411105264 202520 1339222724 1% /data <-------it's there /dev/sdb2 446714232 202944 423819476 1% /db <-------- it's there
  23. Checking the /sbin/tune2fs command
  24. /sbin/tune2fs -l /dev/sdb1 tune2fs 1.39 (29-May-2006) Filesystem volume name: /data Last mounted on: Filesystem UUID: 582835ee-6799-48b0-b776-4a769e66f8c8 Filesystem magic number: 0xEF53 Filesystem revision #: 1 (dynamic) Filesystem features: has_journal resize_inode dir_index filetype needs_recovery sparse_super large_file Default mount options: (none) Filesystem state: clean Errors behavior: Continue Filesystem OS type: Linux Inode count: 179208192 Block count: 358400101 Reserved block count: 17920005 Free blocks: 352725686 Free inodes: 179208181 First block: 0 Block size: 4096 Fragment size: 4096 Reserved GDT blocks: 938 Blocks per group: 32768 Fragments per group: 32768 Inodes per group: 16384 Inode blocks per group: 512 Filesystem created: Tue Nov 1 14:56:58 2011 Last mount time: Tue Nov 1 15:31:41 2011 Last write time: Tue Nov 1 15:31:41 2011 Mount count: 1 Maximum mount count: 24 Last checked: Tue Nov 1 14:56:58 2011 Check interval: 15552000 (6 months) Next check after: Sun Apr 29 14:56:58 2012 Reserved blocks uid: 0 (user root) Reserved blocks gid: 0 (group root) First inode: 11 Inode size: 128 Journal inode: 8 Default directory hash: tea Directory Hash Seed: 5767d378-b588-421c-b2dc-e41901148d7d Journal backup: inode blocks