date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,404,431,914,000 |
I have one drive with dual boot. I split it evenly between Windows and Linux Mint, but right now almost never use Windows. I want to keep Windows for gaming/Office, but move some of its disk space from Windows C: drive to Linux /home. Can I do that safely? Is it possible it's as easy as explained here? Does gparted take care of moving things around on Windows drive so that no data is lost?
|
I've done this several times on several laptops already, never had any issues. And it is as easy as explained there.
But remember to:
Defragment Windows drive,
Leave some space free for both systems
Do not "move around" partitions. If your Linux partition precedes windows → space will be freed after windows partition → you can allocate new ext4 partition and add mounting point of your prefference *
** you can move around swap partition as far as I know
| Shrink existing Windows partition to extend Linux home one? |
1,404,431,914,000 |
I installed Debian about 5-6 days ago alongside Windows 7 and I've got it running almost perfectly besides a few bugs here and there. Yesterday I booted into Windows and shrunk the C: drive so I could add extra space to my Linux partition. Yes I have an MBR based system and my partitions are all used up. However, my C: drive in Windows is behind my Linux partition. So the free space ended up being behind the root partition of Linux on the partition table in GParted. How do I use this free space that's behind my root partition? I want to make this free space a part of my Linux root partition. Please refer to the picture below.
|
There is actually some good documentation for moving partitions around using gparted. You'll want to make sure your filesystems are unmounted before moving things around. The easiest way to do this (and it looks like you have done this step already) is to use the Ubuntu livecd or liveusb, and boot into gparted.
Once there, you'll want to move your ext4 filesystem over to the left (this is your root filesystem for your Ubuntu install, that lives on /dev/sda3), so that your unallocated space is directly to the right of your /dev/sda3 partition. Next, you'll need to extend the partion across the unallocated space. Once your partition is extended, your final step will be to run a resize2fs on your root filesystem to extend it across the new space in the partition.
The link below gives all the steps you need:
https://gparted.org/display-doc.php?name=help-manual#gparted-move-partition
edited: changed left from right.
| How Do I Extend the Root Partition Backwards |
1,404,431,914,000 |
Problem
When attempting to delete the remnants of my RAID1 setup I'm getting the following error:
WARNING: Not using lvmetad because duplicate PVs were found.
WARNING: Use multipath or vgimportclone to resolve duplicate PVs
Background:
I'm very new to Linux, and am currently on a journey to setup an Ubuntu server with a 1TB maindisk supported by 2x 2TB data disks in a RAID1 array. The RAID1 array is configured via the motherboard and was working as expected, however I made the mistake of attempting to install Ubuntu to the RAID1 array.
Once I realized how foolish that was I disconnected the RAID drives and connected a 1TB maindisk, to which I installed Ubuntu. That went ok (nVidia drivers were a hurdle to overcome.)
With that installed I then reconnected my RAID1 array only to find that my previous installation Ubuntu attempts were still on there, and now the system was mounting them when I booted up rather than mounting my new install on my maindisk.
My thinking at this point was:
Reset the machine
Remove the hardware RAID1 setup on boot
Boot GParted from CD
Delete the data left over from the RAID1 partitions
Reboot the machine
Recreate the RAID1 hardware setup
Boot GParted from CD
Format the RAID1 partition in ext4
Reboot machine back into Ubuntu
Mount the new RAID1 partition
I got to step 4 - at this point GParted is telling me that there are 'duplicate PVs' on the system. I've attempted to Google this problem and also search stack exchange, but I think my naivety with Linux is blocking me from seeing the answer.
My assumption is that the PV is some sort of drive controller and I've completed botched up the state of the drives, meaning that when GParted runs this command it gets confused:
lvm pvremove /dev/sdb5
If anyone could help me figure this out I'd be in their debt, especially if I can get pointers to resources for all these new acronyms I'm coming across (what is PV for example.)
Thanks!
|
Someone posted on another forum - turns out the wipefs command was what I needed. I ran the following from GParted and now I'm back in business:
sudo wipefs -a /dev/sda
sudo wipefs -a /dev/sdb
This wiped the two drives back to a completely unallocated state, and now I've reset up the RAID1 array, created a new partition, and formatted it with ext4.
| Duplicate PVs error in GParted when attempting to delete RAID1 setup |
1,404,431,914,000 |
I'm playing around with Solaris 11.1, and have run into a bit of a problem...
I've installed three OS on my computer - LinuxMint, FreeBSD and Solaris - and have partitioned my harddrive (/dev/sda on LinuxMint) thus:
Disk 500GB
sda1 (Primary Partition): FreeBSD (UFS) 50GB
sda2 (PP): "Storage" (VFAT) 50GB
sda3 (PP): Solaris (zpool/zfs) 100GB
sda4 Extended Partition (what's left)
sda5 (Logical Partition): LinuxMint, / (root) 50GB
sda6 (LP): LinuxMint, /home 100GB
sda7 (LP): LinuxMint, swap 2.5GB
I used LinuxMint fdisk to set-up the partitions, using "old-style" DOS partition-table. I boot with grub in MBR, managed from LinuxMint. In addition, the Solaris-partition has it's own GRUB (to select between Solaris boot-enviroment) - it shows when I select "Solaris" from the MBR-GRUB.
In LinuxMint, all partitions are correctly identified and listed - and accessable. When I used gparted from LinuxMint, the disk is shown as partitioned as described above.
However in Solaris, it doesn't look like all partitions are correctly identified - in fact, I seem to only be able to access the Solaris-one... and it's sort of reported as being the only partiton on the disk (I think):
# zpool status
pool: rpool
state: ONLINE
scan: none requested
config:
NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
c7d0s0 ONLINE 0 0 0
errors: No known data errors
I've not used Solaris much - and I still struggle with how it addresses disk-partitions - but in my mind, c7d0s0 means "controller: 7, disk: 0 and slice(?) 0" - I would've expected slice 2 or 3, since it's the 3rd partition on the disk.
When I use gparted (as root) under Solaris, my harddisk (/dev/sdk/c7d0p0) is reported as being one large block of "unalocated" with a size of 500GB - this matches the size of my disk... But since I'm working from it, I know there is at least a 100GB zpool there with several zfs filesystems.
Probably it's just me not knowing the ins and outs of Solaris enough - or how what commands to use - but I'm stomped...
What I would like to do, is mount the VFAT-partiton (/dev/sda2 under LinuxMint) under Solaris. As I understand it, Solaris is able to read VFAT-partitions (unlike for example ext4), and I'd like to use it to back-up some stuff from Solaris...
So how do I get Solaris to "see" the other partitions on the disk? What should be the device of the 2nd partition on the disk? I assume the mount command works pretty much like the one in Linux...
|
What actually happens with Solaris is that when you create a partition, Solaris will create a "disk" inside it. So when you see c7d0s0, means controller 7 disk 0 slice 0. Now in x86 the disk is in fact your partition.
Your full disk contains something along these lines:
Physical disk:
sda1 - Linux
sda2 - VFAT partition
sda3 - Solaris partition with SMI label.
Slice 0 thourgh slice 8, slice 2 represents the full disk (x86 partition)
sda4
sda5
sda6
sda7
Traditionally if you want to mount the VFAT partition, you can do it like this:
mount -F pcfs /dev/dsk/c7d0p1 /path/to/mountpoint
if you want to see which partition have recognized filesystems, you can also do:
fstyp /dev/rdsk/c7d0p1 or p2 or p3
In addittion, you can do fdisk /dev/rdsk/c1t0p0 to list all the partitions, careful not to use destroying options.
You can also take a look here for more information.
| Can't mount partition/partitions not recognized in Solaris 11.1 |
1,470,336,089,000 |
I have dual-booted Windows 8.1 and Fedora 24. But, I want to triple book now, with another not very known Linux OS. My partitions looks like this:
I know that I can only create 4 primary partitions, and in my case I already have the 4 primary partitions, therefore, I cannot create a new partition with my unallocated space. I simply want now to put that unallocated space under my /dev/sda4 extended partition, so that maybe I can install my new Linux OS in that partition. Also the output of fdisk -l command can be found below:
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x6b62875c
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 718847 716800 350M 7 HPFS/NTFS/exFAT
/dev/sda2 718848 790124543 789405696 376.4G 7 HPFS/NTFS/exFAT
/dev/sda3 840456192 842553343 2097152 1G 83 Linux
/dev/sda4 842553344 976773119 134219776 64G 5 Extended
/dev/sda5 842555392 850943999 8388608 4G 82 Linux swap / Solaris
/dev/sda6 850946048 976773119 125827072 60G 83 Linux
The Linux OS that I want to install is a custom one based on Debian, and it doesn't include GParted so that I can change stuff with Live CD. Any idea how to get around this situation and install my new OS in the unallocated space?
|
Use GParted from a live CD/USB to move your partitions around (you can't do this from the mounted Linux itself). You can use any live distribution that includes GParted, such as GParted Live.
First move the /boot partition to the beginning of the unallocated space (“Resize/Move” button, set “Free space preceding” to 0). Then move the beginning of the extended partition to the beginning of the unallocated space and set the size as large as it goes.
To gain a little more flexibility, you can move the existing /boot partition to a logical partition. I don't think you can do this directly in GParted, you need to create a logical partition of the same size, copy the data, and remove the original partition.
Alternatively, a separate /boot partition is necessary only on old computers with BIOS limitations (and I don't think any of those can run Windows 8) or if the root partition is encrypted (which yours isn't), so you could move all the files from the /boot partition into the /boot directory of the root partition and then remove the /boot partition.
Whichever strategy you choose, you've modified /boot, so you need to run grub2-install again. If you changed /boot from a primary partition to a logical partition, you need to update /etc/fstab and /boot/grub2/grub.cfg to reflect the changed partition number. If you moved /boot to the root partition, you need to remove the entry from /etc/fstab and also update /boot/grub2/grub.cfg. I'm not sure if you're supposed to edit grub.cfg directly on Fedora; the wiki may help.
For more flexibility with partitions, use LVM. It's easier to resize partitions, they don't have to occupy consecutive disk space, manipulations are less error-prone and you can often do it from the live system.
| How to put an unallocated partition under extended partition? |
1,470,336,089,000 |
I've got an external disk with 6 partitions: 4 for linux, one storage in HFS+, and one storage in ext4. I'd like to delete the ext4 storage one and move it's resulting unallocated space into my HFS+ one, but in GParted, I delete the ext4, and it becomes unallocated. But when I try to resize my HFS+, I can't enter a new value for "New size (MiB)", and the up arrow for it's size is disabled. How can I do this?
My partitions:
/dev/sdb1 ext4 /boot 476.84 MiB
/dev/sdb2 linux-swap 1.86 GiB
/dev/sdb3 ext4 / 9.31 GiB
/dev/sdb4 ext4 /home 46.57 GiB
/dev/sdb5 hfs+ SodiumOxide 523.32 GiB (89.81 used, 433.51 unused)
/dev/sdb6 ext4 WiiMC 14.65 GiB (5.36 used, 9.29 unused)
I'd like to delete sdb6 and add it's resulting unallocated space to sdb5 (SodiumOxide)
|
You can't enlarge it with GParted because it currently does not support HFS+ partition "grow". It only supports HFS+ "shrink". See
Gparted features
or, on your machine:
GParted >> View >> File System Support
| Can't increase partition size with GParted? |
1,470,336,089,000 |
I've been a Linux user for about 15 years. Since the feature existed, I used LUKS to encrypt the partitions on which I was installing Ubuntu.
I have the following issue: when someone else uses my computer, I have to be there to boot it, because only I should know the decryption secret phrase.
To solve this problem, I thought of installing several OS on my hard drive, one on a LUKS encrypted partition (for me) and another on a non-encrypted partition (for others). This with a dual boot that would allow booting either on the encrypted partition or on the non-encrypted partition.
Unfortunately, I was noble able to implement this idea. After manual partitioning under gparted, the installation always fails.
I'm looking for a tutorial that would explain how to install two GNU/Linux systems in dual boot, one of them encrypted and the other one not.
|
Prepare a partition for /boot/efi and a partition for /boot in gparted
|------+-------------+-----------+------+-------+-----------|
| Name | Mount point | Flag | Size | FS | Comment |
|------+-------------+-----------+------+-------+-----------|
| sda1 | /boot/efi | esp, boot | 300M | FAT32 | |
| sda2 | /boot | | 2G | EXT4 | |
| sda3 | | | | EXT4 | Encrypted |
| sda4 | | | | EXT4 | Clear |
|------+-------------+-----------+------+-------+-----------|
Install clear GNU/Linux on sda4
At manual partitioning step
Select sda1
Format FAT32
Flag esp boot
Mount /boot/efi
Select sda4
Format EXT4
Mount /
Install crypted GNU/Linux on sda3
At manual partitioning step, check encrypt
Select sda1
Mount /boot/efi
Select sda2
Format EXT4
Mount /boot
Select sda3
Delete partition
Create partition
Check crypt and enter passphrase
Mount /
Edit grub
From crypted GNU/Linux do sudo gedit /etc/default/grub
Enable os-prober by uncommenting #GRUB_DISABLE_OS_PROBERfalse`
Do
sudo grub-mkconfig -o /boot/grub/grub.cfg
reboot
Notes
To have the passphrase asked after kernel selection,
encrypted GNU/Linux kernels have to be stored on a specific /boot/efi partition (sda2)
clear GNU/Linux kernels have to be stored in the same partition as clear GNU/Linux (sda4)
| How to install two GNU/Linux in dual boot with one under LUKS and the other not? |
1,470,336,089,000 |
Well I created a directory in the home directory in order to copy some books from my hard drive, and I found that there wasn't enough space on the home directory.
As you can see below, I have got 377G (available) mounted on the root directory[dev/sda5], but only 38G mounted on the home directory of which only 16G is available [dev/sda7].
How do I get all that big space in the root into my home directory, so that I can utilize the space!?
$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 1.7G 0 1.7G 0% /dev
tmpfs 339M 1.8M 337M 1% /run
/dev/sda5 413G 16G 377G 5% /
tmpfs 1.7G 59M 1.6G 4% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 1.7G 0 1.7G 0% /sys/fs/cgroup
/dev/loop0 98M 98M 0 100% /snap/core/9289
/dev/loop2 55M 55M 0 100% /snap/core18/1754
/dev/loop1 97M 97M 0 100% /snap/core/9436
/dev/loop3 161M 161M 0 100% /snap/gnome-3-28-1804/116
/dev/loop4 162M 162M 0 100% /snap/gnome-3-28-1804/128
/dev/loop5 256M 256M 0 100% /snap/gnome-3-34-1804/33
/dev/loop6 256M 256M 0 100% /snap/gnome-3-34-1804/36
/dev/loop8 63M 63M 0 100% /snap/gtk-common-themes/1506
/dev/loop7 44M 44M 0 100% /snap/riseup-vpn/159
/dev/loop9 44M 44M 0 100% /snap/riseup-vpn/161
/dev/loop10 31M 31M 0 100% /snap/snapd/7777
/dev/loop11 30M 30M 0 100% /snap/snapd/8140
/dev/loop12 2.8M 2.8M 0 100% /snap/telegram-cli/25
/dev/loop13 124M 124M 0 100% /snap/tusk/29
/dev/loop15 92M 92M 0 100% /snap/youtube-dl/2846
/dev/loop14 92M 92M 0 100% /snap/youtube-dl/2840
/dev/sda1 256M 54M 203M 21% /boot/efi
/dev/sda7 38G 21G 16G 57% /home
tmpfs 339M 72K 339M 1% /run/user/1000
|
Normally you should resize your partitions, reducing the space assigned to /dev/sda5 and increasing that for /dev/sda7. This is the best long-term strategy.
Obviously this is awkward and does not consider what might happen to /dev/sda6.
update: /dev/sda6 is swap.
Since /dev/sda6 is a swap partition, then you can safely perform the following. Note: almost the same applies if you can temporarily backup sda6 somewhere (possibly on a file in the root filesystem using dd).
disable the swap in /etc/fstab.
use swapoff to unload the swap, or backup sda6 if it is not swap.
(recommended) reboot to single user mode.
use resize2fs to shrink the / file system (but not the partition)
resize the root partition to match the smaller file system
remove the useless /dev/sda6 from the partition table.
create a new sda6 partition from the free space plus the space left by the old sda6
format the resulting sda6 and rsync /home to it.
get the UUID of the new sda6 partition with blkid, mount it as /home in fstab.
unmount the old home in /dev/sda7. Verify that the new /home mounts OK. Now /dev/sda7 has become redundant.
remove /dev/sda7.
increase the size of /dev/sda6 into the newly created free space, leaving enough space for swap
recreate a smaller /dev/sda7 for swap from that reduced space.
resize the file system in sda6 with resize2fs to match the larger partition size.
mkswap /dev/sda7 and set it using its UUID in fstab; activate it with swapon (or restore from backup)
(recommended) reboot and run fsck to ensure everything is copacetic.
You now have a larger /home in /dev/sda6 and a swap in /dev/sda7. Everything else remains unchanged. With care, you might even not need to reboot, though I recommend it to catch any mistakes you might have done (e.g. wrong UUID in fstab, etc.).
Errors in partition/filesystem size matching may result in total data loss, so unless you're very sure of yourself, a full backup is also strongly recommended.
Some partition editors could allow you to split /dev/sda5 and create a further partition inside. You would have unordered partitions: 5, 8, 6 and 7. Format partition 8, rsync home onto partition 8, mount home there, and now you have a home of, say, 200 GB, and a free /dev/sda7 which you can merge with /dev/sda6 (remember to enlarge the filesystem afterwards).
Another possibility is to create an area in /dev/sda5 which is writable by your user, say /opt/books. Being on /dev/sda5, this area has 377 GB of free space. Create a symlink in home (books -> /opt/books) and you will seem to have 377 GB of books in your home, while they actually aren't. Quick and dirty, but it might work for you.
Note that several backup strategies (e.g. "time machine" rsync + hardlink based) assume that /home is all on a single file system, through flags like rsync's -x or the explicit use of hard links. These strategies will now either fail or silently omit to backup the content of what looks like the /home/user/books directory. That backup may or may not be added to the backup for / (but /opt is often omitted and offloaded to a different backup. On one system I for example have separate backups for /etc, /opt and /usr/local, with / otherwise not backed up at all - being a standard distro, given the config and the list of packages I just reinstall it from scratch).
Other fancier methods exist.
| Low size on home directory |
1,470,336,089,000 |
I am having an issue following instructions on how to increase from here.
I cannot get the unallocated space to merge with the sda1, no matter what I try. I allocate the 30GB, then try it that way, but it still doesn't work. I copied sda1 into unallocated -- still didn't work!
I can decrease size of sda1, but cannot increase it.
I've done:
Shut down VM
From settings change disk sizze
in CD/DVD setting, load the Ubuntu ISO
Start VM, press F2 to get in bios, and change Boot to CD first
5/ Run ubuntu as guest
sudo apt-get install gparted
Run gparted
|
You have the right tools in place to do what you want. The two steps you need to take are to move the extended disk to the end of the unallocated space, then you can grow /dev/sda1. Until you move the swap space out of the way, then you cannot make sda1 bigger.
From the screen that you have up:
Select the extended partition /dev/sda2. It includes /dev/sda5, your swap space.
Menu Partition -> Move then move it to the end of the allocated space.
Then select the Primary partition: /dev/sda1.
Menu Partition -> Resize then grow it to the end of the (newly positioned) unallocated space.
Then Apply to make the changes take effect
#include <std/disclaimers.h>
Make backups first, your mileage may vary, RTFM, may destroy your system.
| Increase virtual HDD space on VMWare for Ubuntu |
1,470,336,089,000 |
Hey I'm trying to resize my boot partition and eventually my LVM partition.
I currently have:
/dev/sda1 ext2 243M
/dev/sda2 extended 7.76G
unallocated 17G
Ideally I'd like:
/dev/sda1 ext2 7.2G
/dev/sda2 extended 17.76G
My main problem is my / that is too small and I can't install anything anymore.
I tried to resize /dev/sda1 but the max size is the current one. As I understand it, I need to move the unallocated space next to /dev/sda1 but Gparted doesn't let me. Any ideas?
|
Keep only /boot in the first partition
First, 243MB is enough for /boot. If it's the root partition that you have on /dev/sda1, then there isn't enough room even for a basic installation. If you've separated /usr, don't: this was useful in the days of read-only or shared /usr but isn't nowadays.
To move the root partition:
Move all the files to the existing partition on the logical volume.
Move /boot back to /dev/sda1.
Update your bootloader configuration. For example, if your bootloader is Grub, run update-grub. Also update your initrd or initramfs if you have one. The details depend on your distribution.
How to enlarge the first partition
Given that you have plenty of free space, the easiest solution is to make use of it and move your existing data there.
Create a new logical partition sda6 in the free space with GParted.
Create a physical volume in the new partition and add it to the existing volume group. I'll call the volume group mygroup.
pvcreate /dev/sda6
vgextend mygroup /dev/sda6
Move the existing logical volume(s) to the new physical volume.
pvmove /dev/sda5
Decommission the now-unused physical volume.
vgreduce mygroup /dev/sda5
pvremove /dev/sda5
In GParted, resize and move /dev/sda5 to make room for a larger /dev/sda1, and enlarge /dev/sda1.
Create a physical volume on /dev/sda5 and add it to the volume group.
pvcreate /dev/sda5
vgextend mygroup /dev/sda5
Use the free space on the volume group as you see fit.
Extend the filesystem on /dev/sda1.
resize2fs /dev/sda1
| Resize partitions with gparted |
1,470,336,089,000 |
This is how my hard drive (where I have Xubuntu 12.10) is formatted currently, based on a recent GParted screenshot:
I want to expand sda6 (4) to take up the free 11.72 GiB unallocated space. But I can't do it. This is what I did and gathered so far:
I can't add another primary partition as I have 4 already. I didn't know that prior to starting up GParted and right-clicking the unallocated 11.72 GiB space. :/
/dev/sda5 is swap.
/dev/sda2 and /dev/sda3 are Windows partitions and need to remain as they are.
I am a bit clueless on how to enhance /sda6 now, I have definitely not enough basic knowledge on how to proceed. :( I don't even know if I have to keep the swap partition but that thought is moot anyway as I can't create another primary partition. Help! I'd appreciate it a lot. :)
I'd even be willing a tutorial which could help me get forward via the terminal.
|
Your question doesn't explicitly say what you want to do, but I guess you want to use that spare 11GB of space to expand /dev/sda6. You won't be able to do this while you are running Linux from the sda6 partition - the usual solution is to use a LiveCD, perhaps SystemRescueCD, to run GParted.
The best way to do this is:
Resize/Move your extended partition, sda4, so that it includes that 11GB of space
Move sda5 so that it comes before the free space in the extended partition (i.e. by changing the "free space preceding" value in the Move window to 0)
Resize sda6 so that it uses up all the free space.
Alternatively:
Resize/Move your extended partition, sda4, so that it includes that 11GB of space
Create a new logical partition, sda7, using that 11GB of space, and mount that as the folder where you need most space (likely as /home).
| How to repartition disk to use non-allocated space? |
1,470,336,089,000 |
fdisk -l:
Disk /dev/sda: 931,5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes`
parted -l:
Model: ATA WDC WD10EZEX-21W (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: loop
Disk Flags:
Number Start End Size File system Flags
1 0,00B 1000GB 1000GB ext4
goal: that drive should have 1 encrypted partition with all my data, but not operating system, and (not necessarily) 1 unencrypted partition
This drive has 200 GB of data on it. (only data, no system files - OS is on 250 GB SSD). I don't have any other storage where I can store the files while operating with that drive (my ssd has ~50 gb of free space).
I can resize that primary partition, but I can't create new partition in free space: gparted says only 1 primary partition can exist on this drive. help?
OS: Ubuntu 16.04
|
As identified by richard, the filesystem starts on the very first sector of the disk: you have no partitions. To create an encrypted partition, you will need to create a partition table first. And you do need to have two partitions if you want to have an encrypted partition, because you need some non-encrypted space for the bootloader.
You can create a partition table without losing your data. It's a delicate task, so double-check that your backups are up-to-date, but it can be done.
The ext4 filesystem leaves the first 512 bytes unused, and an MBR partition table fits within the first 512 bytes of the disk, so you have room for an MBR partition table. (Note that it has to be MBR, not GPT.)
First, boot some rescue media. Do not attempt to do any of this while the filesystem is mounted. SystemRescueCd is good for this kind of things.
If more than half the disk space is free, then you can create a partition in the second half of the disk as follows:
Determine the path to the disk device. Note that a rescue system might name the disks differently from your normal system. Here I'll assume that the path is /dev/sda.
resize2fs /dev/sda to shrink the filesystem about as much as it'll go. You can see how much space is free with tune2fs -l /dev/sda.
Run fdisk /dev/sda. Fdisk will create a “dos disklabel”, i.e. an MBR partition table, in memory. Enter n and create a new primary partition that starts after the end of the filesystem. Enter w to write the new partition table and exit fdisk.
Copy the filesystem to the new partition with head -c SIZE /dev/sda1 where SIZE is the size of the filesystem after shrinking.
Verify that the data new partition is safe.
You can now create partitions to span the first half of the disk, where the old copy of the filesystem is located.
If more than half the disk is in use then you're in for quite some pain. I think you can do it by first converting the data to an LVM volume with blocks, then shrinking the filesystem, the logical volume and the physical volume, and using gparted to move the start of the physical volume. But I've never done anything like this, so triple-check your backups.
| Create encrypted partition on existing drive with one primary partition while keeping data |
1,470,336,089,000 |
I recently made a small mistake as I was installing Arch and ended up with my partitions looking like this:
Basically, my Arch partition sda9 is stuck between my Windows partition and some sort of Windows recovery/diagnostic partitions. This has left me with only 80 MiB of space, and you can imagine the problems that's causing.
Is there an easy way to move my Arch partition to the unallocated space after sda8 (xubuntu)? I already tried using dd, but had no luck.
|
Create a new empty partition after /dev/sda8, make it the size that you want your Arch partition to be. Then do cat /dev/sda9 > /dev(the partition you just created) when in a root shell. (You can't just use sudo as it will make you root to run cat, but not to access the new partition.) You just duplicated your Arch partition, but now you need to expand the filesystem to the full size of the partition. You can either let gparted take care of this for you (I believe it will do it for you if you check the new filesystem), or just run sudo resize2fs /dev/(the new partition), and then check it to be on the safe side with sudo fsck /dev/(the new partition). You can now delete the original Arch partition. Just make sure to update your grub parameters if you didn't address the filesystem by UUID!
| Rearranging order of partitions in GParted |
1,470,336,089,000 |
I'm not sure how to merge that unallocated 5GB space with the ext4 partition (sda5). Is there is a way (without formatting the ext4 filesystem)?
|
With GParted, you can move the beginning of the extended partition. Just use the “Resize/Move” button on the extended partition and set “Free space preceding” to 0.
Then use the “Resize/Move” button to move the ext4 partition to the beginning of the extended partition and enlarge it.
You can't (or at least shouldn't, I'm not sure if GParted would outright prevent you) do that if the partition is in use. Boot from a live CD/USB such as GParted Live.
In the future, for more flexibility with partitions, use LVM. It's easier to resize partitions, they don't have to occupy consecutive disk space, manipulations are less error-prone and you can often do it from the live system. You can convert your existing system to LVM, but that's difficult; it's a lot easier to do it at the time you install. (If your distribution doesn't support installing to LVM, throw it away.)
| Merge partitions between logical and extended partition |
1,470,336,089,000 |
When shrinking a partition with GNU Parted, some contents must be moved from the area of the physical disk that will be left out of the new shrunken partition. The contents of those files are of course unchanged.
But could it be that some files in the shrunken partition must be altered by the program?. I mean those files that contain information about the partition or the physical disk. Perhaps within the /etc folder, or perhaps /dev? I don't know, and that is my question:
Which are exactly those files (if any) that change after shrinking a partition?
|
The partition table is changed, this stores the start and end block number of the partitions. This table is not in the partition, and therefore not in the file-system.
Various block addresses are changed within the file-system (this is part of the file-system meta-data). This is part of the mapping from directory entries to physical locations. None of this is stored in a file.
So the short answer is, no files are changed.
You could zip (using an archiver that preserves all file attributes and permissions etc) the file-system, then recreate a smaller one, and unzip it back. This is how you do it if you don't have file-system grow/shrink tools for your file-system.
| Which files are changed when GNU Parted shrinks a partition? |
1,470,336,089,000 |
I have several VMs set up within Hyper-V using Ubuntu 17.10 and have found that they are not configured correctly - that is, they have been set up using the default block size for the VHDX files and are using much more space than they require and have a higher maximum VHDHX size than I would like. In one example, I have a drive which is ~50GB but only contains 15GB of data.
I am looking to create new VHDHX files using more sensible settings and clone everything that is on the drives on to the newly created drives, but I'm running into some problems. The existing drives are showing up as having 2 partitions as shown here, and then there are 2 logical volumes on the larger partition - one for data and one for swap.
The drive I am looking to clone this to will be a 30GB VHDHX file, and I need some advice on the best way to go about doing this. I initially tried using dd and encountered errors due to the source being larger than the destination. I then tried using gparted to resize the larger drive, but could not due to gparted seeing the LVM partition as having no free space. I also tried reducing the size of the LVM partition and then using gparted, but also ran into errors with this. I've been able to successfully reduce the size of the LVM partition and then use dd to clone the LVM volume to another LVM volume I have created on the new drive, though I am concerned that when I use lvreduce to resize the original partition I may be cutting off data if the data is not contiguous and is spread across the drive.
I am quite new to this, so do not know what I may be overlooking and may need to account for in doing it, but essentially I'm looking for some guidance on the required steps to ensure that the new drive contains everything that is on the old one and I can boot from it. If for example, I use lvreduce to resize the large volume to the size I need, how do I verify that I have not lost anything in doing this? Would this even be the correct approach?
So far my plan is:
Create a new Ubuntu VM to use to perform this process.
Attach the original drive + a new drive to be used for copying the data.
Shrink the logical volume on the original drive.
Create the same partitions & volumes on the new drive.
Use dd to copy the logical volumes to the equivalent logical volumes on the new drive.
Is there a better way to do this, or anything I have missed?/pitfalls to be aware of?
|
If anyone comes across this and has the same problem, the solution which worked for me is mostly as was described above. In the example given below, my original drive has 2 partitions, a boot partition and a data partition with 2 logical volumes, and the destination drive starts out with a boot partition and a data partition with no logical volumes.
Set up a VM with both disks attached and boot it using a Linux Live CD.
Run a file system check on the source disk with sudo e2fsck -f /dev/mapper/ubuntu--1704--base--vg-root - the volume name can be found from the output of sudo fdisk -l
Shrink the file system to the minimum size before we resize the logical volume. This can be done using sudo resize2fs -M /dev/mapper/ubuntu--1704--base--vg-root
Resize the logical volume to the desired size, in this case 28.5 GiB: sudo lvreduce --resizefs -L 28.5G /dev/mapper/ubuntu--1704--base--vg-root
Rename the volume group on the existing drive, as we will be using the same name on the new drive: sudo vgrename ubuntu-1704-base-vg ubuntu-1704-base-vg-2
Create a new physical volume: sudo pvcreate /dev/sda2
Create a new volume group, using the name taken from the original volume group on the source drive: sudo vgcreate ubuntu-1704-base-vg /dev/sda2
Create the logical volumes on the new drive to match the ones on the old drive. In my case I had one used for swap and one for data. I took the size of the logical extents allocated to each from the 'Current LE' property reported by sudo lvdisplay and then used them as the input for the lvcreate command, e.g.:
sudo lvcreate --extents 7296 --stripes 1 --name root ubuntu-1704-base-vg
sudo lvcreate --extents 255 --stripes 1 --name swap_1 ubuntu-1704-base-vg
Copy the data from the old drive to the new drive. I did this by copying the boot partition from the source drive over the boot partition on the new drive, then copied the logical volume for the data drive on to the new logical volume on the destination drive. e.g.:
sudo dd if=/dev/sdb1 of=/dev/sda1 bs=64M status=progress
sudo dd if=/dev/mapper/ubuntu--1704--base--vg--2-root of=/dev/mapper/ubuntu--1704--base--vg-root bs=64M status=progress
Finally, run a file system check to verify that the drives are ok. There may be errors which need to be repaired, though after doing this I was able to boot successfully from the copied drive and the contents were as expected.
sudo e2fsck -f /dev/mapper/ubuntu--1704--base--vg-root
References used:
https://blog.shadypixel.com/how-to-shrink-an-lvm-volume-safely/
https://docs.microsoft.com/en-us/azure/virtual-machines/linux/configure-lvm
| How do I clone a VM drive using LVM to a smaller drive? |
1,470,336,089,000 |
I intend to resize and add a new partition to my main drive, and for that purpose I have created a GParted-USB to resize my partition. However, this has proven to be more difficult than I thought, seeing as GParted claims that my internal drive is full.
Any idea as to what's causing this, and eventually how to fix it? (Ignore the key, I shot this from Fedora.)
|
Your drive is a LVM physical volume. Your free space is being managed by lvm. Look at vgdisplay to find free space in your volume group and lvcreate to create a new partition from that space. To grow a partition you will first lvextend the logical volume then (if ext2/3/4) resize2fs to size the filesystem to the new volume size.
| Gparted claims my internal drive is full |
1,470,336,089,000 |
I have a system with Pop!_OS and Windows 10 dual booted When I was on Pop!_OS I wanted to shrink the C: drive (currently it is 400 GB) to make it about 250 GB and give the remaining to Linux. When I was doing it with gparted it showed me a error and this was the report
GParted 1.0.0
configuration --enable-libparted-dmraid --enable-online-resize
libparted 3.3
========================================
Device: /dev/sda
Model: ATA WDC WD5000AAKX-0
Serial: WD-WCC2EZV34735
Sector size: 512
Total sectors: 976773168
Heads: 255
Sectors/track: 2
Cylinders: 1915241
Partition table: msdos
Partition Type Start End Flags Partition Name File System Label Mount Point
/dev/sda1 Primary 1126400 745105966 boot ntfs Drive 1
/dev/sda2 Primary 745105968 746074671 msftres ntfs
/dev/sda3 Primary 746076160 950876158 ext4 /media/mint/c1220c43-fae6-47b5-9b82-fdfc64018a17
/dev/sda4 Primary 950876160 976773118 linux-swap
========================================
Device: /dev/sdb
Model: SanDisk Ultra
Serial: none
Sector size: 512
Total sectors: 30629376
Heads: 255
Sectors/track: 2
Cylinders: 60057
Partition table: none
Partition Type Start End Flags Partition Name File System Label Mount Point
/dev/sdb Unpartitioned 0 30629375 iso9660 Linux Mint 20.1 Cinnamon 64-bit
========================================
Shrink /dev/sda1 from 354.76 GiB to 220.99 GiB 00:00:26 ( ERROR )
calibrate /dev/sda1 00:00:01 ( SUCCESS )
path: /dev/sda1 (partition)
start: 1126400
end: 745105966
size: 743979567 (354.76 GiB)
check file system on /dev/sda1 for errors and (if possible) fix them 00:00:25 ( ERROR )
ntfsresize -i -f -v '/dev/sda1' 00:00:25 ( ERROR )
ntfsresize v2017.3.23AR.3 (libntfs-3g)
Device name : /dev/sda1
NTFS volume version: 3.1
Cluster size : 4096 bytes
Current volume size: 380917535232 bytes (380918 MB)
Current device size: 380917538304 bytes (380918 MB)
Checking for bad sectors ...
Checking filesystem consistency ...
Cluster 1565940 is referenced multiple times!
Cluster 1565941 is referenced multiple times!
Cluster 1565942 is referenced multiple times!
Cluster 1565943 is referenced multiple times!
Cluster 1565944 is referenced multiple times!
Cluster 1565945 is referenced multiple times!
Cluster 1565946 is referenced multiple times!
Cluster 1565947 is referenced multiple times!
Cluster 1565948 is referenced multiple times!
Cluster 1565949 is referenced multiple times!
Cluster 1565950 is referenced multiple times!
Cluster 1565951 is referenced multiple times!
Cluster 1565952 is referenced multiple times!
Cluster 1565953 is referenced multiple times!
Cluster 1565954 is referenced multiple times!
Cluster 1565955 is referenced multiple times!
Cluster 14279735 is referenced multiple times!
Cluster 14279736 is referenced multiple times!
Cluster 14279737 is referenced multiple times!
Cluster 14279738 is referenced multiple times!
Cluster 14279739 is referenced multiple times!
Cluster 14279740 is referenced multiple times!
Cluster 14279741 is referenced multiple times!
Cluster 14279742 is referenced multiple times!
Cluster 14279743 is referenced multiple times!
Cluster 14279744 is referenced multiple times!
Cluster 14279745 is referenced multiple times!
Cluster 14279746 is referenced multiple times!
Cluster 14279747 is referenced multiple times!
Cluster 14279748 is referenced multiple times!
Cluster 14279749 is referenced multiple times!
Cluster 14279750 is referenced multiple times!
Cluster 14279751 is referenced multiple times!
Cluster 14279752 is referenced multiple times!
Cluster 14279753 is referenced multiple times!
Cluster 14279754 is referenced multiple times!
Cluster 14279755 is referenced multiple times!
Cluster 14279756 is referenced multiple times!
Cluster 14279757 is referenced multiple times!
Cluster 14279758 is referenced multiple times!
Cluster 14279759 is referenced multiple times!
Cluster 14279760 is referenced multiple times!
Cluster 14279761 is referenced multiple times!
Cluster 14279762 is referenced multiple times!
Cluster 14279763 is referenced multiple times!
Cluster 14279764 is referenced multiple times!
Cluster 14279765 is referenced multiple times!
Cluster 14279766 is referenced multiple times!
Cluster 14279767 is referenced multiple times!
Cluster 14279768 is referenced multiple times!
Cluster 14279769 is referenced multiple times!
Cluster 14279770 is referenced multiple times!
Cluster 14279771 is referenced multiple times!
Cluster 14279772 is referenced multiple times!
Cluster 14279773 is referenced multiple times!
Cluster 14279774 is referenced multiple times!
Cluster 14279775 is referenced multiple times!
Cluster 14279776 is referenced multiple times!
Cluster 14279777 is referenced multiple times!
Cluster 14279778 is referenced multiple times!
Cluster 14279779 is referenced multiple times!
Cluster 14279780 is referenced multiple times!
Cluster 14279781 is referenced multiple times!
Cluster 14279782 is referenced multiple times!
Cluster 14279783 is referenced multiple times!
Cluster 14279784 is referenced multiple times!
Cluster 14279785 is referenced multiple times!
Cluster 14279786 is referenced multiple times!
Cluster 14279787 is referenced multiple times!
Cluster 14279788 is referenced multiple times!
Cluster 14279789 is referenced multiple times!
Cluster 14279790 is referenced multiple times!
Cluster 14279791 is referenced multiple times!
Cluster 14279792 is referenced multiple times!
Cluster 14279793 is referenced multiple times!
Cluster 14279794 is referenced multiple times!
Cluster 14279795 is referenced multiple times!
Cluster 14279796 is referenced multiple times!
Cluster 14279797 is referenced multiple times!
Cluster 14279798 is referenced multiple times!
Cluster 14279799 is referenced multiple times!
Cluster 14279800 is referenced multiple times!
Cluster 14279801 is referenced multiple times!
Cluster 14279802 is referenced multiple times!
Cluster 14279803 is referenced multiple times!
Cluster 14279804 is referenced multiple times!
Cluster 14279805 is referenced multiple times!
Cluster 14279806 is referenced multiple times!
Cluster 14279807 is referenced multiple times!
Cluster 14279808 is referenced multiple times!
Cluster 14279809 is referenced multiple times!
Cluster 14279810 is referenced multiple times!
Cluster 14279811 is referenced multiple times!
Cluster 14279812 is referenced multiple times!
Cluster 14279813 is referenced multiple times!
Cluster 14279814 is referenced multiple times!
Cluster 14279815 is referenced multiple times!
Cluster 14279816 is referenced multiple times!
Cluster 14279817 is referenced multiple times!
Cluster 14279818 is referenced multiple times!
Cluster 14279819 is referenced multiple times!
Cluster 14279820 is referenced multiple times!
Cluster 14279821 is referenced multiple times!
Cluster 14279822 is referenced multiple times!
Cluster 14279823 is referenced multiple times!
Cluster 14279824 is referenced multiple times!
Cluster 14279825 is referenced multiple times!
Cluster 14279826 is referenced multiple times!
Cluster 14279827 is referenced multiple times!
Cluster 14279828 is referenced multiple times!
Cluster 14279829 is referenced multiple times!
Cluster 14279830 is referenced multiple times!
Cluster 14279831 is referenced multiple times!
Cluster 14279832 is referenced multiple times!
Cluster 14279833 is referenced multiple times!
Cluster 14279834 is referenced multiple times!
Cluster 14279835 is referenced multiple times!
Cluster 14279836 is referenced multiple times!
Cluster 14279837 is referenced multiple times!
Cluster 14279838 is referenced multiple times!
Cluster 14279839 is referenced multiple times!
Cluster 14279840 is referenced multiple times!
Cluster 14279841 is referenced multiple times!
Cluster 14279842 is referenced multiple times!
Cluster 14279843 is referenced multiple times!
Cluster 14279844 is referenced multiple times!
Cluster 14279845 is referenced multiple times!
Cluster 14279846 is referenced multiple times!
Cluster 14279847 is referenced multiple times!
Cluster 14279848 is referenced multiple times!
Cluster 14279849 is referenced multiple times!
Cluster 14279850 is referenced multiple times!
Cluster 14279851 is referenced multiple times!
Cluster 14279852 is referenced multiple times!
Cluster 14279853 is referenced multiple times!
Cluster 14279854 is referenced multiple times!
Cluster 14279855 is referenced multiple times!
Cluster 14279856 is referenced multiple times!
Cluster 14279857 is referenced multiple times!
Cluster 14279858 is referenced multiple times!
Cluster 14279859 is referenced multiple times!
Cluster 14279860 is referenced multiple times!
Cluster 14279861 is referenced multiple times!
Cluster 14279862 is referenced multiple times!
Cluster 14586335 is referenced multiple times!
Cluster 14586336 is referenced multiple times!
Cluster 14586337 is referenced multiple times!
Cluster 14586338 is referenced multiple times!
Cluster 14586339 is referenced multiple times!
Cluster 14586340 is referenced multiple times!
Cluster 14586341 is referenced multiple times!
Cluster 14586342 is referenced multiple times!
Cluster 14586343 is referenced multiple times!
Cluster 14586344 is referenced multiple times!
Cluster 14586345 is referenced multiple times!
Cluster 14586346 is referenced multiple times!
Cluster 14586347 is referenced multiple times!
Cluster 14586348 is referenced multiple times!
Cluster 14586349 is referenced multiple times!
Cluster 14586350 is referenced multiple times!
Cluster 14586351 is referenced multiple times!
Cluster 14586352 is referenced multiple times!
Cluster 14586353 is referenced multiple times!
Cluster 14586354 is referenced multiple times!
Cluster 14586355 is referenced multiple times!
Cluster 14586356 is referenced multiple times!
Cluster 14586357 is referenced multiple times!
Cluster 14586358 is referenced multiple times!
Cluster 14586359 is referenced multiple times!
Cluster 14586360 is referenced multiple times!
Cluster 14586361 is referenced multiple times!
Cluster 14586362 is referenced multiple times!
Cluster 14586363 is referenced multiple times!
Cluster 14586364 is referenced multiple times!
Cluster 14586365 is referenced multiple times!
Cluster 14586366 is referenced multiple times!
Cluster 14586367 is referenced multiple times!
Cluster 14586368 is referenced multiple times!
Cluster 14586369 is referenced multiple times!
Cluster 14586370 is referenced multiple times!
Cluster 14586371 is referenced multiple times!
Cluster 14586372 is referenced multiple times!
Cluster 14586373 is referenced multiple times!
Cluster 14586374 is referenced multiple times!
Cluster 14586375 is referenced multiple times!
Cluster 14586376 is referenced multiple times!
Cluster 14586377 is referenced multiple times!
Cluster 14586378 is referenced multiple times!
Cluster 14586379 is referenced multiple times!
Cluster 14586380 is referenced multiple times!
Cluster 14586381 is referenced multiple times!
Cluster 14586382 is referenced multiple times!
Cluster 14586383 is referenced multiple times!
Cluster 14586384 is referenced multiple times!
Cluster 14586385 is referenced multiple times!
Cluster 14586386 is referenced multiple times!
Cluster 14586387 is referenced multiple times!
Cluster 14586388 is referenced multiple times!
Cluster 14586389 is referenced multiple times!
Cluster 14586390 is referenced multiple times!
Cluster 14586391 is referenced multiple times!
Cluster 14586392 is referenced multiple times!
Cluster 14586393 is referenced multiple times!
Cluster 14586394 is referenced multiple times!
Cluster 14586395 is referenced multiple times!
Cluster 14586396 is referenced multiple times!
Cluster 14586397 is referenced multiple times!
Cluster 14586398 is referenced multiple times!
Cluster 14586460 is referenced multiple times!
Cluster 14586461 is referenced multiple times!
Cluster 14586462 is referenced multiple times!
Cluster 14586432 is referenced multiple times!
Cluster 14586433 is referenced multiple times!
Cluster 14586434 is referenced multiple times!
Cluster 14586435 is referenced multiple times!
Cluster 14586436 is referenced multiple times!
Cluster 14586427 is referenced multiple times!
Cluster 14586457 is referenced multiple times!
Cluster 14586458 is referenced multiple times!
Cluster 14586459 is referenced multiple times!
100.00 percent completed
ERROR: Filesystem check failed!
ERROR: 220 clusters are referenced multiple times.
NTFS is inconsistent. Run chkdsk /f on Windows then reboot it TWICE!
The usage of the /f parameter is very IMPORTANT! No modification was
and will be made to NTFS by this software until it gets repaired.
Can someone tell me why it happened and how to fix it?
And do I need to run the command it says in the bottom third line?
Please help.
Thanks.
|
The end of the disk check reports that,
NTFS is inconsistent. Run chkdsk /f on Windows then reboot it TWICE!
The usage of the /f parameter is very IMPORTANT! No modification was
and will be made to NTFS by this software until it gets repaired.
Until you do this you won't be able to resize the partition.
| Error while resizing C: drive with Gparted |
1,470,336,089,000 |
Recently I've found out that soon I will run out of space on my / (root) partition. I've done some research on extending root partition, however, it wasn't too informative (mostly everyone say it's impossible or at least too hard). However I don't want to give up.
Here is my partition configuration in the photo. After root /dev/sda6 partition I have some free space (I don't know why it is here and where it came from). Then goes /home on /dev/sda7 and then more free space (9.77 GiB). What I'd like to do is to add these 9.77 GiB to my root partition. I've already read that I need to move my free space to the left and place it right after root partition (or to do something like this), but I don't know how.
Also another solution, as I see it, can be shrinking /home partition. I've already tried it with /dev/sda7 (that's where those 9.77 GiB are from), but free space appears on the right from /home, not on the left as I need.
This photo was made from my system, but if needed I can boot from Ubuntu LiveUSB.
|
The simplest way to do this is:
manually copy the ~7GB of files from the /home filesystem to an external media device
delete the /dev/sda7 partition
increase the size of the /dev/sda6 partition
grow the ext4 filesystem on /dev/sda6
create a new /dev/sda7 partition in the remaining space
format the new /dev/sda7 partition with an ext4 filesystem
copy the original files from the external media device to the new /dev/sda7 filesystem
make sure /etc/fstab points to the correct block device for /home
This requires a fair amount of checking things, documenting the current state, etc.
I am not a regular Ubuntu user, so I don't know how the block devices are referenced to the mount points. Some systems use simple device mapping (/dev/sda7 /home), some use dev-mapper, some use block-id UUID identifiers.
The specific command syntax to complete each point will vary GREATLY depending on what toolset and operating system you are using. It's too much for a single post here, without a lot more information.
You should also be aware that any time you change the partition table on a physical disk, you risk damaging data anywhere on the entire disk if you are not careful to use the correct commands and parameters.
Using a LiveOS to make the changes to the physical disk is a Good Idea(TM), and I suggest you consider the free System-Rescue-CD, which is built with the intent of providing tools to work on problems just like this.
| How to extend root partition by shrinking home |
1,470,336,089,000 |
it is possible to move some partition(entire) before another?
I need to resize my root partition, but the free space is too far away.(I want to move the free space near the root part.)
Can this be done somehow, or have I to backup the data and start from begining?
|
I don't think most of the partition management programs for Linux will move a partition unless there is no overlap, and you can't do that because the ~90.8G extended partition (sda2) will not fit inside the ~11.7G free space. (You can't just move swap, sda5, because of how extended partitions work).
Please read and understand the whole thing before starting. And also, make a backup. Just in case.
What you could do though, is create a a new primary partition, sda3, for the free space. Then use that as a physical volume for LVM. Use LVM to create a volume group with it, then create a logical volume on that. Copy your root filesystem over. This is probably best done from a Live CD/USB.
Then you need to get the system to boot off your logical volume. Hopefully that is as simple as changing /etc/fstab (on the copy on the LV), chrooting to that copy, rebuilding the initramfs, and then finally running update-grub. That'll hopefully give you a grub menu with two choices of what to boot—both the install on /dev/sda1 and on your logical volume.
Reboot to the logical volume. Be very sure you've booted from that, not sda1 (and that the copy worked!). Now you can turn sda1 in to a physical volume, and add it to the same volume group.
You've now got LVM combining sda1 and your new sda3 into one "partition." It doesn't matter that they're not contiguous on disk; you can lvextend your logical volume (with the system running, even) to add more space to your rootfs.
The above requires a fair bit of Linux experience—you may find backing up and reinstalling easier. If you do, I recommend you use LVM when you re-install. It makes growing/shrinking partitions trivial, and growing can almost always be done with the system up.
| moving free space before other partition (to resize the root part.) [duplicate] |
1,470,336,089,000 |
so I have triple booted windows, kali, and ubuntu. I am trying to resize ubuntu /home directory which sits on the HDD. So I created a new unallocated space in windows of 200gb size, and I want to add it to ubuntu
however the problem is I do not see it in gparted as free space or as anything. I simply do not see it. As you can see in the picture, /dev/sdb5 is the one I want to grow, but I cannot see 200gb free space
How can I solve this problem
|
It appears that Disk 1 is Dynamic which is Proprietary to Microsoft. In order to properly share the disk with other non-MS operating systems the disk must be converted to Basic as can be seen with Disk 0.
| why can I not see the unallocated space in gparted |
1,470,336,089,000 |
I have some old hardware where Linux can't boot if the bootlader is over 128 GB. The problem is that I don't know exactly how those 128 GB are considered.
So the first question is, are they considered like 131,072 MB or 128,000 MB ?
Then, do I use aligned by MiB or by cylinders in Gparted ?
|
This is an address limit i.e. a number of bits. Thus this refers to real gigabytes (GiB) i.e. 2^37 bytes == 128 GiB == 131,072 MiB == 137438 MB.
| Boot loader below 128 GB |
1,470,336,089,000 |
I have a physical Redhat RHEL 6.10 machine on physical hardware, which I tried to virtualize for vmware. We did backup with dd to virtualize. Problem is right now, that this VM is still taking full 146GB-SAS-Disk of dataspace (original), but real data takes only 27GB of diskspace.
I resized the logical volume of partition /dev/mapper/vg_sb00681-lv_root and /dev/mapper/vg_sb00681-lv_home with command resize2fs and lvreduce (like described here: https://www.linuxtechi.com/reduce-size-lvm-partition/) of root-Parition to 20GB and home-Partition to 5GB. As you can see, partitions are shrinked. Still no problem.
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_sb00681-lv_root 20G 9.8G 8.9G 53% /
tmpfs 931M 0 931M 0% /dev/shm
/dev/sda1 477M 105M 347M 24% /boot
/dev/mapper/vg_sb00681-lv_home 4.8G 1.5G 3.2G 32% home
Now, with GParted I'm not able to free the free space on LVM partition.
If I tried to shrink/move partition, it ends in GParted with error.
Error Message:
shrink file system
lvm pvresize -v --yes --setphysicalvolumesize 34433024K '/dev/sda2'
0 physical volume(s) resized or updated / 1 physical volume(s) not resized
Archiving volume group "vg_sb00681" metadata (seqno 32).
WARNING: /dev/sda2: Pretending size is 68866048 not 285650944 sectors.
Resizing volume "/dev/sda2" to 68866048 sectors.
Resizing physical volume /dev/sda2 from 34869 to 8406 extents.
/dev/sda2: cannot resize to 8406 extents as later ones are allocated.
So I tried with pvmove to move physical extents to the end of physical volume. It gaves me free disk space between the physical volumes and I'm not able to pack free space together to the end.
I've no idea what the next steps are and if it is possible to reduce partition on VM to save disk space.
ubuntu@ubuntu:-$ sudo pvs -v --segments /dev/sda2
PV VG Fmt Attr PSize PFree Start SSize LV Stat Type PE Ranges
/dev/sda2 vg_sb00681 lvm2 a-- <136.21g 103.37g 0 2006 lv_swap 0 linear /dev/sda2:0-2005
/dev/sda2 vg_sb00681 lvm2 a-- <136.21g 103.37g 2006 16812 0 free
/dev/sda2 vg_sb00681 lvm2 a-- <136.21g 103.37g 18818 5120 lv_root 0 linear /dev/sda2:18818-23937
/dev/sda2 vg_sb00681 lvm2 a-- <136.21g 103.37g 23938 1280 lv_home 0 linear /dev/sda2:23938-25217
/dev/sda2 vg_sb00681 lvm2 a-- <136.21g 103.37g 25218 9651 0 free
Does somebody has any idea or a hint for me?
|
You'll need pvmove to move the extents around. Since the source and destination are on the same disk, you'll need the --alloc anywhere option:
pvmove --alloc anywhere /dev/sda2:18818-23937 /dev/sda2:2006-7125 # lv_root
pvmove --alloc anywhere /dev/sda2:23938-25217 /dev/sda2:7126-8405 # lv_home
You can do this while the LVs are mounted and in use, just try to avoid doing that while the system is under a heavy disk I/O load.
After these commands, the first free physical extent should be number 8406, and everything from that to the end of the PV should be free, so the PV can now be shrunk.
| shrink partition after LVM resize on RedHat Linux |
1,512,587,122,000 |
I'm working on a 64-bit CentOS 7 VM on my Windows 10 host, and I have a dynamically-allocated VHD that is giving me problems.
At first, the VHD's maximum size was set to 16GB, functionally about 14.4 usable. While working on a project I realized that I would need much more space, so I used VBoxManage to increase the maximum to 100GB. Then I used GParted to expand the sda2 partition so that it took up the extra space.
So VirtualBox recognizes that the VHD can go up to 100GB and sda2 takes up most of that space. The actual size of the VHD right now is still 14.4GB. However when I fill up all of this space on the guest OS (by writing a long seq into a file), the drive not does automatically expand.
A couple of things to note:
The first time I tried to fill up the space, when I restarted the VM after filling it up, the VHD file on my host did increase by about 1GB, however it won't expand any more now.
There seems to be a discrepancy between the devices my guest OS reports and what partitions GParted reports. CentOS lists /dev/sda1 and /dev/mapper/centos-root, which is a link to /dev/dm-0, while GParted lists /dev/sda1 and /dev/sda2. Could this be causing the issue, or is this normal? If it is normal, any ideas as to why VirtualBox won't expand the VHD?
|
Ok, I found what the problem was. My filesystem uses Logical Volume Management (LVM), which I have never worked with before, and so I didn't know how to properly handle it. Using LVM terminology, centos is a volume group:
sda2 is a physical volume in that volume group:
and root is a logical volume in that volume group, along with swap:
The centos VG and the sda2 PV had already registered the extra storage I'd allocated, but all that was left was to allocate that extra space to the root LV (21504 is the number of free physical extents (PEs) that I got from vgdisplay):
$ sudo lvextend /dev/centos/root /dev/sda2 -l+21504
and then expand the root filesystem so that it could make use of this extra space:
$ sudo xfs_growfs /dev/centos/root
After this the guest OS recognized that it had extra space, and filling up this space causing a corresponding growth in the size of the virtual hard disk on the host OS. Success!
Source:
http://www.techotopia.com/index.php/Adding_a_New_Disk_to_a_CentOS_6_Volume_Group_and_Logical_Volume
| VirtualBox - Dynamic virtual disk won't expand |
1,512,587,122,000 |
I have a Windows 10 and Ubuntu dual boot on my laptop, I'd like to turn it into a triple boot with kali linux, the fact is I already have grub as the ubuntu installer added it.
After a bit of research I found out that kali adds it too (not sure but probably something debian does that both keeped, I never used debian if not on a live usb).
How can I prevent it from doing so? Also, to make space for kali I want to shrink the Windows partition, but I don't know how to do it from windows and Gparted gives me a warning and doesn't let me resize it.
|
When your third operating system finishes it's installation, choose Ubuntu and then run following commands (in Ubuntu).
Reinstall GRUB: grub-install --root-directory=/mnt/ /dev/sda
Reboot: shutdown -r now
Restore the GRUB menu: update-grub
You will have Ubuntu grub bootloader :)
Nice tip: Your BIOS may have option to protect boot sector.
EDIT:
Regarding resizing, do not attempt to resize a partition on a device that is in use.
Please use LIVE CD and unmount your drive and then resize partition you want.
| Will installing kali linux automatically add a grub bootloader even if I already have it? |
1,512,587,122,000 |
I deleted a big extended partition containing an ntfs logical partition with high percentage of occupied space and from that extended partition I made a new, smaller extended part. In it I created an ext4 logical partition .
The newly created ext4 logical partition however comes with 1.75 GB already occupied. I have tried deleting and recreating the partition but the occupied space just keeps coming back. I did the following to search for clues but no joy.
sudo du -h -s /media/hrmount/
20K /media/hrmount/
and
sudo du -h -a /media/hrmount
16K /media/hrmount/lost+found
20K /media/hrmount/
and
sudo du -h -a /media/hrmount/lost+found/
16K /media/hrmount/lost+found/
the commands might seem redundant but I'm just blindly trying to figure this out.
I also ran :
fsck -V /dev/sdb5
fsck from util-linux 2.20.1
[/sbin/fsck.ext4 (1) -- /media/hrmount] fsck.ext4 /dev/sdb5
e2fsck 1.42 (29-Nov-2011)
/dev/sdb5: clean, 11/6553600 files, 459349/26214400 blocks
and the relevant output from df -h
/dev/sdb5 100G 1.7G 94G 2% /media/hrmount
I am quite sure that I will get rid of that occupied space by formatting the partition but what i want to know is what is causing that occupied space in also what it actually contains. Please help me find more clues to solve this puzzle. Thank you.
|
The used space reported by df is reserved space. This reserved space is used by ext filesystems to prevent data fragmentation as well as to allow critical applications such as syslog to continue functioning when the disk is "full". You can view information about the reserved space using the tune2fs command:
# tune2fs -l /dev/mapper/newvg-root
tune2fs 1.42.5 (29-Jul-2012)
Filesystem volume name: <none>
Last mounted on: /mnt/oldroot
Filesystem UUID: d41eefc5-60d6-4e18-98e8-d08d9111fbe0
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
Filesystem flags: signed_directory_hash
Default mount options: (none)
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 3932160
Block count: 15728640
Reserved block count: 786304
Free blocks: 11086596
Free inodes: 3312928
First block: 0
Block size: 4096
Fragment size: 4096
Reserved GDT blocks: 1020
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 8192
Inode blocks per group: 512
Flex block group size: 16
Filesystem created: Tue Feb 8 16:28:29 2011
Last mount time: Mon Dec 9 23:28:11 2013
Last write time: Mon Dec 9 23:48:24 2013
Mount count: 19
Maximum mount count: 20
Last checked: Tue Sep 3 23:00:06 2013
Check interval: 15552000 (6 months)
Next check after: Sun Mar 2 22:00:06 2014
Lifetime writes: 375 GB
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 256
Required extra isize: 28
Desired extra isize: 28
Journal inode: 8
Default directory hash: half_md4
Directory Hash Seed: 80cf2748-584a-4fe8-ab8c-6abff528c2c2
Journal backup: inode blocks
Here you can see that 786304 blocks are reserved and the block size is 4096. This means that 3220701184 bytes or 3GB is reserved. You can adjust the percentage of reserved blocks using the tune2fs commands (but is not recommended):
tune2fs -m 1 /dev/sdb5
| What is this data that keeps reappearing after partition delete + new partition creation? |
1,512,587,122,000 |
I made a partitions on a new SSD drive (empty), now I want to install Debian, use netinst ISO CD. I chosed "Graphical expert install" type, which show a series of questions. When installation process come to a Partition disks step, there is a lot of options, and what's unclear:
"Bootable flag : off/on" - should I set it "On" for Boot partition? Should I skip it for the other partitions, or should set it Off for the rest partitions?
"Format the partition: no keep existing data" - should I format partitions, even they are empty?
Reserved blocks: 5% - should I use this option? (SSD disk 60GB but really show 55.80GB available, so I assume that ~7% space already reserved?)
Should I set/change any flag for Swap partition? Currently it marked "F".
What steps should I make starting with "Partition disks" page? Overall, the Debian installer is unclear at this point and does not make installation easier.
|
This is a critical moment of the installation, the guide doesn't want to interfere too much because:
you have chosen expert
you could erase data involuntarily
Exposing all possible options to a GUI installer is difficult (GUI is always limiting choices).
Finally some recommendations:
Bootable flag for boot partion: on
Other partitions, bootable flag: off/ skip(=off)
Format the partitions: yes, formatting also creates a suitable file system (e.g. ext4). Choose no only if you are sure that the current format will work.
Swap: leave the default -- it doesn't matter much imo.
| Debian "Graphical expert install" mode |
1,512,587,122,000 |
I want to install Ubuntu 14.04 in my laptop on which windows 8.1 is installed. I have read in some sites that I have to use Gparted or similar tools, but there are also sites that don´t this kind of tools, just shrink the volume of C:.
What is the difference between using Gparted or similar and not using it, to install Ubuntu for dual boot.
|
I suggest you read this guide on Ask Ubuntu. As for the difference, gparted and similar tools help you partition your hard drive. The Ubuntu installer can also do this automatically which is, presumably, the way suggested by the sites you read.
I would not do that though and especially not with a system that has windowd8 installed since there are other complications. You would be much safer creating the partition yourself and then telling the Ubuntu installer to install to it.
| Install Ubuntu partitions |
1,512,587,122,000 |
I am running Ubuntu 12.04 in a VM. I have recently resized the hard drive of this VM doubling its size with Gparted. However, when I run df -h, Ubuntu still sees the old hard drive space, while Gparted sees the new one.
How can I force a refresh of this so that the OS can see the correct amount of space available?
|
The command that resized the filesystem was sudo lvextend -r -l +100%FREE /dev/sda<number>. Have a look at this other question for more details.
| Wrong amount of free disk space seen after using Gparted |
1,512,587,122,000 |
I just decided to delete my Windows partition and only use Linux.
My old partition table was:
sda1: W7 boot partition
sda2: W7 partition
sda3: Linux
sda4: start of logic partitions
sda5: swap.
I deleted sda1 and sda2, and then expanded sda3. Now my partition table is:
sda3: Linux
sda4: start of logic partitions
sda5: swap
I would like to change the sda3 to sda1, how?
Also my fstab keep showing me the old Windows partition:
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
#Entry for /dev/sda3 :
UUID=059c7142-b4d8-4ab0-8d0f-ee460fce905e / ext4 rw,errors=remount-ro 0 1
#Entry for /dev/sdb1 :
UUID=5632BCEF32BCD569 /media/Datos ntfs-3g defaults,locale=en_US.UTF-8 0 0
#Entry for /dev/sda2 :
UUID=60D8A6E5D8A6B8A4 /media/Windows ntfs-3g defaults,locale=en_US.UTF-8 0 0
#Entry for /dev/sda5 :
UUID=53cd360a-1321-497f-8c3a-ff3adf4cf82c swap swap sw 0 0
|
First of all, if you have moved the beginning of the partition, chances are rather high, that you can only wave the filesystem there goodbye. The reason is, that the beginning of a filesystem usually contains a very important data structures (usually called supeblock) without which the data in the filesystem is inaccessible. Maybe some utility exists that could move the superblock and fix the filesystem (because sectors numbers, which are used for data addressing in the end, would change since these are counted from the beginning of the partition), but I would be very cautious about using any such thing. Especially if you intended to use it on a mounted partition.
If you did it on a living system, the kernel still has the old partition table cached and will create a new one on reboot (it can reread it when no partitions are mounted on the device - you can request this e.g. with hdparm -z). If you still can get the old patition boundaries (sector-exact) somewhere I would recommend to reset it and retry as described below. If you don't have the information any more, there are utilities that try to find out the original partitions boundaries by scanning the disk for superblocks (or probably by checking the kernel cached data).
That said, the correct way to do the resize is:
copy filesystem from /dev/sda3 to /dev/sda1 - either file by file, or with a dump utility, or directly with dd if the destination is bigger than source with. In the last case, you should extend the filesystem as described later.
fix all important references in the filesystem on /dev/sda1 from /dev/sda3 to /dev/sda1 - this includes:
bootloader configuration
where to find kernel to boot
kernel option root= which tells the kernel what partition to mount as /
/etc/fstab - you must do this by hand - again there could be a utility for that, but for this type of things, I wouldn't rely on it.
boot from /dev/sda1
either extend /dev/sda1 to cover /dev/sda2 and /dev/sda3 or repartition the now unused space spanned by those. If extending, use the utility for your filesystem to grow it at the end (for EXT2/3 this would be resize2fs, for XFS xfs_growfs etc.).
update /etc/fstab again if necesary.
Renumbering: fdisk has fix partition order (in the extra functionality sub-menu), gdisk has sort partitions (in the main menu). Then you have to check /etc/fstab and possibly also the bootloader configuration again to see whether any intervention is needed.
| Reset partitions numbers |
1,512,587,122,000 |
(first time StackExchange Linux user here),
I have been using Linux Mint for quite a while now, and originally partitioned with only a little space for it (originally intended just to play around with it). Because of this, I have just used all my storage.
I have another 80 or so GB to add to it using gparted, but am inexperienced with the program, and don't want to break anything. My disk allocation looks like this:
As can be seen, Linux Mint is on /dev/nvme0n1p5, with 70 GB unallocated to its left. I would like to combine these.
In addition to this, windows is on /dev/nvme0n1p3, which I would like to remove. Is it safe just to right-click in gparted and delete it? (Everything is backed up on flash drive already.)
Would the combination process for the old-windows partition (if I delete it), be the same as for the unallocated 74.81 GB?
Update:
I have taken initiative, and uninstalled Windows completely. The partition table on gparted now looks like this:
|
You can use the Partition -> Resize/Move option in GParted to resize your partition. The Resize/Move dialog is very simple, you can simply resize the partition to the left by dragging the slider.
The only "problem" is you can't do this with a mounted filesystem so you'll need to use a LiveCD (Ubuntu installation CD has GParted so you can use that). Also when resizing to the left all the data will be copied to the start of the free space so it might take some time to finish. And backup your data before doing this, the resize/move operation is safe but things can always go wrong (you can lose power or the system can crash in the middle of copying etc.) so having a backup is always a good idea when working with storage.
| Instructions for combining some partitions using gparted, and some other questions |
1,512,587,122,000 |
I want to reorganize my file system. I have swap allocated that I don't use. My / partition is overflowing all the time, and because of that I've kept moving big directories to a separate partition /mnt/nvme0n1p4. It occurred to me that it might be smarter to move all those directories back to /home and mount /home from what is now /mnt/nvme0n1p4.
I would also like to extend / with the space now on /nvme0n1p2.
I don't do this kind of stuff every day. So I thought that I should ask for some feedback on my plan.
My plan is to do the following: (I added some comments in bold after I actually executed my plan.)
copy the content of /home to /mnt/nvme0n1p4
copy all directories on /mnt/nvme0n1p4 that are now symlinked to from /home to their correct location /mnt/nvme0n1p4/me
sudo rm -rf /home/* <-- Edited after @raj advice
sudo mount /dev/nvme0n1p4 /home
change the folowing line in /etc/fstab:
UUID=aaf7e7e2-d36b-4877-b862-612d403a15da /mnt/nvme0n1p4 ext4 defaults,noatime 0 2
to
UUID=aaf7e7e2-d36b-4877-b862-612d403a15da /home ext4 defaults,noatime 0 2
backup the content of / to somewhere on /mnt/data. Just in case.
use gparted to remove [SWAP] and add it in front of / <-- Worked fine for me
Remove [SWAP] from /etc/fstab <-- I forgot this step initially. Causing an error during booting. So I had to do this from an bootable usb.
finished?
some system info
me@mypc $ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931,5G 0 disk
└─sda1 8:1 0 931,5G 0 part /mnt/data
sdb 8:16 0 111,8G 0 disk
└─sdb1 8:17 0 111,8G 0 part /opt
nvme0n1 259:0 0 931,5G 0 disk
├─nvme0n1p1 259:1 0 300M 0 part /boot/efi
├─nvme0n1p2 259:2 0 16G 0 part [SWAP]
├─nvme0n1p3 259:3 0 32G 0 part /
└─nvme0n1p4 259:4 0 883,2G 0 part /mnt/nvme0n1p4
me@mypc $ df
Filesystem Size Used Avail Use% Mounted on
dev 16G 0 16G 0% /dev
run 16G 1,7M 16G 1% /run
/dev/nvme0n1p3 32G 29G 1,3G 96% /
tmpfs 16G 324M 16G 3% /dev/shm
tmpfs 4,0M 0 4,0M 0% /sys/fs/cgroup
tmpfs 16G 50M 16G 1% /tmp
/dev/sdb1 110G 26G 79G 25% /opt
/dev/nvme0n1p4 869G 412G 413G 50% /mnt/nvme0n1p4
/dev/nvme0n1p1 300M 312K 300M 1% /boot/efi
/dev/sda1 916G 113G 757G 13% /mnt/data
tmpfs 3,2G 56K 3,2G 1% /run/user/1000
me@mypc $ ls /mnt/nvme0n1p4
docker Documents Downloads home lost+found R Repos 'VirtualBox VMs' VMs
me@mypc $ ls -l ~/.
total 32
drwxr-xr-x 3 me me 4096 5 dec 10:38 bin
drwxr-xr-x 9 me me 4096 20 dec 21:48 CytoscapeConfiguration
lrwxrwxrwx 1 me me 10 3 nov 16:03 Data -> /mnt/data/
lrwxrwxrwx 1 me me 25 4 nov 09:55 Documents -> /mnt/nvme0n1p4/Documents/
lrwxrwxrwx 1 me me 24 8 nov 00:36 Downloads -> /mnt/nvme0n1p4/Downloads
drwxr-xr-x 3 me me 4096 10 dec 23:16 igv
drwxr-xr-x 3 me me 12288 16 feb 15:57 Pictures
lrwxrwxrwx 1 me me 16 13 nov 09:41 R -> /mnt/nvme0n1p4/R
lrwxrwxrwx 1 me me 20 9 nov 14:06 Repos -> /mnt/nvme0n1p4/Repos
drwxr-xr-x 3 me me 4096 4 nov 08:14 snap
drwxr-xr-x 4 me me 4096 14 feb 20:22 tmp
lrwxrwxrwx 1 me me 9 3 nov 16:58 Unsorted -> /mnt/tmp/
expected result
me@mypc $ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931,5G 0 disk
└─sda1 8:1 0 931,5G 0 part /mnt/data
sdb 8:16 0 111,8G 0 disk
└─sdb1 8:17 0 111,8G 0 part /opt
nvme0n1 259:0 0 931,5G 0 disk
├─nvme0n1p1 259:1 0 300M 0 part /boot/efi
├─nvme0n1p3 259:3 0 48G 0 part /
└─nvme0n1p4 259:4 0 883,2G 0 part /home
|
Basically looks good, however:
in step 3, instead of rm -rf /home, better do rm -rf /home/*. You should not remove the /home directory itself, only it's contents, because you need an empty /home directory to exist as a mount point. If you happen to delete the /home directory, you need to re-create it with the same ownership and permissions as the previous /home directory had.
when performing steps 3 and 4, you should be out of the /home directory, ie. your current directory should be for example / or /root. It would be best to perform the whole operation being logged in directly as root, if it is possible in your system, in this way you won't use the /home directory at all.
I'm also not sure about extending the root partition with the space that is before that partition. (I guess that your nvme0n1p2 is located before nvme0n1p3 on the disk). While there is no issue with extending the partition and filesystem past the end of the partition, I'm not sure if the same applies for extending it before the start of the partition. I'm not sure if gparted/e2fstools is able to move the inode table and all filesystem structures backwards, towards the new start of the partition. Maybe there's someone more experienced with such changes who can answer that.
| reorganizing my filesystem |
1,512,587,122,000 |
I am currently on Centos 7 and I am trying to free up some space on one of my disks so I can install Ubuntu along side of it (dual boot). I have a 2TB disk that is just under half full. This is not a primary disk, it is all backup. When I am booted into Centos the disk is /dev/sdc, and is just a single partition (no numbers after /dev/sdc). I created a bootable usb with Ubuntu 18.04 on it, booted from the usb, and the disk was recognized in that system as /dev/sda. I ran gparted, and told it to shrink the partition by ~400GB:
This looked correct to me, so I went ahead and applied the changes. It finished without issue. However, when it was done there was still only 1 partition, with the unallocated space inside of it, rather than the partition itself shrinking. There's even an alert icon that when I click on it tells me that there is 390.63GB within the partition asking me if I want to grow it:
I know that I could, if I had enough disk space elsewhere, copy the data over and repartition this drive from scratch. However, I don't actually have enough space to do that, and things are pretty tight inside the box right now with 5 drives. Is there any way to split this drive into multiple partitions without going that route?
Not sure if this is relevant, but when I was still booted into Ubuntu the first time I did this I ran Check on it from gparted, and when it did that it automatically resized it back. I don't know if that means that it detected the wrong size as being an actual error, or if it is normal for gparted to just make use of extra space like that when you run check. I re-ran the resizing operation again before booting back into CentOS and it still currently looks like the second screenshot, and df says that the partition is 1.5TB with 882GB used and 494G available.
|
When I am booted into Centos the disk is /dev/sdc, and is just a single partition (no numbers after /dev/sdc).
/dev/sdc is not a partition, it's the disk itself which not partitioned, you have an ext4 filesystem directly on the disk without a partition table so you can't add partitions to your disk.
By shrinking the drive you really only shrunk the filesystem which is why you see the free space inside of it.
I know that I could, if I had enough disk space elsewhere, copy the data over and repartition this drive from scratch
This is unfortunately only thing you can do now, you can't add a partition table to the disk, because there is not enough space for it, you'd need to move the filesystem few sectors forward to make space for the pt which is in theory possible but very complicated and with high risk of losing your data.
| Attempt to shrink partition with gparted leaves all of the unallocated space still inside the partition |
1,512,587,122,000 |
I want to increase the size of my Linux partition (/dev/sda5) using the 52.41GB of unallocated space on my SSD but from what I understand the /dev/sda3 partition is in the way of using the unallocated 52GB.
What is the sda3 partition likely to be? Can it be safely deleted or is there a way around this?
Here is an image of GParted
|
The EFI System Partition (ESP) is a partition on a data storage device (usually an HDD or SSD) that is used by computers adhering to the Unified Extensible Firmware Interface (UEFI). The EFI System Partition is an interface that's used by the computer to boot Windows. It's like a step that is taken before it runs the Windows partition. It's a small partition, but without that partition your computer wouldn't know how to boot Windows, so don't delete it.
The EFI System Partition is a dedicated partition on GPT. It's usually a small one (100-500 MB) formatted as FAT located at the beginning of the disk, and its partition record is at the beginning of the GPT (GUID Partition Table).
| What is this FAT32 partition on GParted? |
1,512,587,122,000 |
I recently added CentOS 7 to my home PC alongside Windows 10 while WFH.
The amount of storage space I allocated for this ended up not being enough, so I used Gparted to reduce my windows space and granted it to my CentOS partition. My drive now looks like this:
sdb6 is my linux partition. All the space I made available to sdb6 is currently unused, but does not appear as available space according to nautilus.
I've looked at some previous answers, but they appear not to apply to LVM based file systems. I found this page on the RHEL website that appears to be what I am looking for, but when I try their command:
sudo lvextend -l +100%FREE /dev/sdb6
I get this error:
"/dev/sdb6": Invalid path for Logical Volume.
How can I make these 34GB available for storage on Linux?
|
You are doing it for the disk not for lv.
Just do a sudo lvs command and based on the list of output LVs , you can use :
sudo lvextend -l +100%FREE <LV-Name>
| How do I extend the storage space on a lvm filesystem in Linux? |
1,512,587,122,000 |
When I set up arch linux, I created a partition with fdisk, and ran mkfs.ext4 on /dev/sda.
Now, I want to partition /dev/sda to have 2 partitions, instead of just one. The problem is, that when I try to resize /dev/sda, it shows that the unallocated space is in the partition, and I cannot create a new partition.
|
To convert a volume without a partition table to one with a partition table one can copy the data elsewhere than back again after the format, or perform the operation in place;
shrink the file system to start at 1GB and end 1GB before the end.
note down the exact start/end locations.
write a new partition table (will look like the data is lost)
create a partition around the noted locations.
you may want to do this on a test volume before trying it with important data so you know how to do it correctly.
| Whole disk is a partition: can't shrink, can't create new one |
1,512,587,122,000 |
This is my root volume, it is 32GB and contains /boot, and on LVM LV's are / and swap.
sdb 8:16 0 29.8G 0 disk
├─sdb1 8:17 0 200M 0 part /boot/efi
├─sdb2 8:18 0 256M 0 part /boot
└─sdb3 8:19 0 29.4G 0 part
├─AntergosVG-AntergosRoot 254:0 0 26.4G 0 lvm /
└─AntergosVG-AntergosSwap 254:1 0 3G 0 lvm [SWAP]
I want to clone this onto a larger SSD. Is the following the correct procedure? I will be using another computer so my original computer won't have both old and new disks inside it at the same time
dd, where if=old_ssd and of=new_ssd
Increase the size of partition sdb3 (LVM PV) to fill up the new space using gparted
Boot into the new system, the use lvresize to expand AntergosRoot to the entire space of the newly resized PV
Resize the (ext4) filesystem of / to the entire space of the previously resized LV
My main problem is I don't know which commands to use, and secondly, when resizing the LV AntergosRoot, will the swap volume cause it to become non-contiguous?
|
You're missing a step. After resizing the sdb3 partition and booting into the new system, you'll need to use the pvresize command to tell LVM that it is allowed to use the new space within the extended sdb3.
So:
2.5. Boot into the new system, then pvresize /dev/sdb3
In step 3, I would generally prefer using lvextend instead of lvresize - just as a failsafe: if I would accidentally mistype the new size, lvresize might shrink the LV rather than extend it, while lvextend would just tell me that the specified new size is smaller than the current one. Safer that way.
But if you want to use all the new space immediately, you could do it like this:
lvextend -l +100%FREE /dev/mapper/AntergosVG-AntergosRoot
Step 4 is quite simply:
resize2fs /dev/mapper/AntergosVG-AntergosRoot
All these steps (2.5 ... 4) can be done while the root filesystem is mounted and writeable.
And yes, the root filesystem would become physically non-contiguous on the disk - but that's not a problem: when viewed as a LVM LV, it is accessible as a contiguous set of block numbers, and LVM hides the jump over the swap partition. And in terms of performance, a single discontinuity is not much of an issue at all.
If there's an actual requirement to keep a LV physically contiguous on disk, you can set lvchange -C y <name of LV> to tell that to the LVM. But then, you cannot extend the LV as easily: you would have to ensure that there is free space after the current tail end of the LV (using pvdisplay --maps and, if necessary, pvmove to rearrange things) before extending. In most cases, this is not necessary.
| How do I clone a SSD containing LVM LV's and /root to a larger one? |
1,512,587,122,000 |
I'm a new user of Linux and I installed Linux Mint 18.2.
I created 2 partitions:
Boot / Root (Namely /).
Home (/home).
I underestimated the size needed for the Boot / Root and only set it 25GB.
I now need to resize it.
I used LiveCD to run GParted and this is what I have:
Can anyone guide me how can I resize the partitions without loosing any data?
It seems I must delete the sdf2 partition completely which means data is lost.
Is there any other way to do it (I don't have anything besides the disks above)?
On worse case scenario I don't mind losing all data on /home but I want the system to work as before.
Please guide me and remember those are my first steps in the Linux World.
Thank You.
|
In GParted:
First "Move/Resize" /dev/sda5to the right. To do that, right click on the line reading "/dev/sdb5", select "Resize/Move"; then in the next window drag the handle on the left of the partition to the right (as far as you want to reclaim free space to the left), or modify the value for "Free space preceeding" . Select "Resize/Move" button and then "Apply all Operations", which will then take some time as the data have to be moved to the right.
When finished, do the same with the extended partition, i.e. select "extended partition", resize to the right as far as possible.
Last, select "/dev/sda1", select "Resize/Move" again, and extend to the right into the now unallocated space.
If you do not want to play around with partitions, you might use some space in /home to hold data from /using softlinks. Find some folder with lots of data (e.g. using du -hs /*), move it somewhere in /home, and create a softlink: ln -s /home/<path_to_new_folder> /<name_of_moved_folder>. You should not do this for system folders like /bin, /usr or /var, but maybe for subfolders (e.g. /var/log).
| Resize Boot Partition Next to An Extended Partition |
1,512,587,122,000 |
The attached screenshot shows my situation. I extended the virtual drive of my VirtualBox machine with one extra GiB, and now I would like to extend the sda1 partition with that extra space.
But I can't because of the extended partition in the way.
Is it possible to somehow overcome this problem?
|
The extended partition can't be changed unless its inner partitions are changed first. In your case the swap partition is in the way, which you would have to resize (or simply just delete it in your case, you can easily recreate it or use a swap file instead).
A common problem is that the swap partition can't be moved/removed because it's still mounted and used, in such a case you need to turn off that it's being used as a swap partition (e.g. using swapoff), no reboot required.
(It might be also worth noting that the extended partition stuff is not needed anymore when using the GPT partition scheme instead of MBR. Note that GPT is commonly used in conjunction with UEFI, whose support in VirtualBox used to be quite lacking, but from what I heard it improved in more recent versions.)
| Increase partition size with free space divided by another partition |
1,512,587,122,000 |
Forgive me, as I am not the best at describing tech problems.
I have a /dev/sda5 ext4 partition running Linux Mint, and a /dev/sda7 running Kali Linux, both of which are in an extended partition.. I want to add space to my Mint, as Kali Linux does not demand much space. I took off 50 Gigs from my Kali Linux. However, Gparted does not give me the option to add THAT free space to my Linux Mint. How can I solve this?
EDIT:
Kali Linux is on /dev/sda6. /dev/sda7 is swap.
|
So... you have something else in /dev/sda6? "Recent" versions of gparted are able to move partitions. Your problem would be:
move /dev/sda6 down (to use up the space freed in /dev/sda5)
move /dev/sda7 down (to put the free space on its end)
extend /dev/sda7
The partitions have to be unmounted, according to the documentation:
Moving a Partition
Moving and resizing a partition can be performed by a single gparted operation.
To move a partition:
Select an unmounted partition. See the section called “Selecting a Partition”.
Choose: Partition → Resize/Move. The application displays the Resize/Move /path-to-partition dialog.
Adjust the location of the partition. See the section called “Specifying Partition Size and Location”.
Specify the alignment of the partition. See the section called “Specifying Partition Alignment”.
Click Resize/Move. The application displays the resize/move partition operation in the Pending Operations pane.
Tip
If the partition is an operating system boot partition, then the operating system might not boot after the move operation is applied.
If the operating system fails to boot, see the section called “Fixing Operating System Boot Problems”.
| Gparted Not letting me Resize Partition and Add more Disk Space |
1,512,587,122,000 |
I have read through all the man pages of my hfs-related packages (hfsplus-tools, hfsutils), and I cannot find a way to relabel a hfs+ volume. gparted also seems to be able on my system to do all the other operations on hfs+, but not change UUID and label (it can view them though, I suppose through libblkid). Is it really not possible?
|
The actions available on file systems are listed on the GParted Features page. Currently (latest version 0.23.0) the Label and UUID features are not available for HFS and HFS+ file systems. This is due to limitations in the underlying file system tools.
| relabel hfs+ volumes |
1,512,587,122,000 |
I have a dynamically allocated virtual disk, which was initially 40GB.
I increased the disk size from 40 GB to 100GB first and then also updated the partition using GParted as described here,
https://www.rootusers.com/use-gparted-to-increase-disk-size-of-a-linux-native-partition/
But still the disk size does not update,
df -h shows
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/I0--vg-root 35G 33G 1.3M 100% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
udev 2.4G 4.0K 2.4G 1% /dev
tmpfs 485M 564K 484M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 2.4G 4.0K 2.4G 1% /run/shm
none 100M 0 100M 0% /run/user
/dev/sda1 236M 44M 180M 20% /boot
/home/iadm/.Private 35G 33G 1.3M 100% /home/iadm
|
The root partition is on an LVM logical volume (LV) named root in a volume group (VG) named I0-vg, so you must first expand the underlying physical volume (PV), then expand the LV, then expand the filesystem:
pvresize /dev/<pv_dev>
lvresize --extents +100%FREE I0-vg/root
resize2fs /dev/mapper/I0--vg-root
where <pv_dev> is the block device of your LVM PV.
| VDI size increase not reflecting |
1,512,587,122,000 |
How can I assign unnalocated space to 1st partition /dev/sda1 ?
|
You could move your extended (swap space) to the end of unallocated space and then resize sda1. By moving I mean you could simply delete it, resize sda1 and then create the swap space at the end of the disk.
| gparted moving unallocated to 1st partition |
1,512,587,122,000 |
I used dd to write a 2GB image to an 8GB SD card; gparted now sees it as a 2GB SD card and I can't figure out how to format it for 8GB again. ddalso sees it as a 2GB SD card when trying to format it with of=/dev/sdb if=/dev/zero bs=1M. How can I get it to know its real size?
|
you can use the following commands:
cat /proc/partitions
cfdisk YOUR_DEVICE ===> such as cfdisk /dev/sdb
| SD Card interpreted as wrong size |
1,512,587,122,000 |
I downloaded GParted live archive and extracted it to /dev/sda4.
The GParted guide explains installation with grub, but since I'm not using grub I wanted to give it a shot adding a manual entry to rEFInd. This is the pratition tree.
NAME MOUNTPOINT LABEL SIZE TYPE FSTYPE
sda 111.8G disk
├─sda1 Recovery 499M part ntfs
├─sda2 99M part vfat
├─sda3 16M part
├─sda4 ARCH_202104 16.1G part vfat
└─sda5 Data 95.1G part ntfs
sdb 931.5G disk
├─sdb1 1M part
├─sdb2 15M part
├─sdb3 Main 833.8G part ntfs
└─sdb4 /mnt/ArchData 97.7G part ext4
nvme0n1 931.5G disk
├─nvme0n1p1 16M part
├─nvme0n1p2 Main M.2 433G part ntfs
└─nvme0n1p3 / Arch 494.6G part ext4
rEFInd is installed on sda2 and GParted is on sda4(ARCH_202104) and in refind.conf I've added an entry like so:
menuentry "GParted Live" {
icon /EFI/refind/icons/os_linux.png
volume "ARCH_202104"
loader /live/vmlinuz
initrd /live/initrd.img
options "root=/dev/sda4 rw add_efi_memmap"
}
Restarting and booting from that new entry in rEFInd yields the error Invalid loader file. Error not found while loading. And it yanks me back to rEFInd loader.
In the end I let rEFInd scan for new entries itself, it adds it correctly and I can boot GParted, but when I add the stanza manually it's not working. I want to know what was the mistake I made?
|
According to https://gparted.org/livehd.php the options string should be quite a bit longer. Something like:
options "boot=live config union=overlay username=user components noswap noeject vga=788 ip= net.ifnames=0 live-media-path=/live bootfrom=/dev/sda4 toram=filesystem.squashfs"
The error would seem to indicate that /live/vmlinuz is not found. Make sure that your /dev/sda4 filesystem contains a directory named live and that it contains files vmlinuz and initrd.img. If I understand correctly, there should also be a file named filesystem.squashfs in the same directory. The location of the filesystem.squashfs file is given in two pieces: the directory at the live-media-path= option, and the filename in the toram= option.
If the vmlinuz and initrd.img files are in some other location, make sure the pathnames on the loaderand initrd lines match the actual pathnames, relative to the root of the filesystem identified by the volume line. Likewise, if the filesystem.squashfs file is in a different location or named differently, adjust the options line to match reality.
As a wild guess, if GParted Live's Linux kernel starts up successfully, but fails to find the filesystem.squashfs file, you might try adjusting the bootfrom= part on the options line to bootfrom=LABEL=ARCH_202104. If GParted's kernel detects your disks in a different order, this might or might not help.
Because your filesystem type seems to be VFAT, it is supposedly case-insensitive... but rEFInd is using the UEFI firmware's filesystem support, and some UEFI firmware implementations are known to get the case-insensitiveness wrong. If you can see the auto-detected version, use the exact same character case as it does.
| rEFInd manual stanza for GParted live |
1,534,811,933,000 |
I created a new backup system and initially tested everything with a 2.5TB disk. Once the idea worked out, I went to increase the disk to 7.5TB. I increase my volume on the SAN, then increased the disk in VMWare to 7.5TB. Then, went in to gParted and increased to 7.5TB but now im still seeing only 2.5TB total size on the disk when I do df -h
Here are the outputs of some needed information:
Paste from df -h
/dev/sdc 2.5T 17G 2.3T 1% /usr/local/bananas/
Here is fdisk -l /dev/sdc
Disk /dev/sdc: 8246.3 GB, 8246337208320 bytes, 16106127360 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
WARNING: fdisk GPT support is currently new, and therefore in an
experimental phase. Use at your own discretion.
From e2fsck -f /dev/sdc
[root@computer ~]# e2fsck -f /dev/sdc
e2fsck 1.42.9 (28-Dec-2013)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sdc: 341359/163840000 files (2.6% non-contiguous),
14564432/655360000 blocks
Im running this on a Centos6 system. It looks like the disk is actually storing data properly but it won't go past 2.5TB even though everything else is showing it is set larger. Any ideas on this issue would be greatly appreciated!!!
|
I just wiped out the partitions and then created a new partition, and then reformatted it as XFS. Everything is showing up properly in all forms of disk checking.
| Disk shows wrong size on DF, correct size in gparted and vmware |
1,534,811,933,000 |
After I've installed my Linux Mint 18.1 [dual booting with windows 8.1] i wanted to extend /home partition. So i installed gparted and tried to extend but couldn't, after doing some reading on the forums it says for most of people that they should delete the swap partition and then recreate it again so that the unallocated space be right after the wanted partition, but in my situation there are way too different things between the unallocated space and the /home partition
How Can i Extend /dev/sda7 (/home) partition without doing any reinstalliation
How Can i Extend /dev/sda6 (root) partition if i wanted to in the future
PS: It may sound like a duplicate but in the other cases the gparted is less compilcated than my mess, so it's easier to do in other cases than mine.
|
The best way here (in my opinion) is to move that unallocated space toward the root and home partition.
Here is how to do it :
Boot with an ubuntu live cd, and install gparted in it (sudo apt-get update && sudo apt-get install gparted)
launch gparted and resize the swap partition to integrate all the extra space in it, then resize it again, but this time, leave the extra space before the partition.
redo the same thing with the ntfs partition.
Now your unnalocated space is near your home partition, just resize it to extend all the extra space.
Using this technique, you wont have to reinstall, but you will propably need to fix grub. It's really easy, you just boot with an Ubuntu live cd and follow the steps over here
Important
This is the only solution I got on mind to extend the home or root partition without reinstalling. Others may have better ideas, so wait a little bit before going with this one.
It will be much better if you have an external hard drive to save the files that are in the ntfs partition, because some problems may happen, and data can be lost.
| Gparted Linux Mint 18.1 issue |
1,534,811,933,000 |
After using Kubuntu for a few months, I wanted to install a lower level OS, e.g. Debian. I used the Debian manual, by writing the ISO directly to the USB.
Now GParted doesn't see the USB, fdisk says inappropriate ioctl, and parted says unrecognized disk label. Is there a command to completely overwrite the file system on the USB?
Thanks in advance!
|
Try to wipe the drive with (as root) wipefs --all /dev/sdX. Where X in sdX is the drive you want to erase. Be careful that you are choosing the right drive!
After that; I always use the dd command when writing to USB sticks. Like so:
sudo dd if=/home/<user>/Downloads/<debian>.iso of=/dev/sdX bs=4M;
Where X in sdX is the device in question.
It will completely overwrite everything in sdX, so (again!) make sure you are writing to the correct drive!
Read more about dd here.
| parted - Completely overwrite USB device |
1,534,811,933,000 |
I have Ubuntu as virtual machine guest hosted in esxi server. The Ubuntu disk storage was 5 GB and I wanted to extend the disk up to 30 GB. I extended it via esxi client, and now I see this in Ubuntu terminal
root@linux:/temp# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 5.6G 5.3G 31M 100% /
none 497M 184K 497M 1% /dev
none 502M 0 502M 0% /dev/shm
none 502M 108K 502M 1% /var/run
none 502M 4.0K 502M 1% /var/lock
none 502M 0 502M 0% /lib/init/rw
root@linux:/temp# fdisk -l
Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0001c70e
Device Boot Start End Blocks Id System
/dev/sda1 * 1 743 5964800 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 743 3917 25490433 5 Extended
/dev/sda3 1 1 992+ 8e Linux LVM
Partition 3 does not end on cylinder boundary.
/dev/sda5 2025 3917 15192064 83 Linux
Partition table entries are not in disk order
root@linux:/temp#
How can I extend the sda1 to full 32 GB as showed in fdisk -l output ?
I tried to boot from gparted and can see following
I the sda1 cannot be resized, any help?
|
This is similar to a situation where you have a larger disk, without having a extended the partition to use the available space. You will need to use a disk utility of some sort while /dev/sda1 is unmounted.
I would suggest using an .iso version of Gparted on the host which you can mount as a DVD drive on the Ubuntu guest. Boot the VM into the Gparted disk, with Gparted operating in live mode, and extend /dev/sda1 to fill the available space.
Gparted is a fairly easy to use program, with an intuitive interface but there are detailed instructions on its use here.
| extend ubuntu partition in VM |
1,534,811,933,000 |
I recently got a message while updating some programs that my /boot is full. I've been on other posts and everyone says delete files in /boot but I thought making it bigger seems more logical and better long-term if it gets full again. I right clicked on the /dev/sda2 and click resize but it doesn't move. Any ideas?
If this doesn't work I'll use SystemRescueCd and try again.
|
I figured it out. It's definitely due to the encryption. GParted sees such as un-partitioned - so can't do much to it.
Unfortunately it's going to be a command-line fix only. Here's a writeup on how to do it under Ubuntu: ResizeEncryptedPartitions - Community Help Wiki
| Can't resize /dev/sda2 extended partition with gparted live cd |
1,534,811,933,000 |
Okay... so I did something which I was probably not supposed to do. I have a 256 GB SSD. GParted from a live Kubuntu CD showed that I have 16gb of unallocated space. I wanted to add it to the root partition. However, there were swap and boot partitions between the unallocated space and the root partition, so I first added the space to boot partition, then shrunk the boot partition from left, then repeated the same with swap, and finally added it to root partition. To be safe, I reinstalled grub. Now, my Windows continues taking around 10s to boot, while Kubuntu takes more than a couple of minutes. Why is this so? If I did break something, why does it boot at all?
Thanks a lot!
|
Found the solution!!
My swap space was in /dev/nvme0n1p6, so I ran:
sudo swapoff -a
sudo mkswap -L swap /dev/nvme0n1p6 and
sudo swapon -a.
Then I disabled some startup services, and finally commented out the swap line from /etc/fstab. Don't know whether sudo sysctl vm.swappiness=10 helped or not, but after rebooting, systemd-analyze showed 14.385s, as compared to around 2min 25s before.
| Kubuntu takes more than 2 minutes to boot! |
1,534,811,933,000 |
Suppose there's a hard drive /dev/sda, and both that:
/dev/sda1 is a single ext4 partition taking up the whole disk, and it's mostly empty of data.
dumpe2fs -b /dev/sda1 outputs the badblocks list, which in this case outputs single high number b representing a bad block near the end of /dev/sda; b is fortunately not part of any file.
Now a swap partition needs to be added to the beginning of /dev/sda1, and gparted (v0.30.0-3ubuntu1) is used to:
Resize (shrink) sda1, so that it starts several gigabytes later, but ends at the same place.
Add a swap partition in the gap left by shrinking sda1.
So gparted finishes the job and we run dumpe2fs -b /dev/sda1 again. What happens? Does it...?
Output nothing, meaning the resize forgot the bad block.
Output b unchanged.
Output b + o where o is an offset corresponding to where the just shrunk /dev/sda1 now begins.
NOTE: To simplify the question, suppose that the hard disk in question has no S.M.A.R.T. firmware. (Comments about firmware are off-topic.)
|
GParted doesn’t take any ext2/3/4 badblocks list into account; I checked this by creating an ext4 file system with a force bad block, then moving it using GParted. Running dumpe2fs -b on the moved partition shows the bad block at the same offset.
The result is 2, so the bad block ignored by the file system no longer corresponds to the real bad block on the medium. This means that the file system ignores a block it could safely use, and is liable to use the bad block it should avoid.
This does make sense, at some level. When GParted (or any other tool) moves a partition, it doesn’t use a file system-specific tool, it moves the container. This works in general because file system data is relative to its container; usually the file system data structures don’t need to be updated as a result of a move. However bad block lists describe features which don’t move with their container... Making GParted handle this would be quite complex: not only would it have to update the bad blocks list itself, it would also have to move data out of the way so that the bad block’s new position in the moved file system is unused.
| Does gparted make good use of badblocks lists? |
1,534,811,933,000 |
I'm stuck in linux installation process.
I've resized windows partition in order to be able to install linux (dualboot).
Here is a screenshot of computer manager tool :
Once, I've boot it on live usb, gparted tell me wrong information : there is only one partition witch takes the whole disk.
Here is the screenshot of gparted (from live usb) :
Do you have any idea ?
Thank you by advance for your help :-)
|
This looks like your USB disk you use to boot Linux. I assume there is a third drive in drop-down.
In the livecd, do the following in the terminal (you can leave gparted open):
sudo fdisk -l
It should spit out three drives, two that are around 120Gb and one 1Tb drive ...
| Gparted see NTFS windows partition as fat32 |
1,534,811,933,000 |
I am running a fedora Virtual machine and after much pain I managed to extend my virtual machines .vdi, from 20gb to 40gb. However it appears my pain is not over.
The machine still complains of low disk space, still has many errors and the gui disk usage analyzer shows I am full and so does df. However gparted tells me I have 40gb on that partition.
is it Virtual box weirdness? do i need to kick fedora in some way to refresh its known capacity?
Please find attached a screen grab of all the relevant applications, let me know if you need more info. Thank you
|
The filesystem is 20G on a partition that has 40G. You need to resize the filesystem! growfs is the correct tool.
| Fedora "disk full", df, du (gui) confirm but gparted shows the partition is big enough |
1,534,811,933,000 |
I have an old Dell Inspiron 630m with Windows XP and I want to put some Linux distro on it. I have tried Ubuntu 12 but it did not work (nothing happend). Downloading older versions is slow. I am not a nerd (only wanabe) so I'm afraid of installations that are more complicated than Ubuntu. But the old laptop is a great tool for messing up so I ask you, which distro should I try and how can I get it.
EDIT:
I went for Debian (Crunchbag looked nice but too big step for me from Ubuntu). I deleted Windows in GPARTED but now I'm missing firmware, ipw2200-bss.fw. How do I add it to my dead laptop?
|
From what I found, this laptop is powerful enough to run a lightweight GUI (like XFCE, Openbox etc...).
You could start using Debian (which isn't much more complicated than Ubuntu) or Arch Linux (which is more difficult, but will be a good experience).
| Linux on a Dell Inspiron 630m |
1,534,811,933,000 |
gparted is said to be the GUI frontend of parted.
Why can't parted show used and available sizes for each partition, as gparted does?
If parted can, how can I make it show that information?
If not, how does gparted make it?
$ sudo parted -l
[sudo] password for t:
Model: ATA ST1000LM014-1EJ1 (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 2097kB 1049kB bios_grub
2 2097kB 16.0GB 16.0GB linux-swap(v1)
4 116GB 716GB 600GB ext4
3 716GB 1000GB 284GB ext4
|
On the command line, the used and unused space on each filesystem can be listed using the command df, assuming that the filesystems are mounted.
If you wanted to be pedantic, you could say more accurately that "gparted is a graphical frontend for parted and any combination of btrfs-progs/btrfs-tools, e2fsprogs, f2fs-tools, dosfstools/mtools, hfsutils, hfsprogs , jfsutils, util-linux, lvm2, nilfs-utils, ntfs-3g/ntfsprogs, reiser4progs, reiserfsprogs/reiserfs-utils, xfsprogs and/or xfsdump"... but I think that would be too cumbersome for general use. I believe that the tools and/or libraries in those packages could include the functionality to find out the used/unused capacity on each supported filesystem, if that functionality isn't integrated into the main gparted binary.
So, yes, gparted is a frontend for parted... but not just a simple frontend: since the GUI allows for more easier presentation of complex concepts, it uses that capability to provide more advanced functionality. In doing so, it acts as a frontend for way more tools than just parted alone.
| Can parted show used and available sizes as gparted? |
1,534,811,933,000 |
I've a 16 GB USB Flash drive with GPT partition table having 6 partition. fdisk and gdisk correctly detecting the partitions. Fedora 27, with mate desktop installed, can correctly mount all partitions but gparted showing only one partition with iso9660 partition table. Further that iso9660 partition is not deletable from gparted.
Surprisingly, gparted installed in lUbuntu in the same computer is detecting all 6 partitions and working fine with the same USB Drive.
If the drive is filled with 0 as follows it's becoming blank and gparted in Fedora 27 can modify it afterwards.
dd if=/dev/zero of=/dev/sdb bs=2048
Or, If I format it with block-size 2048 it's working again with gparted on Fedora 27.
But if again I restore the backup with dd it's creating the same problem again. [I kept a backup of the disk using dd before formatting or filling with 0]
So, I'm guessing some issue with block size, but what's the exact issue? And how gparted on lUbuntu is overcoming the issue? And is there any solution?
I've tried compiling gparted on Fedora 27 also with no fate.
Output of gdisk -l /dev/sdb
Found valid GPT with protective MBR; using GPT.
Disk /dev/sdb: 31277232 sectors, 14.9 GiB
Model: Extreme
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 493A4183-68C3-4027-81AB-C48B76EDA317
Partition table holds up to 176 entries
Main partition table begins at sector 2 and ends at sector 45
First usable sector is 46, last usable sector is 31277186
Partitions will be aligned on 4-sector boundaries
Total free space is 2129 sectors (1.0 MiB)
Number Start (sector) End (sector) Size Code Name
1 64 219 78.0 KiB 0700 Gap0
2 220 5979 2.8 MiB EF00 EFI boot partition
3 5980 30787 12.1 MiB 0700 Gap1
4 32768 9345023 4.4 GiB 0700
5 9345024 27109375 8.5 GiB 0700
6 27109376 31277055 2.0 GiB 8300
What gparted detecting is
Any help is highly appreciated.
NOTE: I went through https://askubuntu.com/questions/675649/unable-to-delete-usb-drive-partitions-block-size-error also
|
It appears that you have ISO signature remnants left on the drive. Perhaps you copied a .iso file directory to the drive at some point?
To remove the ISO signatures see GPT disk full of partitions looks like iso9660 with no partitions
To resolve this run the following:
sudo wipefs -o 0x8001 /dev/sdb
(It will surgically write zeros over 5 bytes of the ISO signature
without touching the GPT).
| gparted not detecting USB drive partitions in Fedora 27 only |
1,534,811,933,000 |
I'm downloading a huge file using a torrent client and I was wondering if I can use GParted to partition around 100gb of my 1tb to save time because I plan to dual boot this computer right after the download finishes.
Below is my current partition.
|
As the volume/partition that you wish to modify is mounted, you should not modify it. In fact, GParted will not let you modify mounted partitions:
Why are some menu items disabled?
The partition is mounted and modifying a mounted partition is DANGEROUS. Just unmount the partition…
To use GParted on the boot volume, you'll need to stop/finish the torrent, then reboot from another volume. Hence, the one that you wish to modify will not be in use. The simplest way is to download the GParted Live image, then boot from USB or DVD.
| Is it okay to partition my drive while I'm downloading a huge file (4gb) |
1,534,811,933,000 |
This is my current partition table:
In which /dev/sda8 is the partition on Which I am currently running my primary OS - Trisquel GNU/Linux (you can see it's mount point as /). The /dev/sda1 is the primary partition containing Windows XP.
I want to resize /dev/sda1 (Size:50GB ; Used 27.97GB) i.e. want to reduce it to 30GB (Split into 30GB + 20GB). So, I've first Unmounted /dev/sda1.
Now When I use Resize/Move option (from right-click menu) The following window appears:
The problem is that it doesn't allow to reduce partition! Why?(Because it is primary partition?)
And Finally How can I resize (reduce/split) /dev/sda1?
Note:- Gparted is running from Trisquel (GNU/Linux).
|
Before you can resize any ntfs based partition, you need to ensure all the files are pushed up to the start of the partition. This is acomplisehd by running the defragmentation process on the partition within windowsXP.
It may also be useful to delete any temporal files or any other stuff you don't want from the windows partition.
In addition, deleting the windows swap file may also be helpfull, as it is normally not moved by the defragmentation tool. You can safely delete the pagefile from linux before resizing the partition, or you may turn off the swap file within windows.
| Gparted : Resize (split) Primary Partition? |
1,534,811,933,000 |
I'm formatting an external hard drive with gparted.
The original NTFS read 232.28 MB used.
Now, with Ext4, it reads 1.92 GB used.
Questions:
Why?
Is there a better file system I should use for external drives?
(This drive will only be used with linux computers. )
Thank you!
|
I assume those "used" values are both for a freshly-created, empty filesystem of the same size, and that's where your confusion comes from. Those "used" values suggest that the actual size of the filesystem on the external drive is probably quite large (say, more than 1 TB?).
On a freshly-created empty filesystem, the non-zero "used" value indicates the disk space allocated for filesystem metadata.
NTFS seems to store most of its metadata as special hidden files. That probably allows the space allocated to metadata to easily grow as needed, and so the filesystem does not need to allocate all of it at filesystem creation time.
On the other hand, ext4 is fundamentally based on a fairly classic filesystem design, where e.g. all the inodes are pre-allocated and the ratio of inodes-per-megabyte is set at filesystem creation time and cannot easily be changed afterwards. As a result, all the metadata space the filesystem will ever need (while at its current size) will be allocated as part of the filesystem creation process.
Using NTFS on an external drive that will only be used with Linux systems does not really make sense: on older Linux versions you might be forced to use NTFS-3g, which is a FUSE (Filesystem in User-Space) driver, and ... not exactly a performance-optimized solution. On very old or hardened systems, there is no guarantee that a NTFS filesystem driver would be available at all.
On the other hand, ext4 is very well supported and has excellent compatibility features. If you know you'll need to work with very old Linux versions, you could disable some of the newer filesystem options or even create the filesystem as ext3 or ext2 to allow even extremely old Linux systems to fully access it.
And since the ext2/3/4 has always been a kernel-based driver, it can achieve good performance (with certain caveats though: if you disable the dir_index filesystem option to achieve compatibility with old systems, directories with very large numbers of files will be slow).
However, you should note that using any Unix-style filesystem (like ext4 or XFS), the UID and GID numbers used on the system that writes files to the disk will be preserved in the file metadata. If you need to ensure all the files on the external drive will be easily accessible on any Linux system the external drive might be plugged into, see this answer I wrote in 2018.
| Formatting the same drive with gparted: original NTFS=232.28MB used | Ext4= 1.92 GB used Why? |
1,534,811,933,000 |
Good morning from Australia.
Could someone please help me. I have researched this topic for days but nothing seems to exactly cover my particular question with the space that I have.
I am running Linux mint 20 and have recently unmounted and deleted my windows partition in Gparted, which left me with approx 152G of unallocated space, which I want to add/merge with my Linux partition. I am concerned I may do something wrong. Please keep it simple for this pensioner. Image of Gparted screen below which is where I'm at. TIA
Edit: Partitions after successful resize operation
|
You need to boot from a Linux Live USB/CD with GParted to be able to resize your root partition since it is currently in use (see the key symbol).
You can boot from your Linux Mint USB stick or download a GParted Live CD/USB ISO and write that to a thumbdrive.
Then start GParted, select "/dev/sda7 Linux Mint", right click on "Resize/Move" and resize the partition to take all
unallocated space and confirm the operation. If the result looks as desired, click the checkmark in the top bar to apply all operations.
Since you deleted Windows, you may also delete the leftover "Microsoft reserved partition" and use that space too.
| expanding my linux mint partition to include unallocation partition |
1,534,811,933,000 |
I have Windows and Arch Linux installed in my system. I plan to increase the size of my root partition by shrinking the home partition using GParted live USB. But there is a swap partition between my root and home partition. I thought of shrinking the home partition and adding space to the swap and then shrink the swap then add it to the root since the unallocated space must be adjacent to the one being resized. I am not sure whether this going to work.
|
You can keep the size of the swap partition, you just need to move it:
Shrink the home partition, the freed space is now between swap and home.
Move the swap partition, so that the freed space is between swap and root partition.
Increase root partition.
| How to increase root partition size by shrinking home partition using gparted live usb? |
1,534,811,933,000 |
So my dilemma is that my Ubuntu installation is on the last partition. Here is a screenshot of GParted.
Also on a hdd. Not sure if it makes a difference.
|
You won’t be able to resize the partition that you are current running in - it appears here that you’re booted into the Linux install that’s running on /dev/sda5? If that’s the case, you can boot a liveCD or a USB installer, so that all of the partitions on /dev/sda are unmounted. Once unmounted and booted from a liveCD you should be able to extend/resize those partitions into the unallocated space.
| I am on Ubuntu. How do I expand last partition in GParted? |
1,534,811,933,000 |
I have transferred the whole 64 gb sd-card to a 128 gb sd card. the 64gb sd card is from a Raspberry Pi 4 and contained 5 partitions. I used this command: dd if=/dev/mmcblk0p of=/dev/sdb after the process finished I inserted the 128gb sd card and the Raspberry is working fine. However, there are now 64gb of "unallocated" disk space on the sd card.
My guess was to expand the partition, which I attempted using gparted. But I cannot resize the partition as the option to do so is greyed out. I also tried this command resize2fs /dev/mmcblk0p7 - mmcblk0p7 being the root partition - which has this output: The filesystem is already 15500800 (4k) blocks long. Nothing to do!
How can I expand the root partition to use the as yet unallocated diskspace?
#fdisk -l
Disk /dev/mmcblk0: 119.1 GiB, 127865454592 bytes, 249737216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xb134d0fd
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 8192 137215 129024 63M e W95 FAT16 (LBA)
/dev/mmcblk0p2 137216 124735487 124598272 59.4G 5 Extended
/dev/mmcblk0p5 139264 204797 65534 32M 83 Linux
/dev/mmcblk0p6 204800 729085 524286 256M c W95 FAT32 (LBA)
/dev/mmcblk0p7 729088 124735487 124006400 59.1G 83 Linux
|
Here are the commands needed :
echo ", +" | sfdisk --force -N 2 /dev/mmcblk0 # Extend the extended partition to maximum
echo ", +" | sfdisk --force -N 7 /dev/mmcblk0 # Extend the partition p7 to maximum
Then run resize2fs
http://man7.org/linux/man-pages/man8/sfdisk.8.html
Do a full backup, and verify it, before you run those commands.
| How can I expand my ext4 filesystem after transfering via dd |
1,534,811,933,000 |
I have the following /etc/fstab entry which fails to execute at system boot/startup:
/dev/sdb1 /media/ssd256 ext4 rw,user,exec,umask=000 0 0
Doing
sudo mount -a
yields:
mount: /media/ssd256: wrong fs type, bad option, bad superblock on /dev/sdb1, missing codepage or helper program, or other error.
However, if I sudo gparted and mount via its UI, then the device is mounted.
I am not sure how to fix this issue.
EDIT:
I changed the options to use defaults instead of rw,user,exec,umask=000, now sudo mount -a also works.
The question now is: what is wrong with my initial options?
|
This is why...
dmesg | tail will show:
EXT4-fs (dm-4): Unrecognized mount option "umask=000" or missing value
Indeed, the umask option is not part of the accepted options for the ext4 file system : see man mount.
| Can only mount with gparted |
1,534,811,933,000 |
I run a dual-boot system, and the Linux distro is Ubuntu 14.04.
I have used GParted to enlarge a logical partition, named /dev/sda6, on which the /home directory is normally mounted. According to the GParted report the operation has been completed successfully. The partition is 85 GiB large, of which 83GiB used and 2 GiB free(d), as intended.
However this comes about with two oddities:
This gain is not recognized after logging in.
As I check the disk usage with df -h, the report says that the partition /dev/sda6, duly mounted on /home, has a size of 85 GiB, of which 83 are used and 0 are available. The use is claimed to be 100%.
Another oddity is that I can regularly log into my user profile through the graphical user interface. After the credentials are recognized, though, the system stalls and it doesn't splash into the desktop environment.
In order to get the df -h information, I need log in either with my regular identity in any text terminal or with the guest status in the graphic user interface. As a side remark, it doesn't look like data have been corrupted.
How can I fix this situation? The aim is to get the size increase of the partition fully available to the operating system. Thanks for helping me out.
|
You are probably using one of the ext filesystems (the default linux filesystem, usually ext4). Most of the time, when created, it will be created with a specific buffer called reserved blocks.
This reserved space is meant to be only writable by system processes and root and therefor protect the OS from the disk filling by users.
The main purpose of df is to show the amount of disk space available out of a grand total. While it also shows the space used (by user), it doesn't do so with this reserved space.
This buffer is by default 5% of the whole disk. You can check if you have such a buffer with sudo tune2fs -l /dev/sda6 | grep Reserved.
By typing sudo tune2fs -l /dev/sda6 | grep [bB]locks one can also read both the number of reserved blocks and the block size (in B), hence determine the space of the partition taken up by this construction.
This would explain the system seeing 85GiB, but only 83 used and 0 free.
If you really want, you can set the buffer to a lower value with sudo tune2fs -m 2 /dev/sda6 (2 being an example value in percentage, which by default would be 5).
The better option would be to actually resize so enough disk space is free to be safe. 2GiB of 85GiB is only 2,35%, which isn't a lot and in most cases would fill up relatively fast. If you are sure your space usage will stay stable at 83GiB, then you can use tune2fs to reserve 0% of space for safety, but as soon as your disk fills up then (to 85GiB), you will not be able to log in at all and the machine will probably crash and be harder to repair.
The 5% safety margin is a relatively sane one. So, in this case, I'd make the partition at least 90GiB, but probably even 100 or more, just to have some space to spare for emergencies. Disk space is cheap, your time repairing the problems stemming from a filled-up disk is probably more expensive.
The answers to this question give some more insight into the reasoning.
| Reserved-blocks issue: partition size successfully changed but not recognized by the OS |
1,534,811,933,000 |
I finished the Arch Linux install successfully and installed GNOME. But I think I made my partitions too small:
Disk /dev/sda: 232.9 GiB, 250059350016 bytes, 488397168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xd96cc977
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 125831167 125829120 60G 83 Linux
/dev/sda2 125831168 134219775 8388608 4G 83 Linux
/dev/sda3 134219776 201328639 67108864 32G 83 Linux
My HDD is 250Gb, but that's just advertised, so I'm going to dumb it down to 230Gb. That being said I can add a lot more data to my SDA's. I installed GParted on a DVD so I can do so.
I never used this program before, so I want to know is, is it possible to grow the partitions, and if so, how can I do it?
|
Resizing partitions into the free space after them works pretty well with gparted. Of course you should have a backup for safety, especially when you're not experienced with the procedure. As far as I remember, gparted offers to resize the filesystem after you've resized the partition, that would be the easiest way. If it doesn't, "resize2fs" is the command that you'd use.
| Can I Grow A Linux Partition After Making It & Not Lose Data? |
1,456,367,661,000 |
I have a hard drive that came out of an old Windows PC, which I'm using as a second hard drive. Because it was already formatted as ntfs, I didn't want to reformat it and lose all the data on it, so I just used it as one would a USB drive. I have to get nautilus to mount it every time I log in.
However, the partition with my stuff on it is only using about 330GB of the 700gb on the drive -- the rest is unallocated.
Screenshot of the drive in gparted:
Is there a way to expand this partition to fill the drive without wiping the drive? I have a hunch that I won't be able to get it to use the 200-odd mb before the partition; only expand to fill the space after. Is this correct?
I found mention of a program called Ease US that claims to be able to do this, but it only runs on Windows. It looks pretty similar to GParted, though, so I'm hoping GParted can do the same thing. I'm just too afraid to play around with it for fear of nuking my drive.
|
You can definitely expand an ntfs partition with gparted. Ensure you have ntfsprogs installed (yum/dnf/apt-get install) first.
You can right click /dev/sda2 in that list and click rezize/move and go from there. Move the slider as needed to fill in the space.
You might be able to grab up the first 200MB of the drive too with that option, but I've never had to do it myself, so I can't speak from experience.
| Expanding a hard drive partition to fill the drive without wiping the partition? |
1,456,367,661,000 |
Sometimes but not often, but many times, after formatting an SD card with Gparted, the SD card becomes unaccessible to normal user, so I go as root and change the permissions, happens especially when changing the file system from say Fat32 to Ext4. Reformatting doesn't help. Does Gparted changes the permissions on disk? If yes why? If no then why it happens to me? I used other tools, only gparted seems to do that.
|
If you are using mkfs.ext4, you have to pass -E root_owner=your_uid:your_gid, this is usually passed in an 'extra options' textbox in gui partition tools. If you dont do this (< mkfs 1.42) then the person running the gui tool will get the permissions. Nowdays, for security, it assigns them to root:root (0:0). If you ever go back to fat32 or ntfs, you should be aware that their mkfs tools work differently*
fat32 partitions need the option uid=your_uid,gid=your_gid (usually 1000) when mounted if you want to access them. You can use permissions with NTFS, but it requires you to specify 'permissions' as a mount option (the -o switch).
| Does Gparted change permissions? |
1,456,367,661,000 |
Xubuntu 12.10
XFCE with Greybird theme
Hello,
this is my GParted screenshot:
Could anyone please give my any advice on how to make changes to have more space available for use in Linux? Let's say I manage to take 10 GB out of the /dev/sda3 partition which is currently formatted in ntfs, how would I proceed then?
|
To have more space for your Linux installation you need to expand sda6. Having freed up 10GB by shrinking sda3 you would then expand sda4 by 10GB and expand sda6 to fill up all of sda4.
However, resizing existing partions, especially NTFS ones, always bares the risk of loosing all data on that partition! I don't know anybody who ever experienced loss of data, but there is always that risk, so better prepare a backup first.
| How should I partition my hard drive? |
1,456,367,661,000 |
I was trying to Linux Mint from live-usb and made a stupid mistake.
I created master boot record and my HDD partition become unallocated.
After rebooting from live OS, I'm unable to get to boot menu.
Is there any way to recover all my data? Right now I can only boot to live-usb.
|
First, to avoid messing up, you should backup an entire image of the disk (provided you have a bigger disk to store it). For this, several solutions are proposed on this question, last time i did it, I used dd. Once you are sure you can restore the image in case of problem, you can use testdisk to redetect the partition table and fix it.
This question for instance provides a solution.
| gparted partition master boot record corrupt |
1,456,367,661,000 |
I need to move a Pop-OS installation from a 250GB HDD to a 128GB SSD. So far I have been trying to use GParted (which worked for moving my Ubuntu installation between drives of the same size).
The recovery and boot partitions copied properly, but to copy the main (root) partition I need to shrink it first (there is enough space). Using GParted to try and shrink it seems to do something for a while, but then errors at the same point (judging by the progress bar) each time. (The title is not related to this problem to try and avoid A/B problem).
I have tried running the e2fsck command written in the GParted details file, and rebooting the machine. None of these have made the shrink work. Without the partition shrink, I don't know how I can move the installation to the smaller drive.
Below is the gparted_details.htm contents generated by the error.
Any and all ideas on how I can move the OS are appreciated.
GParted 1.3.1
configuration --enable-libparted-dmraid --enable-online-resize
libparted 3.4
========================================
Device: /dev/nvme0n1
Model: CT1000P5PSSD8
Serial:
Sector size: 512
Total sectors: 1953525168
Heads: 255
Sectors/track: 2
Cylinders: 3830441
Partition table: gpt
Partition Type Start End Flags Partition Name Filesystem Label Mount Point
/dev/nvme0n1p1 Primary 34 32767 msftres Microsoft reserved partition unknown
/dev/nvme0n1p2 Primary 32768 819232767 msftdata Basic data partition ntfs New Volume
========================================
Device: /dev/nvme1n1
Model: RPFTJ128PDD2EWX
Serial:
Sector size: 512
Total sectors: 250069680
Heads: 255
Sectors/track: 2
Cylinders: 490332
Partition table: gpt
Partition Type Start End Flags Partition Name Filesystem Label Mount Point
/dev/nvme1n1p1 Primary 2048 250068991 ext4 /
========================================
Device: /dev/sda
Model: ATA CT250MX500SSD1
Serial: 2013E298798B
Sector size: 512
Total sectors: 488397168
Heads: 255
Sectors/track: 2
Cylinders: 957641
Partition table: gpt
Partition Type Start End Flags Partition Name Filesystem Label Mount Point
/dev/sda1 Primary 2048 1050623 boot, esp EFI System Partition fat32 /boot/efi
/dev/sda2 Primary 1050624 1083391 msftres Microsoft reserved partition ext4
/dev/sda3 Primary 1083392 487322748 msftdata Basic data partition ntfs
/dev/sda4 Primary 487323648 488394751 hidden, diag ntfs
========================================
Device: /dev/sdb
Model: ATA ST31000528AS
Serial: 5VP2CLXV
Sector size: 512
Total sectors: 1953525168
Heads: 255
Sectors/track: 2
Cylinders: 3830441
Partition table: msdos
Partition Type Start End Flags Partition Name Filesystem Label Mount Point
/dev/sdb1 Primary 63 1953520127 boot ntfs ExtDisk
========================================
Device: /dev/sdc
Model: ATA ST500DM002-1BD14
Serial: Z2AXE6DG
Sector size: 512
Total sectors: 976773168
Heads: 255
Sectors/track: 2
Cylinders: 1915241
Partition table: msdos
Partition Type Start End Flags Partition Name Filesystem Label Mount Point
/dev/sdc1 Primary 2048 976769023 ntfs stuff
========================================
Device: /dev/sdd
Model: ATA WDC WD2500BEVT-7
Serial: WD-WXR1A60R1236
Sector size: 512
Total sectors: 488397168
Heads: 255
Sectors/track: 2
Cylinders: 957641
Partition table: gpt
Partition Type Start End Flags Partition Name Filesystem Label Mount Point
/dev/sdd1 Primary 4096 2097150 boot, esp fat32
/dev/sdd2 Primary 2097152 10485758 msftdata recovery fat32
/dev/sdd3 Primary 10485760 480004462 ext4
/dev/sdd4 Primary 480004464 488393070 swap linux-swap
========================================
Device: /dev/sde
Model: USB DISK
Serial:
Sector size: 512
Total sectors: 15730688
Heads: 255
Sectors/track: 2
Cylinders: 30844
Partition table: msdos
Partition Type Start End Flags Partition Name Filesystem Label Mount Point
/dev/sde1 Primary 8192 15728639 ntfs NTFS /media/yee/NTFS
/dev/sde2 Primary 15728640 15730687 lba fat16 UEFI_NTFS /media/yee/UEFI_NTFS
========================================
Shrink /dev/sdd3 from 223.88 GiB to 107.42 GiB 00:11:10 ( ERROR )
calibrate /dev/sdd3 00:00:02 ( SUCCESS )
path: /dev/sdd3 (partition)
start: 10485760
end: 480004462
size: 469518703 (223.88 GiB)
check filesystem on /dev/sdd3 for errors and (if possible) fix them 00:00:15 ( SUCCESS )
e2fsck -f -y -v -C 0 '/dev/sdd3' 00:00:15 ( SUCCESS )
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
527061 inodes used (3.59%, out of 14680064)
962 non-contiguous files (0.2%)
411 non-contiguous directories (0.1%)
# of inodes with ind/dind/tind blocks: 0/0/0
Extent depth histogram: 502974/140
24348903 blocks used (41.49%, out of 58689837)
0 bad blocks
15 large files
454992 regular files
45072 directories
15 character device files
1 block device file
7 fifos
4994 links
26959 symbolic links (23910 fast symbolic links)
6 sockets
------------
532046 files
e2fsck 1.46.5 (30-Dec-2021)
shrink filesystem 00:10:53 ( ERROR )
resize2fs -p '/dev/sdd3' 112640000K 00:10:53 ( ERROR )
Resizing the filesystem on /dev/sdd3 to 28160000 (4k) blocks.
Begin pass 2 (max = 10272100)
Relocating blocks XXXXXXXX--------------------------------
resize2fs 1.46.5 (30-Dec-2021)
resize2fs: Attempt to read block from filesystem resulted in short read while trying to resize /dev/sdd3
Please run 'e2fsck -fy /dev/sdd3' to fix the filesystem
after the aborted resize operation.
|
Solution is simple:
Don't shrink the partition and copy it.
Instead, make a new partition on the target SSD, and copy over the files from the old partion. There's no reason why you couldn't do that – and it's both easier and safer.
| Moving Pop-OS installation to a smaller drive (using GParted?) |
1,456,367,661,000 |
I have a SD card that is giving me some trouble.
I followed some instructions from here https://forums.linuxmint.com/viewtopic.php?t=368230 and used the command
sudo dd if=/dev/zero of=/dev/sdb bs=1M count=1
(I know this is dangerous. i've done it because the card was really cheap, and I suspect it is bogus). it ran without errors, but now my system doesnt recognize the card anymore. Gparted and lsblk can't find it (they don't return any sdb). running 'sudo dmesg -w' gives me this:
[ 6333.845914] sd 2:0:0:0: [sdb] 1048780800 512-byte logical blocks: (537 GB/500 GiB)
[ 6333.846242] sd 2:0:0:0: [sdb] Write Protect is off
[ 6333.846249] sd 2:0:0:0: [sdb] Mode Sense: 2f 00 00 00
[ 6333.846572] sd 2:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[ 6333.851162] sd 2:0:0:0: [sdb] Attached SCSI removable disk
[ 6334.376852] exFAT-fs (sdb): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[ 6334.916786] exFAT-fs (sdb): error, invalid access to FAT (entry 0x00000007) bogus content (0x3eac7bca)
[ 6334.916798] exFAT-fs (sdb): Filesystem has been set read-only
[ 6334.916802] exFAT-fs (sdb): failed to initialize root inode
[ 6342.202999] exFAT-fs (sdb): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[ 6342.767908] exFAT-fs (sdb): error, invalid access to FAT (entry 0x00000007) bogus content (0x3eac7bca)
[ 6342.767925] exFAT-fs (sdb): Filesystem has been set read-only
[ 6342.767930] exFAT-fs (sdb): failed to initialize root inode
[ 6365.545658] sdb: detected capacity change from 1048780800 to 0
So i'd like to know if it still can be saved. to be honest, being unable to fix it bugs me more than losing the card itself. i'm sure some of you share this feeling sometimes :)
I'm in Debian Testing/Bookworm
thanks in advance!
EDIT: as suggested by zomega, I tried modprobe usbmon + wireshark. i just don't understand much of it
Frame 22971: 71 bytes on wire (568 bits), 71 bytes captured (568 bits) on interface usbmon0, id 0
Section number: 1
Interface id: 0 (usbmon0)
Interface name: usbmon0
Encapsulation type: USB packets with Linux header and padding (115)
Arrival Time: Jan 24, 2023 08:28:54.570098000 -03
[Time shift for this packet: 0.000000000 seconds]
Epoch Time: 1674559734.570098000 seconds
[Time delta from previous captured frame: 0.099905000 seconds]
[Time delta from previous displayed frame: 0.099905000 seconds]
[Time since reference or first frame: 233.430201000 seconds]
Frame Number: 22971
Frame Length: 71 bytes (568 bits)
Capture Length: 71 bytes (568 bits)
[Frame is marked: False]
[Frame is ignored: False]
[Protocols in frame: usb]
USB URB
[Source: 1.2.1]
[Destination: host]
URB id: 0xffff9197d7386480
URB type: URB_COMPLETE ('C')
URB transfer type: URB_INTERRUPT (0x01)
Endpoint: 0x81, Direction: IN
1... .... = Direction: IN (1)
.... 0001 = Endpoint number: 1
Device: 2
URB bus id: 1
Device setup request: not relevant ('-')
Data: present ('\0')
URB sec: 1674559734
URB usec: 570098
URB status: Success (0)
URB length [bytes]: 7
Data length [bytes]: 7
[Request in: 22970]
[Time from request: 0.099905000 seconds]
[bInterfaceClass: Unknown (0xffff)]
Unused Setup Header
Interval: 1
Start frame: 0
Copy of Transfer Flags: 0x00000204, No transfer DMA map, Dir IN
.... .... .... .... .... .... .... ...0 = Short not OK: False
.... .... .... .... .... .... .... ..0. = ISO ASAP: False
.... .... .... .... .... .... .... .1.. = No transfer DMA map: True
.... .... .... .... .... .... ..0. .... = No FSBR: False
.... .... .... .... .... .... .0.. .... = Zero Packet: False
.... .... .... .... .... .... 0... .... = No Interrupt: False
.... .... .... .... .... ...0 .... .... = Free Buffer: False
.... .... .... .... .... ..1. .... .... = Dir IN: True
.... .... .... ...0 .... .... .... .... = DMA Map Single: False
.... .... .... ..0. .... .... .... .... = DMA Map Page: False
.... .... .... .0.. .... .... .... .... = DMA Map SG: False
.... .... .... 0... .... .... .... .... = Map Local: False
.... .... ...0 .... .... .... .... .... = Setup Map Single: False
.... .... ..0. .... .... .... .... .... = Setup Map Local: False
.... .... .0.. .... .... .... .... .... = DMA S-G Combined: False
.... .... 0... .... .... .... .... .... = Aligned Temp Buffer: False
Number of ISO descriptors: 0
Leftover Capture Data: 0200ff0f000000
|
When a card suddenly changes to 0 capacity, that's not under the control of your PC: that's the controller within the SD card stopping to work.
Since you have no way of debugging the software running on that controller, nor any way to look inside its hardware:
Your card is e-waste. That was essentially clear when you said "I suspect it is bogus", as a data storage medium which you can't trust is worse than none.
| unable to find or mount sd card |
1,456,367,661,000 |
I am using the Live version of Kali Linux and now I'm realizing that having persistence might be a good idea. There are some tutorials out there showing how it can be done on Windows and it looks easy with tools like Rufus. However the thing is that I have a Multiboot USB containing some other ISOs like one for a live GPARTED distro that allows me to resize all partitions on my computers. For this setup, I am using a tool called Ventoy. Now, Ventoy does support persistence as written here but the instructions were rather difficult for me to follow. I was wondering if I could simply partition the drive myself into two volumes: one for ventoy + GPARTED + Kali and the other for the live Kali persistence? What extra would I need to put in the second (persistence) partition to tell Kali to use that space for its persistence storage?
What would be the best way of going about this. What I finally want is a multiboot USB with two ISOs: one for GPARTED, one for live Kali + persistence, quite possibly in two partitions (or more if required). Any thoughts?
|
Ventoy is a fantastic option, and it sounds like you might be halfway there already with setting up a drive. Have you tried Ventoy's configuration tool, Plugson? It's browser-based and runs on your local machine, providing a point-and-click configuration for some of the trickier stuff, like persistence files.
Ventoy's partition layout is pretty specific, I wouldn't mess with it after the drive is configured. Persistence is stored in separate flat files, not another partition.
I cannot speak to other approaches, but the official Kali linux docs roaima suggested would probably be a good place to start.
| Is it possible to create a MULTIBOOT USB with Kali + persistence? |
1,456,367,661,000 |
How do I extend the size of /dev/sda5 using the unallocated space on the top? I've tried using the resize/move option directly but can't do that because the partition is mounted and it can't be unmounted since it is the only partition. I tried swap-off and then increasing the size of swap. And it didn't work either.
|
Boot in a live usb and extend the partition. While it should work fine, better have a backup. You cannot extend ext4 foward (to leading empty space) on-line.
| How to extend partition size without losing data? |
1,456,367,661,000 |
I have a wokring image file for an ARM embedded Linux system.
The rootfs partition is way too big and I want to shrink it.
Initial scenario:
Disk /dev/loop0: 7,22 GiB, 7744782336 bytes, 15126528 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000
Device Boot Start End Sectors Size Id Type
/dev/loop0p1 * 2048 206847 204800 100M c W95 FAT32 (LBA)
/dev/loop0p2 206848 12789759 12582912 1G 83 Linux
/dev/loop0p3 12789760 12810239 20480 10M a2 unknown
The second partition (rootfs) is the one to be reduced.
I opened /dev/loop0 with gparted and reduced it to 1G.
Then I tried to move the third partition (I don't know that it is nor what contains) just after the previous - otherwise it makes non sense at all!
But gparted told me that moving this partition might prevent the os to boot.
As far as I know, only the "boot" partitions (i.e. the first ones) are critical for boot itself.
Why moving the third one might prevent the boot?
|
This is probably because the partition type is a2.
A2 Hard Processor System (HPS) ARM preloader
This partition type is used for bootable images of ARM-type computers.
For a normal Linux system that uses an x86, you should be able to delete this partition.
----edit----
Because this is ARM, it is the preloader image. It is a number of 64K blocks used as first stage boot loader. Whether or not you can move it, depends a bit on your board. Some boards use the partition table to find a type 42 image partition.
The preloader is used as an intermediate step between the bootrom and the boot loader, so it runs before Linux is booted.
| Moving the third partition might prevent the boot of os |
1,456,367,661,000 |
df -i report 96% left, df report 0% left (but 609M available), gparted report 18.55G left
All for the same partition
Is there any space left?
df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/sdx0 23419200 705376 22713824 4% /home
df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sdx0 370150344 350620020 705948 100% /home
|
For an ext4 filesystem it looks good to me.
Disk space available: 353 GiB
Disk space used: 334.3 GiB
Actual remaining disk space: 18.7 GiB
The extN filesystems reserve 5% for root access, so that when users fill up the filesystem there's still a little left for the system, and for housekeeping and filesystem maintenance.
5% of available disk space: 353 * 5% = 17.7 GiB
Total effectively available disk space: 353 * 95% = 335.4 GiB
Effectively remaining disk space: 335.4 - 334.3 = 1.1 GiB, i.e. it's near enough full
The remaining difference between my 17.7 GiB and parted's 18.63 GiB is just under 1 GiB, which could conceivably be explained as filesystem overhead for the metadata (directory structures, etc.)
I would assume that the "603.5 MB free" message may creep upwards towards my theoretical 1.1 GiB a little once you've emptied the "trash" folder, but basically as far as (non-root) users are concerned the disk is full as evidenced by the 100% shown in your output from df:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sdx0 370150344 350620020 705948 100% /home
Given that this isn't the root filesystem, you might want to consider reducing the 5% reservation down to, say, 2%. Here's how I might do it for a filesystem here:
tune2fs -l /dev/sda1 | grep -i 'block count'
Block count: 1572608
Reserved block count: 78630
awk 'BEGIN { print int( (78630 * 100) / 1572608 +.5 ) }' # Current %
5
tune2fs -m 2 /dev/sda1 # Change reservation %
tune2fs 1.43.4 (31-Jan-2017)
Setting reserved blocks percentage to 2% (31452 blocks)
Confirm that we have what we expect
tune2fs -l /dev/sda1 | grep -i 'block count'
Block count: 1572608
Reserved block count: 78630
awk 'BEGIN { print int( (31452 * 100) / 1572608 +.5 ) }' # New %
2
| df gparted space left [closed] |
1,456,367,661,000 |
After a failed resizing operation, mount operation is failing with:
Failed to read last sector (718198764): Invalid argument
The partition is not accessible with Gparted and other GUI tools. How can we fix such issue?
|
Analyse
ntfsfix -n /dev/sda5 the n parameter will make the tool output the repair solution without applying it (be very prudent using such tool as automated repair tools can choose the wrong decision to repair the partition)
ntfsresize -if /dev/sda5 this will tell us what's going on exactly...
Backup
First thing first before doing anything a full image backup is recommended... otherwise just backup the partition table with
sfdisk -d /dev/sda > sda.partition.table.txt
Explanation
In this particular case Failed to read last sector (345345...) this mean that the partition is bigger than what's indicated on the partition table, this can happen when the partition is resized (shrinked) without shrinking the file-system (ntfs here)... the solution is to revert the resize (on the partition table)...
Note that ntfsfix may guess the good old value and restore it BUT the tool can also guess a wrong value and make you loose part/all of your datas... if the partition can be mounted after the repair that does not mean you did not lost any datas especially when chkdsk is correcting a lot of errors...
Solution
Backup the current partition table with sfdisk -d /dev/sda > sda.partition.table.txt
Failed to read last sector (345345...) indicate that the real partition end sector is [start.sector]+[345345...] thus, we need to calculate the real end sector location by adding the start sector of the partition and the last sector shown on the error
Edit sda.partition.table.txt and replace the end sector with the new calculated one... (for the sda5)
Restore the partition table with sfdisk /dev/sda < sda.partition.table.txt
| Partition mounting/resizing failed to read last sector? |
1,456,367,661,000 |
I have a dual booted machine (Linux Mint 19.3 Cinnamon and Windows 10) and am looking to allocate space from Windows to Linux. I have already removed space from my C:\ and D:\ Drive without any issues, but I am having trouble extending my Linux Partitions. My Allocated space is BELOW the unallocated space. Here is a screenshot(It is as accurate as I could make it):
I would like to add the Unallocated Space above the "Linux Root" partition to the partition named "Linux Home." I would also like to add the unallocated space at the very bottom to "Linux Root."
|
First, backup your data.
Boot Linux from a Live USB (GParted or your Linux Mint 19.3 Cinnamon Live USB) and start GParted.
Instead of assigning the unallocated space at the bottom to "Linux Root", it's easier to use a part (~14GB?) of the unallocated space at the top.
Resize/move /dev/sda5 "Linux Root", grow the partition to the wanted size, i.e. if you enlarge the partition by 14 GiB, move the partition to the left side so you'll end up with about 50 GiB after "Linux Root":
...
/dev/sda3 Basic data partition
/dev/sda5 Linux Root 27.94 + 14 GiB
unallocated ~50 GiB
/dev/sda6 Linux Swap
/dev/sda7 Linux Home
/dev/sda4 Basic data partition
unallocated 14.65 GiB
Move /dev/sda6 "Linux Swap" to the left:
...
/dev/sda3 Basic data partition
/dev/sda5 Linux Root 27.94 + 14 GiB
/dev/sda6 Linux Swap
unallocated ~50 GiB
/dev/sda7 Linux Home
/dev/sda4 Basic data partition
unallocated 14.65 GiB
Move /dev/sda4 "Basic data partition" to the right:
...
/dev/sda3 Basic data partition
/dev/sda5 Linux Root 27.94 + 14 GiB
/dev/sda6 Linux Swap
unallocated ~50 GiB
/dev/sda7 Linux Home
unallocated 14.65 GiB
/dev/sda4 Basic data partition
Resize /dev/sda7 "Linux Home" to take up the unallocated space before and after the partition.
| Merge Allocated Space with Unallocated space in Gparted |
1,456,367,661,000 |
There seem to be many scenarios, I read quite a few, but I caould not find a match for my problem.
I have this gparted view on my system:
I had sda6 swap sit right behind sda5; I moved that sawp space to another disk. Then swapoff and deleted sda6; then extended sda5 to consume the free 8GB... all good so far.
These two (sda 5 and sda6) were in the same "extended" partition.
However, allocating the unallocated 256 GB does not work; as I cannot extended the sda3 partition.
My understanding is that the 0.25 version of gparted allows for online disk extending.
What options do I have?
Can this be done on a live system?
|
gparted and other partitioning software will be funny about extending logical partitions (those within the extended partition sda3) because the underlying extended partition would need to be extended first with the others still inside.
I suggest, you clone your disk to be safe, boot a live image and try gparted from there. If it still won't work, there's options:
Possibly use a lower level partitioning tool (fdisk, sfdisk, parted) which may give you more control
annotate the exact start and end locations (and types) of each logical partition (sda5 in this case)
delete sda3 and sda5
recreate the extended partition to take up as much space as you like, making sure it starts exactly where sda3 started (the new extended partition will also be called sda3)
recreate sda5 making sure it starts exactly where it did before
make sure all partitions are of the same type as before
And all your data will be where you expect it to be. You might need to extend the file system under sda5 but that's the easy bit.
These primary and extended and logical partition constructs are part of the old DOS disk label that originally supported only 4 partitions. Modern GPT disk labels don't have such limitations and there's no primary or extended partitions or partitions within partitions.
| Extending an extended partition with following unallocated disk space |
1,456,367,661,000 |
I'm on PopOS 19.10, and I try to create a partition on my new SSD (Crucial MX500, 1TB).
Note that it worked on Windows, I could create a NTFS partition, so from this base I admit my SSD is healthy (can I ?).
First I tried from GParted, but it gives me a warning: unrecognised disk label. I have to create a partition table, what I do, but it seems to do nothing. Then I try to create a partition, which I can't do because I have to create the partition table before...
So with some search I tried to use fdisk /dev/sdc. I typed n, p, then keep default values. With i I got what I want, a partition:
Partition 1 sélectionnée
Device: /dev/sdc1
Start: 2048
End: 1953525167
Sectors: 1953523120
Cylinders: 121602
Size: 931,5G
Id: 83
Type: Linux
Start-C/H/S: 0/32/33
End-C/H/S: 769/80/63
So I leave with w. But no partition was created, when I return to fdisk it doesn't show me any partition.
Then I tried with parted:
(parted) unit GB
(parted) mklabel msdos
(parted) mkpart primary ext4 0 500
(parted) print
Modèle: ATA CT1000MX500SSD1 (scsi)
Disque /dev/sdc : 1000GB
Taille des secteurs (logiques/physiques): 512B/4096B
Table de partitions : msdos
Disk Flags:
Numéro Début Fin Taille Type Système de fichiers Fanions
1 0,00GB 500GB 500GB primary ext4 lba
But as with fdisk nothing is done. When I redo parted, then print I got this:
(parted) print
Erreur: Impossible d'ouvrir /dev/sdc - étiquette de disque non reconnue. (= unrecognized disk label)
Modèle: ATA CT1000MX500SSD1 (scsi)
Disque /dev/sdc : 1000GB
Taille des secteurs (logiques/physiques): 512B/4096B
Table de partitions : unknown
Disk Flags:
I thought it may be a refresh issue, so I tried partprobe /dev/sdc without any change.
And of course restarted the computer.
I really don't know what to do...
Thank you for any help you could give !
|
I solved my issue. The fault was due to the SATA cable ! I just changed it and everything works fine now.
Thank you @Jonas Berlin @schweik for your helps !
| Cannot create partition on hard drive |
1,456,367,661,000 |
I'm trying to expand my main linux partition from a Debian install, /dev/sda1 into the 7gb unallocated free space. Normally I would just use the resize feature in GParted but because the free-space isn't alongside /dev/sda1 I can't. How can I expand my main partition without corrupting the partitions/losing data?
|
Back up your data.
Use a live USB system or similar and then from it:
Move the swap to the end of sda2.
Shrink sda2.
Enlarge sda1.
In fact there's no point in keeping the logical sda2 just for swap, so you might prefer to remove the swap and then sda2, and finally just build a new swap partition at the end and follow on with point 5.
| GParted - expand main Debian partition into freespace |
1,456,367,661,000 |
I have the following:
Western Digital 2 TB HDD (65GB used space)
Seagate 250 GB HDD (with nothing on it)
The 2 TB HDD has Mac OS X 10.6.8 that I need to clone onto the smaller drive in order to use it with a Mac Pro (A1186). I want to shrink the partition on the 2 TB drive via gparted and then use clonezilla to clone that partition along with the boot partition onto the 250 GB HDD. When I open gparted terminal shows an error that says it only supports 512 bytes length sector and gparted shows the partition with a caution exclamation mark that indicates it can not read the contents of the drive. Mounting the drive allows gparted to read the contents and tells me how much used/free space I have but I can't shrink the partition while its mounted. So how do I go about shrinking the partition ensuring both HDDs have the same byte sector size and cloning it to the other drive in order to make it bootable?
Please see images that show gparted with drive unmounted and with the drive mounted.
Terminal states: "the sector sized stored in the journal is not 512 bytes. Parted only supports 512 bytes length sectors"
|
You can restore the drive with DiskUtility in Snow Leopard, no shrinking needed.
Erase the 250GB as "Mac OS Extended (Case-sensitive Journaled)" (or without "Case-sensitive")
Right-click "Restore" on the 2TB, choose source and destination (drag the partitions into the fields), click "Restore".
Finished
| How do I clone a 2 TB HDD onto a 120 GB HDD (shrink partition using gparted) |
1,456,367,661,000 |
I have the following setup:
sda7 is my /home (Linux Mint) that I want to merge with sda8 (which I cut out of Windows). I read here that I can't combine two partitions that are not adjacent and that they can't be both extended. Is this true? If so, should I convert one of them into something else? I have no option to drag any of them with a mouse.
|
Here's a high-level overview for how to get some unallocated space you can use for sda7.
Get the contents of sda8 and add them into sda7.
Delete sda8.
In the unallocated space where sda8 was, create a new Linux swap partition; The same size as the one you already have.
Delete the "old" Linux swap partition, sda6.
That should allow you to drag sda5 and sda7 to the left, freeing up space after sda7. Then you can extend sda7 to consume the remaining free space.
| How do I merge two ext4 partitions? |
1,456,367,661,000 |
I want to duel boot windows and Ubuntu, however i don't want anything on windows to be able to access my Linux partition. Is there anyway to do this without encryption? As i don't want to slowdown read/write times on my Linux system.
|
You have 2 options, to stop deletion.
Separate hard-disks, and hardware switches.
If you want to do it with the same hard-disk, then you will need some virtualisation software to run under MS-Windows.
There is no other way, as MS-Windows is an operating system, it can do what ever it wants with the hardware.
To stop read, then you can use encryption (your solution).
| Protect linux partition from windows |
1,456,367,661,000 |
I installed Fedora 28. But I resized the partition that contained Fedora (/dev/sda7) wrongly using GParted and now I can't boot my system. (Note the partition format is ext4)
|
Resizing a partition does not implicitly resize any filesystem it might contain. You should have shrunk the filesystem and then shrunk the partition. (I'm surprised gparted didn't warn you.)
However, to try and fix the damage, resize the partition back to whatever it was before. If you're not sure of the value then make sure it's at least the size it was before.
If you have already used the space then all bets are off, unfortunately. You might get some of your files back with a filesystem rescue tool. Or you might not.
| ext4 partition is broken during resizing with gparted |
1,456,367,661,000 |
I'm sorry for asking something as elementary, but the information is very confusing and, even when there are ISO recommendations, not everybody follows them.
The manufacturer says my laptop has "8GB DDR4 system memory" and I want to set a swap partition with EXACTLY that size + a small margin, but the version of gparted my distro uses (Ubuntu 16.04) requires me to enter a size in "MB".
To put things worse, that same gparted says my hard drive is "1000204 MB" in size whereas the manufacturer says "1 TB" and I have tried to derive from that the exact definition Ubuntu is using of a MB but without success.
|
The command free -m will give you the size in MiB (2^20 bytes per MiB) and the command free -mega will give you the size of your RAM in MB (10^6 bytes per MB) There are other options: man free
You will probably want MiB for gparted, as it doesn't use MB. An alternative to using gparted is to create a swapfile. That may be more convenient a guide by digital ocean
Perhaps you should finally note that on a system with 8GB of ram, you probably won't need much swap (though it depends on what you do with your computer). There is no general reason that the swap size should match the physical memory size exactly or even roughly. This is discussed elsewhere.
| How to conver each GB "manufacturer" RAM to the EXACT MB equivalent gparted uses? |
1,456,367,661,000 |
I resized a FAT filesystem. Then the filesystem stopped working as a Windows 10 Recovery Drive. ("This may be due to a recent change in your hardware or software..."). And a running Windows is unable to open the filesystem, when it could before.
Resize tool: gparted-0.27.0-1.fc25.x86_64 (Fedora 25)
The resize was performed on a disk image file, copied from a USB drive as a backup. gparted was run on a loop device created from the image file using losetup -f -P. (Or later, Gnome Disks and "Attach Disk Image" from the... whatever you call the app-specific menu, in the top bar of gnome shell).
|
There is some defect in this gparted. Although Linux is able to mount the resulting filesystem (and the files compare identical to the original), file -s shows the following weirdness:
Before
/dev/loop0p1: DOS/MBR boot sector, code offset 0x58+2, OEM-ID "MSDOS5.0", sectors/cluster 8, reserved sectors 3310, Media descriptor 0xf8, sectors/track 63, heads 255, hidden sectors 2048, sectors 15114240 (volumes > 32 MB) , FAT (32 bit), sectors/FAT 14729, serial number 0x9a856b85, unlabeled
After
/dev/loop1p1: DOS/MBR boot sector; partition 2 : ID=0xb2, start-CHS (0x2f0,0,0), end-CHS (0x0,0,0), startsector 2944401408, 51 sectors; partition 4 : ID=0x65, start-CHS (0x0,0,0), end-CHS (0x163,118,41), startsector 1626349669, 2144852992 sectors
Clearly some part of the Windows 10 Recovery boot path accepts the weirdness - I guess the part where the EFI filesystem driver is used. Later code must use similar checks to a fully running Windows, and does not accept it.
In the case of a Windows 10 Recovery Drive for UEFI, this could be worked around simply by creating a smaller FAT filesystem and copying the files into it. (Yes, really :).
| Windows doesn't like resized FAT filesystem |
1,456,367,661,000 |
I need partitioning my USB stick into two parts.
Specifically my aim is to install Windows-to-go on the second partition and use the first one as a multiboot device for my Linux distros; these distros are already installed on it and so I prefer not to delete the current partition, if possible, so I would like to resize it only without affecting the files.
This is what I've been trying to do so far:
I inserted my USB stick, I could open and explore the files and even copypaste them on it, create folders and so on, so apparently it doesn't have any problem.
I run Gparted on Kali Linux and selected the device, it could see it but an exclamation mark appeared on it and when I right-clicked and tried to resize the current partition I couldn't do it.
By clicking on the exclamation mark I got the following errors (see the message into the grey window in the middle, it says that the device is not mounted ):
At the end of the message it also says that I probably miss two packages (dosfstools and mtools), then I run apt-get install to get them but it seems they are already installed.
Furthermore, on the terminal I run parted -l and fdisk -l and obtained the following outputs:
1) parted -l gives ->
Model: ATA ST1000LM024 HN-M (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 968GB 968GB primary ntfs boot
2 968GB 1000GB 32,2GB extended
5 968GB 999GB 30,9GB logical ext4
6 999GB 1000GB 1356MB logical linux-swap(v1)
Model: ATA INTEL SSDSC2CW06 (scsi)
Disk /dev/sdb: 60,0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 105MB 104MB primary ntfs boot
2 106MB 60,0GB 59,9GB primary ntfs
Model: KINGSTON DataTraveler 3.0 (scsi)
Disk /dev/sdc: 15,6GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Number Start End Size File system Flags
1 0,00B 15,6GB 15,6GB fat32
2) fdisk -l gives ->
Disk /dev/sdb: 60.0 GB, 60022480896 bytes
255 heads, 63 sectors/track, 7297 cylinders, total 117231408 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x26443af5
Device Boot Start End Blocks Id System
/dev/sdb1 * 2048 204799 101376 7 HPFS/NTFS/exFAT
/dev/sdb2 206848 117227519 58510336 7 HPFS/NTFS/exFAT
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0xfe2335fe
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 1890607103 945302528 7 HPFS/NTFS/exFAT
/dev/sda2 1890609150 1953523711 31457281 5 Extended
Partition 2 does not start on physical sector boundary.
/dev/sda5 1890609152 1950873599 30132224 83 Linux
/dev/sda6 1950875648 1953523711 1324032 82 Linux swap / Solaris
Disk /dev/sdc: 15.6 GB, 15552479232 bytes
64 heads, 32 sectors/track, 14832 cylinders, total 30375936 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x20ac7dda
This doesn't look like a partition table
Probably you selected the wrong device.
Device Boot Start End Blocks Id System
/dev/sdc1 ? 3224498923 3657370039 216435558+ 7 HPFS/NTFS/exFAT
/dev/sdc2 ? 3272020941 5225480974 976730017 16 Hidden FAT16
/dev/sdc3 ? 0 0 0 6f Unknown
/dev/sdc4 50200576 974536369 462167897 0 Empty
Partition table entries are not in disk order
|
From the above output (repeated below) the USB device does not contain a partition table. Instead the device is formatted entirely with the fat32 file system starting at 0. This means that no space was left at the start of the device for a partition table.
Model: KINGSTON DataTraveler 3.0 (scsi)
Disk /dev/sdc: 15,6GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Number Start End Size File system Flags
1 0,00B 15,6GB 15,6GB fat32
If you wish to work with devices without partition tables then use at least GParted v0.22.0. Currently the most recent version of GParted is 0.25.0.
| partitioning a usb stick with gparted |
1,456,367,661,000 |
Why am I getting inconsistent/conflicting pictures of the DATA partitions that were created in the CentOS 7 installation process when I use df -T -h, parted ... print, and fdisk -l? In case it matters, used xfs file system because that was the default.
The Background of the process is:
During a recent installation of CentOS 7, I chose Manual Partitioning in the Installation Destination part of the process. The tutorial in this link contains screen shots illustrating the installation process, and the screen in the process where the DATA partitions are created is shown below (from the same tutorial).
(source: tecmint.com)
In the above screen shot, my installation wizard automatically created a /home DATA partition. I shrunk the auto-created /home partition, and created four new 300 GB DATA partitions called /public, /vpn, /data, and /test using the screen shown in the screen shot, and I then completed the installation.
df -T -h results:
In the resulting installation, typing df -T -h results in:
[root@localhost ~]# df -T -h
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/centos-root xfs 50G 1016M 49G 2% /
devtmpfs devtmpfs 3.8G 0 3.8G 0% /dev
tmpfs tmpfs 3.8G 0 3.8G 0% /dev/shm
tmpfs tmpfs 3.8G 17M 3.8G 1% /run
tmpfs tmpfs 3.8G 0 3.8G 0% /sys/fs/cgroup
/dev/sda2 xfs 494M 139M 355M 29% /boot
/dev/mapper/centos-home xfs 605G 33M 605G 1% /home
/dev/sda1 vfat 200M 9.8M 191M 5% /boot/efi
/dev/mapper/centos-01 xfs 280G 33M 280G 1% /public
/dev/mapper/centos-02 xfs 280G 33M 280G 1% /data
/dev/mapper/centos-03 xfs 280G 33M 280G 1% /test
/dev/mapper/centos-00 xfs 280G 33M 280G 1% /vpn
**parted ... quit results:
However, parted does not seem to see the four new DATA partitions, as shown below:
[root@localhost ~]# parted
GNU Parted 3.1
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: ATA WDC WD20EZRX-00D (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 211MB 210MB fat16 EFI System Partition boot
2 211MB 735MB 524MB xfs
3 735MB 1912GB 1911GB
fdisk -l results:
The fdisk -l results seem to be a blend of the parted and df results shown above, but here treating the four new partitions as a separate category:
[root@localhost ~]# fdisk -l
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.
Disk /dev/sda: 2000.4 GB, 2000398934016 bytes, 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: gpt
# Start End Size Type Name
1 2048 411647 200M EFI System EFI System Partition
2 411648 1435647 500M Microsoft basic
3 1435648 3734071295 1.8T Microsoft basic
Disk /dev/mapper/luks-49495fd0-6120-48d9-915a-d88903765021: 1911.1 GB, 1911107354624 bytes, 3732631552 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/mapper/centos-swap: 8187 MB, 8187281408 bytes, 15990784 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/mapper/centos-root: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/mapper/centos-home: 649.2 GB, 649223733248 bytes, 1268015104 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/mapper/centos-00: 300.0 GB, 299997593600 bytes, 585932800 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/mapper/centos-01: 300.0 GB, 299997593600 bytes, 585932800 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/mapper/centos-02: 300.0 GB, 299997593600 bytes, 585932800 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/mapper/centos-03: 300.0 GB, 299997593600 bytes, 585932800 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
(parted) quit
|
It appears you chose to use logical volumes (LVM) rather than partitions. These are not partitions, and are managed using a different mechanism.
Try using an LVM command like sudo lvm lvs. This should list the logical volumes.
| why are DATA partitions not consistently reported in CentOS 7? |
1,456,367,661,000 |
I have a CentOS system that has 508 G free space.
I want to create a new partition from it.
It locates in extended partition.
I create new partition and format it as anything (ext4, fat32), after apply it can't finish the process and gives me this error:
An error occurred while applying the operations
See the details for more information.
IMPORTANT
If you want support, you need to provide the saved details!
See http://gparted.sourceforge.net/larry/tips/save_details.htm for more information.
and when I save the save_details.htm it contains this information:
GParted 0.6.0
Libparted 2.1
Create Logical Partition #1 (fat32, 508.23 GiB) on /dev/sda 00:00:01 ( ERROR )
calibrate New Partition #1 00:00:00 ( SUCCESS )
path: /dev/sda-1
start: 184424448
end: 1250263039
size: 1065838592 (508.23 GiB)
create empty partition 00:00:01 ( ERROR )
libparted messages ( INFO )
WARNING: the kernel failed to re-read the partition table on /dev/sda (Device or resource busy). As a result, it may not reflect all of your changes until after reboot.
WARNING: the kernel failed to re-read the partition table on /dev/sda (Device or resource busy). As a result, it may not reflect all of your changes until after reboot.
========================================
I used fdisk and created /dev/sda6, and I see partitions like this:
$ sudo fdisk -l
Disk /dev/sda: 640.1 GB, 640135028736 bytes
255 heads, 63 sectors/track, 77825 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0xa62a8bc3
Device Boot Start End Blocks Id System
/dev/sda1 * 1 262 2097152 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 262 5361 40960000 83 Linux
/dev/sda3 5361 10460 40960000 83 Linux
/dev/sda4 10460 77826 541113344 5 Extended
/dev/sda5 10461 11480 8192000 82 Linux swap / Solaris
/dev/sda6 11480 77825 532917056+ 83 Linux
Partition 6 does not start on physical sector boundary.
but when I use mkfs to format it I see this error:
$ sudo mkfs -t ext4 /dev/sda6
mke2fs 1.41.12 (17-May-2010)
Could not stat /dev/sda6 --- No such file or directory
The device apparently does not exist; did you specify it correctly?
What is the problem?
|
You Should inform kernel about the changes made to the disk. for that you need to run partprobe.
# partprobe /dev/sda6
Then you should run mkfs.ext4 to assign the filesystem to the newly created partition.
# mkfs.ext4 /dev/sda6
In this way your partition is ready to mount
# mount /dev/sda6 /mountpoint
| Can not create new partition |
1,679,997,093,000 |
What am I doing wrong?
I have an image, I added it as a loop device:
losetup -P /dev/loop13 ./my_image.img
gparted screenshot:
Then I try to change the FS size for the partition first:
e2fsck -f /dev/loop13p1
resize2fs /dev/loop13p1 7G
It outputs:
Resizing the filesystem on /dev/loop13p1 to 1835008 (4k) blocks.
The filesystem on /dev/loop13p1 is now 1835008 (4k) blocks long.
Then I shrink the section itself:
parted /dev/loop13p1 resizepart 1 7G
gparted screenshot:
After which I perform:
resize2fs /dev/loop13p1
Output
Resizing the filesystem on /dev/loop13p1 to 3659264 (4k) blocks.
The filesystem on /dev/loop13p1 is now 3659264 (4k) blocks long.
And it rolls back to the original value...
gparted screenshot:
UPD
I tried to reduce the partition via sfdisk and I succeeded, but now I don't understand why even more...
resize2fs -p /dev/loop13p1 7G
echo '2048,7G' | sfdisk /dev/loop13 -N 1
resize2fs /dev/loop13p1
Output:
The filesystem is already 1835008 (4k) blocks long. Nothing to do!
gparted screenshot:
|
In order to use parted correctly, you unfortunately have to do a little math sometimes.
parted /dev/loop13p1 resizepart 1 7G
This command probably does not do what you expect.
parted works with block devices that have partition tables on them. So in the case of /dev/loop13p1 it would be a partition table on a partition. Resizing partition 1 of that would mean you're trying to resize a (fictional) device like /dev/loop13-p1-p1.
You probably want to use /dev/loop13 here.
Then, resizepart 1 7G does not resize partition 1 to 7G of size.
The syntax for resizepart is resizepart NUMBER END. END, not SIZE.
So it moves the end point of partition 1 to the offset 7G. The size of the partition then depends on the start sector of partition 1. If the partition starts at 1MiB it would be 7G minus 1MiB large. Too small for a filesystem of 7G size.
Furthermore, for parted, G means GB (power of 1000) not GiB (power of 1024). So the unit itself can also be an additional source of confusion. If you resize to G when you meant GiB, the partition will be way too small.
Finally for new partition sizes to take, the kernel has to successfully re-read the partition table. Sometimes this fails if the device is in use etc. so always double check with lsblk, blockdev --getsize64, etc. or via head /sys/block/loop13/loop13p1/{start,size} what size the kernel currently believes it to be.
The filesystem on /dev/loop13p1 is now 1835008 (4k) blocks long.
1835008 * 4096 = 7516192768
So the partition must be 7516192768 bytes or larger.
# parted /dev/loop0 unit b print free
Model: Loopback device (loopback)
Disk /dev/loop0: 15032385536B
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1024B 1048575B 1047552B Free Space
1 1048576B 15032385535B 15031336960B primary ext2
Trying resizepart:
# parted /dev/loop0 resizepart 1 7G
Warning: Shrinking a partition can cause data loss, are you sure you want to continue?
Yes/No? Yes
# parted /dev/loop0 unit b print free
Model: Loopback device (loopback)
Disk /dev/loop0: 15032385536B
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1024B 1048575B 1047552B Free Space
1 1048576B 7000000511B 6998951936B primary ext2
7000000512B 15032385535B 8032385024B Free Space
After resizepart 1 7G the partition ends at (around) 7GB (7000000511B) which is way smaller than the required 7516192768B.
# parted /dev/loop0 resizepart 1 7GiB
Information: You may need to update /etc/fstab.
# parted /dev/loop0 unit b print free
Model: Loopback device (loopback)
Disk /dev/loop0: 15032385536B
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1024B 1048575B 1047552B Free Space
1 1048576B 7516192767B 7515144192B primary ext2
7516192768B 15032385535B 7516192768B Free Space
After resizepart 1 7GiB, the partition ends (around) 7GiB (7516192768 Bytes). This is closer but still too small since we have to consider 1 MiB (1048576B) offset.
So there is no easy command to get it right, you just have to do the math yourself.
# parted /dev/loop0 resizepart 1 $((1+7*1024))MiB
Information: You may need to update /etc/fstab.
# parted /dev/loop0 unit b print free
Model: Loopback device (loopback)
Disk /dev/loop0: 15032385536B
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1024B 1048575B 1047552B Free Space
1 1048576B 7517241343B 7516192768B primary ext2
7517241344B 15032385535B 7515144192B Free Space
Only then have we reached the desired partition size of 7516192768 Bytes.
| Change the size of the partition using parted |
1,679,997,093,000 |
I was using Windows 11 on my laptop but I wanted to install a Linux distro on the side.
Therefore, I've shrunk 30GB of the OS disk and I installed Pop_Os. During the installation process, I've created a EFI and root partitions.
I now wanted to extend the ext4 partition. I was able to shrink even more the original OS disk, but the unallocated space is shown on the left when using gParted and I'm unable to resize the root partition.
Below the gparted screenshots and fdisk outputs:
$ sudo fdisk -l /dev/nvme0n1
Disk /dev/nvme0n1: 476,94 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: WDC PC SN520 SDAPMUW-512G-1101
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 68C5B02D-2F6D-464B-AC15-BC33272E2AD7
Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 534527 532480 260M EFI System
/dev/nvme0n1p2 534528 567295 32768 16M Microsoft reserved
/dev/nvme0n1p3 567296 761978879 761411584 363,1G Microsoft basic data
/dev/nvme0n1p4 998166528 1000214527 2048000 1000M Windows recovery environment
/dev/nvme0n1p5 939532288 996937725 57405438 27,4G Microsoft basic data
/dev/nvme0n1p6 996937728 998166525 1228798 600M EFI System
Partition table entries are not in disk order.
Getting a bit out my comfort zone now :)
How should I proceed now to expand the partition?
|
You need to do the resize from a LiveCD -- the nvme0n1p5 partition is currently mounted. Ext4 can be resized when mounted, but only to the right -- resizing it to the left actually means copying/moving the data to the start of the free space and then resizing the partition and that cannot be done with an active (mounted) partition. So boot from a LiveCD (the Pop installation CD has GParted so you can use that) and use the GParted Resize/Move option to resize the partition. Don't forget to make a backup first.
| Extend partition created on laptop with Windows 11 and Pop OS |
1,679,997,093,000 |
I use a primarily windows system dual booted with my ubuntu 18.04
Since about 1 year, I was not able to boot up into ubuntu (initramfs prompt opens, and no solution I could find worked).
This original issue occurred after a BIOS update from windows.
So unable to solve the issue from grub directly, I decided to use boot-repair from a live USB. That is exactly what is did, and noticed the following irreguralities-
Boot-repair doesn't show any "recommended repair" option.
So boot-repair should look like this -
But it looks like this for me -
I am not able to detect any hdd partition whatsoever from the live USB boot. Things I tried-
Gparted
sudo fdisk -l (and loads of other similar commands)
All of them show the pendrive itself as the only partition /dev/sda1
Now, detecting the partitions was important because I was doing what boot-repair does without boot-repair. But that requires mounting on the ubuntu partition etc, which is basically non existent according to the commands/programs
Also, this does not imply that my ssd has vanished somehow xD because I later booted into windows which was completely fine with all the files intact, and so was the ubuntu partition, alive and healthy.
|
So i solved it myself, I had to change my ssd mode to AHCI in the BIOS Menu.
Boot repair worked fine, no boot issues anymore.
| Partitions not detected by ubuntu 18.04 live usb |
1,679,997,093,000 |
I want to take 20G from my /home and put it in my /. I logged into live installation drive and launched gparted.
The partitions look like this:
sda4 is root, sda5 is boot and sda6 my home partition.
If I click on sda6 and resize it from left to right I will get a warning that moving partition might cause your operating system to fail to boot and after that partitions look like this:
Now there is sda5(my boot partition) in the way and the only way is to move it to the right of my unallocated space like this:
Now I can merge unallocated space with root:
If I click apply will lgparted be able to generate new fstab or do I have to do it manually?
|
There's no need for gparted to generate a new /etc/fstab (it never does this anyway). You are not creating any new partitions or changing UUIDs, so you should be good to go.
That being said, that warning is posted for a reason: PLEASE have a system backup in case gparted crashes.
| increasing the size of root partition and reducing the size of home |
1,679,997,093,000 |
My configuration:
/dev/sdb2/ -> Windows 10 Partition
/dev/sdb4/ -> Ubuntu 18.04 Partition
I would like to decrease the Windows 10 partition and give that unallocated space to the Ubuntu 18 partition, but there is an EFI (boot, esp) partition between them. What is the best way to achieve this ?
|
Boot a Linux Live CD from USB and run gparted again. You can't resize your root partition while it is being mounted (the lock symbol).
Steps to do:
Resize the Windows partition "to the left", the freed space should be on the right side.
Move the ESP partition "to the left", so that the free space "is moved" from the left to the right side.
Resize the root partition.
| Is it safe to move this EFI partition? |
1,679,997,093,000 |
After hours of searching on the internet for answers, I still cannot unlock my root partition in GParted. I want to add 100gb unallocated space to my current /dev/nvme0n1p7 "fedora_localhost-live" 33gb partition. I am running dual boot fedora 31 on my Windows 10 device. Does anyone know what I am missing here?
I have done the following:
Created LiveUSB GParted
Created 100gb of unallocated space
Checked if the root partition is mounted.
umount /dev/nvme0n1p7
umount: /dev/nvme0n1p7: not mounted.
Below is my vgdisplay:
VG Name fedora_localhost-live
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size <33.18 GiB
PE Size 4.00 MiB
Total PE 8493
Alloc PE / Size 8493 / <33.18 GiB
Free PE / Size 0 / 0
I noticed that I have got no PE size left for my partition, but is does say resizable.
I cannot "deactivate" the partition in Gparted while booted from the LiveUSB, thus I cannot extend the partition. The ext4 partition get's unlocked when I boot from LiveUSB.
I can move the unallocated space two rows down, but the lvm2 partition is unable to extend with the 100gb. Everywhere I read that LiveUSB should deactivate the partition, but it seems that he's still running or there is another problem which I don't see.
|
You do not need to move this 100GB space. Just create there partition. Then create this partition PV
pvcreate /dev/partition_name
then add the PV to the VG
vgextend fedora_localhost-live /dev/partition_name
And you have 100GB more in your VG
| How to unlock root partition using LiveUSB Gparted |
1,679,997,093,000 |
I'm trying to create an external hard drive with NTFS part for info and hidden bootable fat32 part.
Here is an error
.
|
I could be wrong, but it does rather look like you've got a filesystem directly on the disk, without any partition table.
If that is the case you cannot have additional partitions without wiping the disk and starting over, this time with a partition table.
| Gparted: too many primary partitions |
1,679,997,093,000 |
I have a 250 GB Samsung Pro SSD in my Lenovo desktop. Initially Debian 9 was using the whole disk. Recently I decided to shrink my Debian partition and create two more partitions, one a shared data partition for my Nextcloud, and on the last partition I installed Xubuntu 19.04 with the Xfce 4.14 pre-release PPA installed. In order to do so, I booted a live USB, loaded GParted, and shrunk my Debian partition down to 46 GB (21 GB used, 13 GB available). The entire OS is in one partition. I use fstab to mount my Nextcloud partition in my home directory.
Since shrinking my Debian partition, I have noticed that applications load more slowly. This is very slight, but it is still enough to bother me. Before in Debian and in Xubuntu 19.04 currently, for example, launching Xfce4 Terminal after reboot is basically instant. However, now in Debian there is about a 400-600 millisecond delay. It is the same for other applications in Debian. I created a new user, logged in there, and had the same result. So, it is not an issue with my home profile. I have tried reinstalling applications but no luck. The disk is healthy after running a disk health test. Xubuntu 19.04 is super fast as Debian was before the partition resize. It must have something to do with shrinking the Debian partition / root file system. Any ideas on how this could be solved?
|
In Xfce in Appearance I changed the Style and Icons. Then in Window Manager I changed the Style. Now applications load just as fast as before. I am not sure why.
| Applications loading slightly more slowly after shrinking Debian 9 root partition |
1,679,997,093,000 |
In my sdb drive I have 76 Gb of unallocated space. I would like to extend the partition sdb3. However gparted hangs if a try to extend this partition. Anyone knows why?
|
I copied the content of this partition to anther hard drive. Then I deleted the sd3 partition and finally I create a new partition with the full size of the disk.
| Unable to extend a partition in gparted |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.