Tag Info

Hot answers tagged

67

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


31

This is a limitation imposed by having a very old BIOS and bootloader rather than Linux itself. The BIOS would only be able to access the first 1024 cylinders of the disk (see here for more information on what cylinders/heads/sectors are). This limitation would extend to bootloaders which, due to their simple nature, would not have their own disk drivers and ...


29

Minimizing loss: If /usr is on separate partition a damaged /usr does not mean that you cannot recover /etc. Security: / cannot be always ro (/root may need to be rw etc.) but /usr can. It can be used to made ro as much as possible. Using different FS: I may want to use different system for /tmp (not reliable but fast for many files) and /home (have to be ...


27

You can use sfdisk for this task. Save: sfdisk -d /dev/sda > part_table Restore: sfdisk /dev/sda < part_table


27

With udev, You can use ls -l /dev/disk/by-label to show the symlinks by label to at least some partition device nodes. Not sure what the logic of inclusion is, possibly the existence of a label.


24

This is a holdover from "ye olde tymes" when machines had trouble addressing large hard drives. The idea behind the /boot partition was to make the partition always accessible to any machine that the drive was plugged into. If the machine could get to the start of the drive (lower cylinder numbers) then it could bootstrap the system; from there the linux ...


24

One reason for having a /boot partition is that it allows for things like encrypted /, where the kernel and initrd are loaded from an unencrypted partition and then used to mount the encrypted root partition containing the operating system. It shouldn't matter for general usage however.


24

It certainly is possible to share a home folder (or partition) over different linux distributions. But take the following notes: UID and GID must be the same on each distributions for the certain user(s). (as already pointed out) different configuration files for the same programs could result in unexpected behavior. If you install all distributions onto ...


24

There are misconceptions behind your questions. Swap is not mounted. Mounting isn't limited to partitions. Partitions A partition is a slice¹ of disk space that's devoted to a particular purpose. Here are some common purposes for partitions. A filesystem, i.e. files organized as a directory tree and stored in a format such as ext2, ext3, FFS, FAT, ...


24

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


24

Such an utility is zerofree. From its description: Zerofree finds the unallocated, non-zeroed blocks in an ext2 or ext3 file-system and fills them with zeroes. This is useful if the device on which this file-system resides is a disk image. In this case, depending on the type of disk image, a secondary utility may be able to reduce the size of the disk ...


23

Why don't you just use lsblk? For instance: # sudo 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 ...


22

It's possible. In fact, you can share the swap space between completely different operating systems, as long as you initialize the swap space when you boot. It used to be relatively common to share swap space between Linux and Windows, back when it represented a significant portion of your hard disk. Two restrictions come to mind: The OSes cannot be ...


22

In order to align partition with parted you can use --align option. Valid alignment types are: none - Use the minimum alignment allowed by the disk type. cylinder - Align partitions to cylinders. minimal - Use minimum alignment as given by the disk topology information. This and the opt value will use layout information provided by the disk to align the ...


20

Keep your /home on a separate partition. This way, it will not be overwritten when you switch to another distro or upgrade your current one. It's also a good idea to have your swap on its own partition. But that should be done automatically by your distro's installer. The way my laptop is setup, I have the following partitions: / /home /boot swap


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


19

The correct answer, which will also work with GPT disks, was given here and here by Kris Harper. You need GPT fdisk. Look at the download page or run sudo apt-get install gdisk. Then use the sgdisk command like so sgdisk -R=/dev/sdb /dev/sda sgdisk -G /dev/sdb The first command copies the partition table of sda to sdb (be careful not to mix ...


19

Another reason beside the mentioned BIOS problem is that a separate /boot partition allows the use of a file system for the / volume which the boot loader does not understand (without being limited to block list loading like with lilo).


18

A separate /usr can be useful if you have several machines sharing the same OS. They can share a single central /usr instead of duplicating it on every system. /usr can be mounted read-only. /var and /tmp can be filled up by user programs or daemons. Therefore it can be safe to have these in separate partitions that would prevent /, the root partition, to ...


17

Normally I would suggest a solution such as "hook up the 2nd hard drive using an external enclosure, boot from a linux CD, then use a command such as 'dd if=/dev/sda of=/dev/sdb bs=1G', but since you want to use the same technique for work, I have what may be a better solution. All of my servers and laptops get imaged at work using Clonezilla. There are ...


17

The history /boot contains files that aren't used by the operating system, but by its bootloader. You'll find both files of the bootloader itself (like /boot/grub/* for Grub) and the Linux kernel (/boot/vmlinuz*) and often an associated initrd or initramfs. On a PC with legacy BIOS (as opposed to the newer UEFI found on most recent computers), the software ...


16

There is a blkid command which may be what you are looking for. Results are similar to the following: $ sudo blkid /dev/mapper/vg_rootdisk-lv_var /dev/mapper/vg_rootdisk-lv_var: LABEL="LV_VAR" UUID="08520908-03cd-4e42-a4e4-0f5a771be16c" TYPE="ext4" One other option is to use the udevadm command, which likely will give you far more than you need: $ sudo ...


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


15

You can use pvmove to move those extents to the beginning of the device or another device: sudo pvmove --alloc anywhere /dev/device:60000-76182 Then pvmove chooses where to move the extents to, or you can specify where to move them. See pvs -v --segments /dev/device to see what extents are currently allocated.


14

Historically, hard drives have only been able to contain at most four partitions because of the originally defined format of the partition table. This is not specific to operating systems. You simply can't create more than four primary partitions.* In order to circumvent this limit and still remain compatible with older systems, you can create an extended ...


14

Yes, you can do this with the /sys filesystem. /sys is a fake filesystem dynamically generated by the kernel & kernel drivers. In this specific case you can go to /sys/block/sda and you will see a directory for each partition on the drive. There are 2 specific files in those folders you need, start and size. start contains the offset from the beginning ...


13

One side effect I can think of is: Hibernate system1 (using the swap partition for hibernation). Boot system2. You could lose data.


13

It seems that you have a lot more files than normal expectation. I don't know whether there is a solution to change the inode table size dynamically. I'm afraid that you need to back-up your data, and create new filesystem, and restore your data. To create new filesystem with such a huge inode table, you need to use '-N' option of mke2fs(8). I'd ...


13

You're not going to be able to use GParted because the filesystem is on LVM and GParted does not support that. First, TAKE A BACKUP OF THE VM. Then perform the following as "root" from a command line. It looks like you've already rebooted but just in case, ensure the kernel recognizes the larger disk echo 1 > /sys/class/scsi_disk/0:0:0:0/device/rescan ...


13

BOOTING IS HARD Booting... well... it really is the hardest part. Every time a computer boots it basically meets itself anew. It acquaints itself with its various parts, and for each one it meets it gains capability. But it has to pull itself up by its own bootstraps, so to speak, from square one every time. The trick is - when designing a boot process - ...



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