Tag Info

Hot answers tagged

51

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 ...


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.


7

One of the first things a linux system is doing is mounting all file systems to the correct mountpoint in order to let all other parts of the system find their files. The root file system is usually given on the kernel command line. It will mount this file system and look in /etc/fstab for all the other mount points. If you really want to do anything weird ...


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. ...


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. ...


5

I want /etc and /home on one partition No you don't. It's like asking to have your brain transplanted to your knee :-) Whatever your problem is, making /etc a separate partition or merging it with /home is not the solution. What is the actual problem you want to solve?


5

I dont think lsblk and file -s is that ugly, but there is an alternate way. You can use blkid instead. By default, blkid without any arguments will list the known block devices, and a little bit of information about them, including the filesystem type. The format is also in key=value pair format (by default), which makes it easy to dump into a script. This ...


5

Linux LVM is the Linux Logical Volume Manager. Essentially, it's a more sophisticated way of handling disks and avoids the limits with the legacy concept of partitions. If you didn't configure LVM originally, then you shouldn't use it unless you want it specifically. So you should pick Linux. At this stage you're not formatting, you're creating a ...


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

If you have grub installed, run os-prober as root. It does exactly what you want. Update os-prober will only list operating systems other than the one it's on: it's used by GRUB during installation to generate grub.cfg so it's natural that GRUB doesn't need info about the OS it's being installed on. To get the partition mounted as the current /, you can do ...


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

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

This doesn't look like a physical hard drive, more likely it's a LV (Logical Volume) or an encrypted partition or something like that. In any case it's being managed by Device Mapper (hence the /dev/dm- prefix). Run dmsetup info /dev/dm-2 and post the result here. We'll take it from there. EDIT: Ok, it's a LVM volume. All you need now is: Format it ...


4

Linux provide many partitioning tools to re-size or shrink the partition that also without any data loss,It is possible to resize a partition using Gparted in a easy and a convenient way.As its a opensource and free download. To modify the partition with Gparted, it has to be downloaded then burned into a blank CD. This CD will be used as a bootable CD in ...


4

You should create an extended partition in your unallocated space. Extended partitions can be divided into as many logical partitions as you need. If you want to keep your current boot loader, yes, you should install each distro's bootloader into the root of their partition, or even better, not install one at all. After each installation, you will need to ...


4

Instead of creating logical partitions you could create another primary partition and make this a PV (physical volume) for LVM. LVM is much more flexible than partitions. Another advantage is that the volumes have a name then. You may have a VG (volume group) linux with the LVs (logical volumes) debian, ubuntu, opensuse, ... and it's trivial to know what a ...


4

Try running the command fdisk -l <img file>. Typically if the .img files are entire disks from say a KVM VM then they're technically a virtual disk. Example I've got a CentOS KVM VM which shows up like so with the file command: $ file centostest.img centostest.img: x86 boot sector; partition 1: ID=0x83, active, starthead 1, startsector 63, 208782 ...


4

Way back when the earth was young, people would point out that if you have a constant number of bits per inch and a constant number of rpm, the "outside" of a hard drive is slightly faster than the inside. But these days, there's so many abstraction layers between you and the physical layer I'm not sure you even can put a partition there if you wanted to. So ...


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

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 ...



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