Saturday, May 2, 2015

hard drive - Make gdisk create /dev/sdb1




I ran gdisk on /dev/sdb, a 4TB USB external drive, and "gdisk -l"
suggests I did it correctly:



# gdisk -l /dev/sdb 

GPT fdisk (gdisk) version 0.6.6

Partition table scan:
MBR: protective
BSD: not present

APM: not present
GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sdb: 976754645 sectors, 3.6 TiB
Logical sector size: 4096 bytes
Disk identifier (GUID): 915A2474-7348-48FC-A436-64CE30DEE0B3
Partition table holds up to 128 entries
First usable sector is 6, last usable sector is 976754639
Partitions will be aligned on 2048-sector boundaries

Total free space is 2042 sectors (8.0 MiB)

Number Start (sector) End (sector) Size Code Name
1 2048 976754639 3.6 TiB EF00 EFI System


However, gdisk didn't create /dev/sdb1 or /dev/sdb[anything].



How do I access the partition I presumably just created?




Notes:




  • I tried other partition types where it says EF00, but same problem.


  • I tried cfdisk (which DID create /dev/sdb1), but it didn't work, probably because the disk is > 2TB



Answer



Sometimes newly-created partitions don't appear until you unplug and re-plug the disk (if it's removable) or until you reboot the computer (if it's an internal disk). This is most likely to happen if you're replacing existing partition(s) and if one or more of those is in use when you run gdisk (or fdisk or parted). Thus, I recommend you unplug the disk and plug it back in again. Note that if a partition was in use, it's best to unmount it before partitioning the disk. If you don't do so, the disk may reappear as /dev/sdc rather than /dev/sdb when you plug it back in.



Another possibility is that your kernel lacks support for GPT. This is unlikely on precompiled kernels that come with any but very old versions of Ubuntu, Debian, Fedora, OpenSUSE, and other major distributions; but if you're using a very old distribution or if you've built your kernel yourself, it might be missing GPT support. In this case, you'll simply have to upgrade your kernel, or fix the kernel options and recompile it.



No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...