Solved

command not working

Posted on 2013-06-08
8
586 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
linux boot fsck problem 3 61
Using init script with Systemd: need help crafting unit file 11 77
Linux/Apache File Ownership/Permissions 1 52
Linux VM 6 36
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
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.

911 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

21 Experts available now in Live!

Get 1:1 Help Now