Solved

command not working

Posted on 2013-06-08
8
583 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
8 Comments
 
LVL 26

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 34

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 26

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
 
LVL 34

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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 26

Expert Comment

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

Expert Comment

by:Gerwin Jansen
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now