Tag Info

Hot answers tagged

6

You can use: mount for a list of all mounted filesystems and mount options for each of them; lsblk for a tree of block devices, size and mount point (if mounted); df for a list of mounted block devices, size, used space, available space and mount point.


6

Another approach is with findmnt: findmnt /dev/sda4 ...to get mountpoint from dev. Or vice-versa: findmnt /home


3

Depends on what you're after. If you want to check which of the partitions in /dev/sd* has a default mountpoint and what that mountpoint is, you could do for part in /dev/sd*; do grep -w "$part" /etc/fstab | awk '{print $1,$2}; done However, on most modern systems, partitions are mounted by UUID and not dev name, so a better approach1 would be: for uuid ...


3

You're actually asking two questions. The easiest thing to do if you want to know where your home is: cd df -h . Or df -h $HOME Where is /tmp mounted? df -h /tmp ...etc. If you want to know what is mounted on a certain device, mount | grep ^/dev/sda1 (for example). Or mount | grep ^/dev/sd to see all the sd's.


3

The dirty bit is set and cleared in the kernel, when mounting and unmounting a device; see http://lxr.free-electrons.com/source/fs/fat/inode.c?v=3.19#L578 for the implementation. There's no way currently to access this function outside the kernel, except by mounting and unmounting... To set it yourself, you'd need to tweak the device directly; the state ...


2

You can use mount command. It also shows options with which the mounting is done.


2

You're looking for the df command.


2

I'm a fan of LVM but I don't think it is required in this case - if all you want to do is to expand your sda1 filesystem to use the rest of the space on this drive. Assuming you don't at the moment have any data on your sda3, a better strategy is: with fdisk it is hard to work out the actual sizes of the partitions, use swapon -s to show the size of your ...


2

Current util-linux versions of fdisk support GPT, the one I'm looking at here is fdisk from util-linux 2.24.2 (reported via fdisk -v). Run fdisk /dev/whatever. Have a look at the options with m. Note these change depending on the state of the partition table. First check what state the disk is currently in with p. Note the Disklabel type; if it is gpt ...


2

Why can I rest assured that GNU Parted has not corrupted a single bit after shrinking my partition? You can't, in fact, gparted man page clearly says (under NOTES): Editing partitions has the potential to cause LOSS of DATA. ...... You are advised to BACKUP your DATA before using the gparted application. Reboot your system after resizing the ...


2

If resizepart does not work, you might have to resort to rm and mkpart to achieve the same thing. Of course, this would require you to parse the partition table first in order to determine partition type and start offset. Unless you already know the necessary values. After all you had to get the 166016512B from somewhere too. parted has the --machine ...


1

Apart from Dylan suggestions to start over, another, non-intrusive option is to move some material from the root partition to the partition for the home directories. You should only do that for non-boot-critical material, but there is a lot of that in / outside of /home. My first Unix even had separate partitions for /usr and /var. You can copy e.g. ...


1

Have you formatted the swap partition? Once you part your disk and reserve a partition for swap you have to: sudo mkswap /dev/sdb5 after that your swap's UUID should be displayed when entering blkid command.


1

Your drive is formatted using extended and logical partitions. The MBR partition table format allows only 4 primary partitions, so /dev/sda1 - /dev/sda4 are reserved for primary and extended partitions. If you want more than 4 partitions, then you have to use logical partitions within an extended partition. In your case: /dev/sda1 is a primary partition ...


1

First, you can't extend /dev/sda1 to include /dev/sda3 as their space allocations are NOT contiguous. You'd have to dump everything, re-layout the partitioning, and restore. Second, /dev/sda1 does not to appear to be an LVM partition. Even if you wanted to add the apparently unclaimed physical volume created in /dev/sda3, this would not be possible. ...


1

The apparent answer is to run these two commands lvcreate --name opt --size 23Gi group mkfs -t ext4 -L opt /dev/group/opt However, via the comments thread it became apparent that lvcreate threw an error message, /dev/group/opt: not found: device not cleared Aborting: Failed to wipe start of new LV A search on Google finds that this is a known error, ...


1

In theory, in your C program, you should add a line like this: int res = system("/bin/parted <options>"); The C program must be executed with root privileges (or run through sudo). The res variable contains the result of the command (see man system for details). As an alternative, use a command of the exec family (see man exec for details). For ...


1

Look at Moving /etc to separate partition for reasons it's difficult (if not impossible) to use separate partitions for /etc or subdirectories thereof. You might find etckeeper useful for your use-case; it allows keeping /etc in a version-control system such as git, which means you can then easily maintain a copy somewhere else with all the history. If ...



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