Tag Info

Hot answers tagged

57

Adding up numbers is easy. The problem is, there are many different numbers to add. How much disk space does a file use? The basic idea is that a file containing n bytes uses n bytes of disk space, plus a bit for some control information: the file's metadata (permissions, timestamps, etc.), and a bit of overhead for the information that the system needs to ...


20

That is not a Linux problem, but a BIOS problem, which affects only quite old systems (the first limit was about 504MiB; logical CHS addressing allowed for up to about 8GiB). The BIOS must be capable of using LBA (INT 13h Extensions, defined 1998 with virtually unlimited address space (64 bit)) for Linux to boot from behind 8GiB. There are several versions ...


16

That is almost certainly the extended partition that contains your logical ones. You should be able to confirm by running parted -l (or fdisk -l) as root. For example, on my system: $ sudo parted -l Model: ATA ST9500420AS (scsi) Disk /dev/sda: 500GB Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type ...


10

Why don't you just use lsblk? For instance: # lsblk -o name,mountpoint,label,size,uuid NAME MOUNTPOINT LABEL SIZE UUID sda 1.4T ├─sda1 /boot boot 953M f557b9f0-edb5-42bb-94d8-27bc03c3c2c7 ├─sda2 ...


8

There is a solution using partprobe from parted software. More information here: http://www.gnu.org/software/parted/ After using your fdisk command and having done your modifications, do a partprobe or partprobe /dev/sdx and it should inform the kernel of the change without reboot.


8

Assume partition as just the rooms in the newly constructed house. It just doesn't have any layout or anything till now. All you have done is constructed new rooms in the house. Now, you need to have the rooms designed for specific purposes (for example, the kitchen has to have more storage shelves, the living room has to have more space to accommodate TV ...


7

hdparm --trim-sector-ranges can trim a range. The man page warns to use it, so you better be sure you got the right range and syntax. I think sending a trim for all data outside a partition would be dangerous, as there is some hidden data there sometimes like bootloader code or second partition tables. You'd need to know exaclty, which areas outside of ...


7

Partitioners like to align partitions on a mebibyte boundary these days. For MBR partitioning, there are 4 primary partitions, and for the rest you need extended and logical partitions. While the layout of the primary partitions is expressed at the end of the first sector of the disk, for the logical partitions, you've got a linked list of additional ...


7

Unmount the partition: # umount /part Rename the directory after making sure it's not mounted: # mountpoint /part &>/dev/null || mv /part /best_name_ever Edit /etc/fstab to replace /part with /best_name_ever Remount the partition: mount /best_name_ever The # is of course meant to represent your root prompt, not actual input to be typed in. ...


7

That partition is the extended partition that was created which then contains sda4, sda5, and sda6 which are logical partitions. In a MBR formatted HDD you can only have at most 4 physical partitions. So often if you want more you need to create an extended partition to contain any logical partitions. See this ArchLinux Wiki on partitioning for more ...


7

Splitting files in /etc across partitions is a bad idea for this reason. What is happening is that the groupadd utility is creating a temporary file, and then replacing the real /etc/groups file (or rather, what the symlink points to) with the temporary one via a simple rename operation. The catch is that rename() only works on the same filesystem, ...


6

Yes it is. There is no requirement for separate partitions in a Linux install, it's just a very good idea. Having certain partitions separate protects you from losing everything if a single partition fails. It is also good to have your $HOME on a separate partition as that facilitates reinstalling or changing distributions. However, you are free to set up ...


6

Here is the problem in your understanding: My understanding is that the bootloader GRUB2, is mounted to /boot. GRUB is not "mounted" on boot. GRUB is installed to /boot, and is loaded from code in the Master Boot Record. Here is a simplified overview of the modern boot process, assuming a GNU/Linux distribution with an MBR/BIOS (not GPT/UEFI): The ...


6

Separate /boot partition used to be needed (the BIOS in older computers couldn't boot except from the start of the hard drive, and GRUB 1 couldn't boot from some filesystems). Nowadays you don't really need to have a separate /boot partition, except in some specific scenarios (e.g. encrypted root partition). Also, it's used for EFI, as noted in a comment. ...


6

You will first need to reconstruct the partition table the way it was. This will not affect the contents of any partition, just the system's idea of where each partition begins and ends. It sounds like you might have already done this because you seem to have a partition that exists that is "unknown", but exactly the same size as the partition was before. ...


5

There are a bunch of options mostly named CONFIG_.*_PARTITION, you probably didn't set the one you need. These may only show up if you answer yes to CONFIG_PARTITION_ADVANCED (Advanced partition selection). You're going to want (on a PC) at least: CONFIG_MSDOS_PARTITION=y # traditional MS-DOS partition table CONFIG_EFI_PARTITION=y # EFI GPT ...


5

You use your favorite partition tool (fdisk, cfdisk, parted) in order to change the partition ID. You make the partition a valid LVM partition with pvcreate. You make the new PV available with vgcreate or vgextend. Not complicated at all. The worst case would be that you need partprobe or a reboot for LVM to recognize the new partition but probably LVM ...


5

According to a Lifehacker how-to, it is possible to dual-boot an Intel-based Mac with OSX and GNU-Linux, but you'll need to shrink your HFS partition and create an EXT3/4 partition and a swap partition in that space (instead of installing in/on an HFS partition). The following is verbatim from that How-To: Boot your Mac into OS X. If you're lucky, this ...


4

You want the partprobe command. Run it without arguments to re-read the partition table on all disks, or with a specific device to only re-read for that device, e.g. partprobe /dev/sda.


4

There isn't a standard offset per-se, as of course you can start the partition wherever you want. But let's assume for a moment that you're looking for the first partition, and it was created more or less accepting defaults. There are then two places you may find it, assuming you were using a traditional DOS partition table: Starting at (512-byte) sector ...


4

After research triggered by @guest, I found that there is an apparent bug in the grub-mkconfig helper script, /etc/grub.d/10_linux, which makes the fallback initramfs GRUB entry not compatible with the GRUB submenu system. As the usage of a fallback initramfs is very specific to Arch and derivatives, it is not supported by upstream grub-mkconfig. A ...


4

As root: modprobe loop max_part=16 losetup /dev/loop0 file.img vgchange -ay # if using LVM on there mount /dev/the-device /mnt (where the-device is the device (/dev/loop0p2 or /dev/someVG/someLV) with the filesystem that contains your file. Then edit the file, and: umount /mnt vgchange -an someVG # if using LVM there losetup -d /dev/loop0 ...


4

Given that chunks can be quite big and that the parity information is simple XOR (i.e. does not affect data before or after the piece in question) the assumption that only complete chunks can be written does not make sense to me. Chunks are the unit in which data is spread over the volumes. One chunk of continuous data is written to a certain volume, the ...


4

They way I would go about this is to partition the SSD as you want it (/, /boot, /home, etc) and since you're moving everything to a new SSD you don't need to worry about shrinking partitions or anything complicated like that. You basically just need to copy everything to the SSD, repartition the HDD and edit your mount points on disk and in your fstab. ...


4

Moving pacman is not the right approach. You do, however, have a couple of options. All of them assume that you already have a full and tested backup of your data. First, make sure that you have cleared all available space in pacman's cache with pacman -Sc: pass the second c for everything. There is a pacman tool for more fine-grained control fo this, see ...


4

Warning: with dd you can destroy data very easily, make sure you have backups and are familiar with dd before using it dd starts copying from the first byte of the disk you specify, including the master boot record, mbr. For example http://www.cyberciti.biz/faq/howto-copy-mbr/ dd if=/dev/sda of=/tmp/mbr.bak bs=512 count=1 This will copy the first 512 ...


4

No! /dev/sda contains: a small /dev/sda1 which is needed to boot. a extended partition /dev/sda2 The extended partition contains a logical partition /dev/sda5. The logical partition contains a LVM setup, broken down into to two logical volumes: /dev/mapper/server--vg-swap_1 which is your swap space /dev/mapper/server--vg-root which is your root (/) ...


3

It says it right there: WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Your /dev/sda is using a GUID Partition Table. Your version of fdisk doesn't support GPT, so all it can see is the fake MBR partition that takes up your entire disk. Try using gdisk or another program that supports GPT.


3

This is easy using parted. The -s option is used for scripting. The following produces the same results as your fdisk line: parted -s /dev/sda mkpart primary NTFS 1 24G


3

If you have a recent enough version of util-linux, it contains the tool blkdiscard which is able to TRIM entire devices, or ranges within a device using --offset and --length options. Please note: blkdiscard is dangerous, if you let it TRIM the wrong regions, your data is gone! So you can figure out the unpartitioned (free) regions of your partition table ...



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