LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (https://www.linuxquestions.org/questions/red-hat-31/)
-   -   Not able to save primary partition (https://www.linuxquestions.org/questions/red-hat-31/not-able-to-save-primary-partition-4175528164/)

arun natarajan 12-13-2014 08:20 AM

Not able to save primary partition
 
Hi All,

Am able to create the primary partition P1 and P2 but am unable to save it. While saving those am getting below error. Have tried the same also by rebooting the OS, but still the same. What needs to be done to overcome this.My RHEL 6 is installed as virtual OS in VM ware.

]# fdisk /dev/sda2

Command (m for help): p

Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0009b5c6

Device Boot Start End Blocks Id System
/dev/sda1 * 1 39 307200 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 39 2101 16567296 83 Linux
/dev/sda3 2101 2611 4096000 82 Linux swap / Solaris

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

Calling ioctl() to re-read partition table.

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 or after you run partprobe(8) or kpartx(8)
Syncing disks.
[root@localhost Desktop]#

michaelk 12-13-2014 08:42 AM

The correct syntax is:
fdisk /dev/sda.

All available space on the disk is currently being used. If you want to create additional partitions you need to extend the size of the virtual disk (VMDK). When you reboot the guest it should see the additional space.

Create sda4 as an extended partition using the additional space and then you can create multiple logical partitions.

arun natarajan 12-13-2014 09:11 AM

I've extended 5gb in virtual hdd. But am able to see the new space in any of the partition . I've used these commands to check.

fdisk -l
df -h

Both these commands giving me same results as before.

michaelk 12-13-2014 09:36 AM

Did you reboot RHEL?
Post the output of fdisk -l

onebuck 12-13-2014 10:15 AM

Moderator Response
 
Moved: This thread is more suitable in <Red Hat> and has been moved accordingly to help your thread/question get the exposure it deserves.

arun natarajan 12-13-2014 11:13 AM

Yes, i ve rebooted it twice.

[root@localhost Desktop]# fdisk -l

Disk /dev/sda: 26.8 GB, 26843545600 bytes
255 heads, 63 sectors/track, 3263 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0009b5c6

Device Boot Start End Blocks Id System
/dev/sda1 * 1 39 307200 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 39 2101 16567296 83 Linux
/dev/sda3 2101 2611 4096000 82 Linux swap / Solaris
[root@localhost Desktop]#





michaelk 12-13-2014 11:24 AM

Original
Quote:

Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
resized
Quote:

Disk /dev/sda: 26.8 GB, 26843545600 bytes
255 heads, 63 sectors/track, 3263 cylinders
So it did increase in size by 5GB. This is unallocated space so it will not show up as part of any other partition. So what do you want to do with this extra space? Create more partitions?

arun natarajan 12-13-2014 01:44 PM

Yes, my objective is to create partition from the newly added space.

michaelk 12-13-2014 01:52 PM

I would create sda4 as an extended partition with the entire space. Then you can create multiple logical partitions if desired.

arun natarajan 12-14-2014 01:27 AM

Created extended partition now. But not able to create the logical partitions. Plz check my commands and suggest.

[root@localhost Desktop]# fdisk -l

Disk /dev/sda: 26.8 GB, 26843545600 bytes
255 heads, 63 sectors/track, 3263 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0009b5c6

Device Boot Start End Blocks Id System
/dev/sda1 * 1 39 307200 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 39 2101 16567296 83 Linux
/dev/sda3 2101 2611 4096000 82 Linux swap / Solaris
/dev/sda4 2700 3200 4024282+ 5 Extended
[root@localhost Desktop]# fdisk /dev/sda4

Unable to open /dev/sda4
[root@localhost Desktop]#

michaelk 12-14-2014 05:23 AM

Quote:

fdisk /dev/sda4
fdisk always uses the drive device i.e. /dev/sda

arun natarajan 12-16-2014 12:21 AM

I created a logical partition /dev/sda5 now from the extended partition. But am unable to format it with ext3. Plz view the below executed commands.


[root@localhost Desktop]# fdisk -l

Disk /dev/sda: 26.8 GB, 26843545600 bytes
255 heads, 63 sectors/track, 3263 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0009b5c6

Device Boot Start End Blocks Id System
/dev/sda1 * 1 39 307200 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 39 2101 16567296 83 Linux
/dev/sda3 2101 2611 4096000 82 Linux swap / Solaris
/dev/sda4 2700 3200 4024282+ 5 Extended
/dev/sda5 2700 3000 2417751 83 Linux

[root@localhost Desktop]# mkfs.ext3 /dev/sda5
mke2fs 1.41.12 (17-May-2010)
Could not stat /dev/sda5 --- No such file or directory

The device apparently does not exist; did you specify it correctly?
[root@localhost Desktop]#

michaelk 12-16-2014 05:16 AM

The syntax is correct. Did you reboot the guest?

arun natarajan 12-17-2014 11:30 PM

I rebooted. Its works fine now. Ty micheal for all your swift responses. I may come with more questions later on :)


All times are GMT -5. The time now is 07:47 AM.