Tag Info

Hot answers tagged

18

The simplest solution is to use GPT partitioning, a 64-bit version of Linux, and XFS: GPT is necessary because the MS-DOS-style MBR partition table created by fdisk is limited to 2 TiB disks. So, you need to use parted or another GPT-aware partitioning program instead of fdisk. (gdisk, gparted, etc.) A 64-bit kernel is necessary because 32-bit kernels ...


9

Partprobe calls the BLKRRPART ioctl, which is documented in, err, include/linux/fs.h, and beyond that the kernel source (the meat is in rescan_partitions()): #define BLKRRPART _IO(0x12,95) /* re-read partition table */ The easiest way to find this out is to run strace -e raw=ioctl -e open,ioctl partprobe /dev/sdb. I think what you tried with ...


9

So you know it is a bad idea and you can loose everything. If you still want to do it, here are the steps: Don't do it. If this doesn't help, then: Use the sfdisk tool: First, make a backup of the partition table using sfdisk -d /dev/sda > sda.out Then go for it: sfdisk /dev/sda -O sda-partition-sectors.save You will see something like this ...


8

Just as an alternative to the other suggestions. You don't have to partition a disk at all. You could simple create a Volume Group, with one or more Logical Volumes. pvcreate /dev/sdb vgcreate data /dev/sdb lvcreate --name dump -L '100%VG' data Now you have a logical volume that you can format with any filesystem type you wish. mkfs.XXXX ...


8

fdisk -l (that's lower L in the parameter) will show you, among other information, the sector size too. $ sudo fdisk -l Disk /dev/sda: 150.3 GB, 150323855360 bytes 255 heads, 63 sectors/track, 18275 cylinders, total 293601280 sectors Units = sectors of 1 * 512 = 512 bytes Device Boot Start End Blocks Id System /dev/sda1 * ...


8

fdisk -l can just list the filesystems it has the permission to read on. See my test with strace: user@host:~/test$ strace -e open /sbin/fdisk -l ... open("/proc/partitions", O_RDONLY) = 3 open("/dev/sda", O_RDONLY) = -1 EACCES (Permission denied) open("/dev/sda1", O_RDONLY) = -1 EACCES (Permission denied) open("/dev/sda2", ...


7

@chaos and @Braiam have provided good answers on why you aren't getting the behavior you are looking for from fdisk when running as a non-root user. The simple fact is that allowing regular users to read disks directly would allow bypassing file permissions by simply reading the disk data directly, which could be a major problem and certainly would make file ...


6

Because mkfs does not know or care about partition tables. You can use it on any block device you wish, including those that have nothing to do with a hard disk, and therefore partitions. The partition type code that fdisk puts in the msdos partition table is only a hint and is pretty much ignored by non Microsoft operating systems.


6

Are you asking about the total size of files/directories contained within /, or the total size of the root filesystem? If the former, use df -h /. If the latter, you can do this with du -sh /, which will be very slow, as it has to enumerate every single file. Better, but possibly inaccurate due to things like bind mounts, filesystems stored as sparse files ...


5

No, you should not be required to format the CF card before installing Linux. The Syba adapter should present the CF storage to the computer as a fully-writable SATA drive, and should thus allow the Linux installer to partition and format it. The fact that the installer cannot write to the CF leads me to suspect that at least one of a few things could be ...


5

The partition type is less specific than the filesystem type. Most "native" Linux filesystems use partition type 83, for example: all of the ext* variants, ReiserFS, XFS, and others. You should try switching to parted or gParted. For some filesystem types, it is able to create the partition and create a filesystem in it all within the same tool. (With some ...


5

There are usually no files in the root directory, so I assume you want to know how much space is used in the root filesystem. The command for this is df (disk free). df -h / With no arguments, df provides usage information for all filesystems (except some special, non-disk-backed filesystems for which this is irrelevant). If you want to know how much ...


5

You might try writing a udev rule to give the supplemental HDD(s) sufficiently unique names. Another idea: Whenever you can phrase a security requirement as "It's not who's doing it, it's how they're doing it" you're talking about type enforcement, and in most Linux distros TE is done at the MAC level. Most of my MAC experience is with "SELinux" You can't ...


5

On Linux traditional DOS-partitions will show up this way: Partitions from 1 to 4 are primary partitions Partitions above 5 are logical partitions. In the DOS-partitioning-scheme (this is not Linux-specific) if you want to use logical partitions you have to define a pointer within one of the primary partitions for these. At this pointer the BIOS will ...


5

Use fdisk for drives that are < 2TB and either parted or gdisk for disk > 2TB. The actual difference has to do with the partitioning formats that these tools are manipulating. For disks < 2TB you're often using MBR (Master Boot Record). For disks > 2TB you're using GPT (GUID Partitioning Table). Here's a good article that covers the differences as ...


5

If your objective is to find out the device name of the external drive you just connected, the easiest ways is to run dmesg | tail -20 or so right after connecting it: $ dmesg | tail -20 [ 5610.869053] usb 2-1.4: New USB device strings: Mfr=10, Product=11, SerialNumber=5 [ 5610.869058] usb 2-1.4: Product: Iomega Select HDD [ 5610.869062] usb 2-1.4: ...


4

As root, type in a shell: # cfdisk /dev/sdX #Where /dev/sdX is the device it will show you something like this: cfdisk (util-linux-ng 2.18) Disk Drive: /dev/sdb Size: 3926949888 bytes, 3926 MB Heads: 255 Sectors per Track: 63 Cylinders: 477 Name Flags Part Type FS Type ...


4

There are two places where the partition table is stored: on disk, and in RAM. It sounds like you updated the disk without updating the RAM, then changed the disk back. So if the kernel is still going on what's in RAM, and the next time you boot it reads the same thing off the disk, then yes, it should work. However, you need to be really careful that ...


4

With a traditional Master boot record, you only get four slots for primary or extended partitions. You already have two primary partitions, and one extended (in which you can create logical partitions). So there's only one slot left in the MBR for an additional primary partition.


4

Depending on who set up the old Windows machine (ie: if it's from HP, Lenovo, etc) you may have many different partitions on the disk that you normally wouldn't see with Windows. Those partitions might include recovery, unused space, etc. As mentioned in the answer above, use fdisk to see the partitions. fdisk -l /dev/sdb Using that information you can ...


4

The primary reason to use gparted or parted is if the new disk is bigger than 2TB. But you probably will not be able to effectively set that up from a 32 bit system. If you want to run the new disk from your old system. Stay with a disk smaller than 2TB. You should be able to partition, format and run that from you old computer using fdisk for partitioning. ...


4

At first you need to unmount the second device again, before you proceed with the following steps: You will have to add the device /dev/vdb into your logical volume group VolGroup, you can do this using vgextend. vgextend VolGroup /dev/vdb After this you can first grow the logical volume lv_root to the size of the group, using lvextend. lvextend ...


4

No it doesn't generally matter, it's just setting a value in the MBR portion of the partition.                         On certain OS'es such as Windows it does a check of the parititon type that's written here and will balk if it doesn't ...


3

This is not really a good or bad thing. The error "doesn't contain a valid partition table" does not always actually mean that. You can have a valid partition table at an unrecognized offset and get the same error. For instance: if you create a LVM volume on a raw disk without first creating a partition and then lay down a file system on the volume you ...


3

It is possible to have a filesystem directly on a block device with no partition table on it, and there's nothing intrinsically wrong with that. It just means you can have only one filesystem and nothing else on it (no swap partition, etc...). However, it is unlikely that such a block device is bootable. The bootloader (grub) usually sneaks itself into some ...


3

Question to the question: You asked 'how to partition 22TB disk' and then in the question again, you said, you just wanted a 22TB partition. So this is ambiguos in first place. If you already have a single block device which can support 22TB of space on it, then you already posses whole 22TB partition. All you need is a filesystem on top of it, which will ...


3

If you install GNU parted (libparted), you get an extra command line progam parted. GNU Parted manipulates partition tables. This is useful for creating space for new operating systems, reorganizing disk usage, copying data on hard disks and disk imaging. The package contains a library, libparted, as well as well as a command-line frontend, ...


3

Like, Falmarri indicated in his comment, you are not running fdisk as root. The easiest way to do this, is to run: $ sudo fdisk <path-to-drive>


3

To increase the size of a filesystem you must first grow the logical volume container and then increase the size of the filesystem within. When decreasing the size of a filesystem, shrinking the surrounding logical volume is done last. A shorthand way of expanding a logical volume and the filesystem is contains can be achieved using lvextend with the ...


3

It looks like the partition table on /dev/sda was destroyed. You didn't mention what you did to destroy it, so it's hard to say exactly how you would reconstruct it. You can attempt to use fdisk to recreate the sda1 partition. On the assumption that the disk partitions of the three disks were identical, you can recreate the sda1 partition with fdisk ...



Only top voted, non community-wiki answers of a minimum length are eligible