Solved

command not working

Posted on 2013-06-08
8
604 Views
Last Modified: 2013-06-10
After this is done the command not working

[root@rc1 ~]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-130, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-130, default 130):
Using default value 130

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

Calling ioctl() to re-read partition table.
Syncing disks.
[root@rc1 ~]# fdisk /dev/sdc

The number of cylinders for this disk is set to 1885.
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)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
Partition 1 is already defined.  Delete it before re-adding it.

Command (m for help):
Command (m for help): 2
2: unknown command
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

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

Calling ioctl() to re-read partition table.
Syncing disks.
[root@rc1 ~]# fdisk /dev/sdd
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-130, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-130, default 130):
Using default value 130

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

Calling ioctl() to re-read partition table.
Syncing disks.
[root@rc1 ~]# fdisk /dev/sde
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-522, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-522, default 522):
Using default value 522

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

Calling ioctl() to re-read partition table.
Syncing disks.
[root@rc1 ~]# fdisk /dev/sdf
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-522, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-522, default 522):
Using default value 522

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

Calling ioctl() to re-read partition table.
Syncing disks.
[root@rc1 ~]# fdisk /dev/sdg
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-522, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-522, default 522):
Using default value 522

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

Calling ioctl() to re-read partition table.
Syncing disks.
[root@rc1 ~]# ls -la sd*
ls: sd*: No such file or directory
[root@rc1 ~]# ls-la sd*
-bash: ls-la: command not found
[root@rc1 ~]# ls -la sd*
ls: sd*: No such file or directory
[root@rc1 ~]#
0
Comment
Question by:walkerdba
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 27

Expert Comment

by:skullnobrains
ID: 39232128
you probably need to reboot if you want your kernel to pick the changes

btw, you may want to use parted or even gparted if you have X setup
0
 
LVL 35

Accepted Solution

by:
Seth Simmons earned 500 total points
ID: 39232210
If you are trying to look at the disk devices, you are in the wrong folder.
You are trying to look at it within the /root folder; you need to look at /dev

ls -la /dev/sd*

as far as the partitions go, you do not need to reboot
if the partition table was in use, fdisk would say so - and even then you could run partprobe on the device to have the kernel reload the partition table without rebooting
0
 
LVL 27

Expert Comment

by:skullnobrains
ID: 39232282
you are right as far as the ls command goes, but mind the above : the author ran fdisk a number of times and the disk still appeared as not partitionned. it is actually fairly frequent that the linux kernel does not pick changes before a reboot
0
Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

 
LVL 35

Expert Comment

by:Seth Simmons
ID: 39232343
the author ran fdisk a number of times on several devices

a partition was created on sdb
an attempt was made to create partition 1 on sdc but already exists
he then created partitions on sdd, sde, sdf, sdg
i see nothing that shows an attempt made on the same device more than once.

If the kernel can't get partition table changes it would have said...

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.


...which does not appear above
0
 
LVL 27

Expert Comment

by:skullnobrains
ID: 39232346
i completely missed the fact that the devices were different each time, sorry, and thanks
0
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 39233501
What is "the command" you are referring to? The fdisk commands or the ls command?

This should list all your sd* devices and partitions:

[root@rc1 ~]# ls -la /dev/sd*

Sample output:

brw-rw----. l root disk 8, 0 May 31  2013 /dev/sdb
brw-rw----. l root disk 8, 1 May 31  2013 /dev/sdb1
brw-rw----. l root disk 8, 2 May 31  2013 /dev/sdb2
0
 
LVL 13

Expert Comment

by:Sandy
ID: 39234699
just after partitioning

run a command instead of reboot

#partprobe
#kpartx

these worked in RHEL5 and then you can see the partitioning which is done on disk

Cheers
SA
0
 

Author Closing Comment

by:walkerdba
ID: 39236063
good
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question