Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

2 votes
2 answers
2257 views
How to resize the disk of an Ubuntu-VM correctly with GParted
I use VirtualBox on Windows 10 to run a VM using Ubuntu 16.04.1 LTS. I got the VM from my University with a disk size of 20GB which was way to optimistic ... so I want to resize it to 50GB so I already did 0. (on the host) Make a BackUp ;) 1. (on the host) VBoxManage clonehd "source.vmdk" "clone.vdi...
I use VirtualBox on Windows 10 to run a VM using Ubuntu 16.04.1 LTS. I got the VM from my University with a disk size of 20GB which was way to optimistic ... so I want to resize it to 50GB so I already did 0. (on the host) Make a BackUp ;) 1. (on the host) VBoxManage clonehd "source.vmdk" "clone.vdi" --format vdi 2. (on the host) VBoxManage modifyhd "clone.vdi" --resize 51200 3. (on the host) Downloaded GParted.iso 4. (in the VM) Booted into GParted 5. (in the VM) Expanded The Swap from 2GB to 4GB according to the RAM of the VM I also changed Now I see the following image GParted As you can see obviously the new diskspace got added at the end of the disk. But now I'm facing the problem that I cannot expand the primary partition because the swap partition is "in the way". I neither am able to move the swap-partition. **How can I expand the primary partition and/or move the swap partition to the end of the disk?** The Idea I had was: 1. Delete /dev/sda5 2. Delete /dev/sda2 3. Create new Partition /dev/sda2 with file format linux-swap and the end of the disk 4. Expand /dev/sda1 to use the rest of the disk **Is this the way to go? Will Ubuntu automatically "know" where the swap partition will be after this action?**
derHugo (137 rep)
Oct 3, 2017, 01:15 PM • Last activity: Jul 25, 2025, 04:06 PM
7 votes
2 answers
6056 views
How to resize at the beginning/move a btrfs partition on the command line?
I have a Linux/Windows dual boot setup on my notebook, in which I used to keep most of the data on the Windows partition to be able to access it from both systems. Since I almost never use Windows I shrunk the NTFS partition and plan to move the data to the Linux partition which is formatted as btrf...
I have a Linux/Windows dual boot setup on my notebook, in which I used to keep most of the data on the Windows partition to be able to access it from both systems. Since I almost never use Windows I shrunk the NTFS partition and plan to move the data to the Linux partition which is formatted as btrfs. Beforehand the btrfs partition needs to be expanded at the beginning where the now free space is. fdisk can move the beginning of a partition but leaves the filesystem untouched. parted cannot handle the filesystem, either, since version 3.0. One solution to the problem would be to create a partition in the free space and add it as a backing device to the btrfs, then removing the original btrfs from btrfs (using btrfs device) and the partition table and after that expanding the remaining btrfs+partition to the end of the drive. The problems here are that the new free space must be big enough to hold all the files from the btrfs and that all the data has to be moved. So my question is: Is there some other, preferably more elegant and generally applicable, way to expand a btrfs at the beginning? ***Edit: (Solution)*** Even if GParted might be able to resize at the beginning by automatically moving the filesystem, I tried the way described above since I have the free space. As it took ages (perhaps because of many subvolumes), used many cpu and I/O resources and then aborted with an I/O error, I used btrfs replace instead which worked just fine: It took a few hours during which the computer was perfectly usable.
jorsn (183 rep)
Oct 31, 2017, 10:04 AM • Last activity: May 16, 2025, 09:03 PM
0 votes
2 answers
77 views
How to move the /var folder from one physical disc to another?
I need to unmount the /var folder and move it to a 250GB drive. When I try to umount /var I get an error *Disk is busy*, when I try to rename this folder I get the same error. What would be the correct way for me to move it to a larger disc? vda 252:0 0 80G 0 disk └─vda1 252:1 0 80G 0 part / vdb 252...
I need to unmount the /var folder and move it to a 250GB drive. When I try to umount /var I get an error *Disk is busy*, when I try to rename this folder I get the same error. What would be the correct way for me to move it to a larger disc? vda 252:0 0 80G 0 disk └─vda1 252:1 0 80G 0 part / vdb 252:16 0 100G 0 disk └─vdb1 252:17 0 100G 0 part /var vdc 252:32 0 250G 0 disk └─vdc1 252:33 0 250G 0 part
VladF (63 rep)
Dec 26, 2024, 02:10 PM • Last activity: Dec 26, 2024, 11:59 PM
3 votes
2 answers
2108 views
How to change extents of logical volume on LVM physical volume
I am trying to resize an encrypted physical volume so that I have free space to make a dual boot system. So far, I've successfully decrypted the PV, resized the filesystem and the LVs but when I try to resize the PV I run into issues relating to the sector extents of my LVs. root@ubuntu:/home/ubuntu...
I am trying to resize an encrypted physical volume so that I have free space to make a dual boot system. So far, I've successfully decrypted the PV, resized the filesystem and the LVs but when I try to resize the PV I run into issues relating to the sector extents of my LVs. root@ubuntu:/home/ubuntu# pvresize --setphysicalvolumesize 174G /dev/mapper/cryptdisk /dev/mapper/cryptdisk: cannot resize to 44543 extents as later ones are allocated. 0 physical volume(s) resized / 1 physical volume(s) not resized On the physical volume I have two logical volumes: root (first) and swap (second). I've resized (shrunk) the root volume to create free space, but the extents of the free space lay between the root and swap volumes. Because the extents of the swap volume are located at the end of the physical volume, I cannot shrink the physical volume using pvresize. How can I change the extents of the swap volume so that the free space is located after it? I've had a look at pvmove, but I don't think it's what I need - in this case I need something like lvmove (but it doesn't exist). root@ubuntu:/home/ubuntu# pvdisplay --maps /dev/mapper/cryptdisk --- Physical volume --- PV Name /dev/mapper/cryptdisk VG Name elementary-vg PV Size 222.59 GiB / not usable 0 Allocatable yes PE Size 4.00 MiB Total PE 56983 Free PE 12546 Allocated PE 44437 PV UUID DkBRl8-3gAq-Ewzv-7kjB-AHZI-dhqC-69gaZo --- Physical Segments --- Physical extent 0 to 40354: Logical volume /dev/elementary-vg/root Logical extents 0 to 40354 Physical extent 40355 to 52898: FREE Physical extent 52899 to 56980: Logical volume /dev/elementary-vg/swap_1 Logical extents 0 to 4081 Physical extent 56981 to 56982: FREE kvpm overview
Nukolas (133 rep)
Dec 28, 2019, 02:21 AM • Last activity: Aug 22, 2024, 10:19 PM
7 votes
1 answers
13447 views
Move a partition to the right using command line tools
I have a partition, say 190 GB, followed by 100 GB of unpartitioned disk free space. I want to move this partition 100GB "to the right" (towards a higher sector number), so that the free unpartitioned free space would then be on the left of it. This partition cannot just be copied carelessly, becaus...
I have a partition, say 190 GB, followed by 100 GB of unpartitioned disk free space. I want to move this partition 100GB "to the right" (towards a higher sector number), so that the free unpartitioned free space would then be on the left of it. This partition cannot just be copied carelessly, because: - it contains encrypted data that must be preserved (on the block level), - there is an overlap between the old and new position of the partition. I know GParted should be able to handle this. However I would like to do it myself with command line tools. I know sfdisk has something like this to move partition 100M to the right:
-sh
echo '+100M,' | sfdisk --move-data /dev/sdc -N 1
I'd like to know 2 things: - **If I was to move data manually, using tools like dd (or others), how would I do that?** I believe the end of the partition must be copied before the start of it, like a backward read-and-copy (of course, I would also need to edit the GPT partition table). - If I want to use sfdisk, how can I use it so that I shift by a very precise sector number, so that it properly "touches" the partition that is on the far end of the disk? (so that they are really next to each other with no gap in between)
Totor (21020 rep)
Apr 26, 2023, 12:34 AM • Last activity: Aug 22, 2024, 08:57 AM
0 votes
0 answers
45 views
Newb in Linux needs help with partition and space
I'm a beginner in Arch Linux (I know it's not the best distro to start with but I think one learns more when everything is broken). I think I've made a mistake in the installation of Arch - the partitions are wrong? - because whenever I install something it gets installed in a little partition of 23...
I'm a beginner in Arch Linux (I know it's not the best distro to start with but I think one learns more when everything is broken). I think I've made a mistake in the installation of Arch - the partitions are wrong? - because whenever I install something it gets installed in a little partition of 23.0 GiB but I have another partition of 214 GiB. **My question/problem is: How to move the things or make the 23GiB bigger.** This is the output of fdisk -l : Disk /dev/nvme0n1: 238.47 GiB, 256060514304 bytes, 500118192 sectors Disk model: BC711 NVMe SK hynix 256GB 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: D296046A-B417-403B-A3AF-CBEB7038E791 Device Start End Sectors Size Type /dev/nvme0n1p1 2048 2099199 2097152 1G EFI System /dev/nvme0n1p2 2099200 50333695 48234496 23G Linux root (x86-64) /dev/nvme0n1p3 50333696 500116143 449782448 214.5G Linux filesystem Disk /dev/zram0: 2.84 GiB, 3047161856 bytes, 743936 sectors Units: sectors of 1 * 4096 = 4096 bytes Sector size (logical/physical): 4096 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Chises (1 rep)
Aug 16, 2024, 04:39 PM • Last activity: Aug 20, 2024, 09:02 AM
1 votes
1 answers
413 views
Fedora - Migrate root filesystem to new drive / partition
I need a quick bit of help. I've migrated my /root and /home directory off a BTRFS partition to and EXT4 partition, because, for some strange reason .. BTRFS always fail! .. However, now that the EXT4 has the /home and /root directory, it won't boot. I have updated grub2.conf and fstab to use the ne...
I need a quick bit of help. I've migrated my /root and /home directory off a BTRFS partition to and EXT4 partition, because, for some strange reason .. BTRFS always fail! .. However, now that the EXT4 has the /home and /root directory, it won't boot. I have updated grub2.conf and fstab to use the new drive UUID, but I can't figure out how to update the initramfs, since ... the OS in the /root directory is 6.8.4-100.fc38.x86_64 and the LiveCD I have is using 6.2.9-300.fc38.x86_64. ===== I don't understand the directions as listed in this document https://linuxconfig.org/how-to-build-an-initramfs-using-dracut-on-linux ===== FStab is pretty generic UUID=[ ### ] / ext defaults 01 UUID=[ ### ] /home ext defaults 01 ===== The old FStab had UUID=[ ### ] / btrfs subvol=root,compress=zstd:1 0 0 UUID=[ ### ] /home btrfs subvol=home,compress=zstd:1 0 0 ===== Grub.cfg set kernelopts="root=UUID=[ ### ] ro rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 video=HDMI-0:D video=VGA-1-1:d " ===== Have I missed something? Do I need to run dracut --kver 6.8.4-100.fc38.x86_64 Do I need to issue a chroot command? And, if so where in the directory tree? Should I give up the ghost and just start over? Much time will be lost in reconfiguring the OS. Thoughts and prayers ===== Update ===== Drives and Contents sda1 .. grub sda2 .. /root and /home One problem that needed to be resolve was that sda2 cannot have both /root and /home in the same partition. There are 2 options here .. 1 .. move the contents of /home to /root/home and then move the contents of /root to the root of the partition. 2 .. create 2 seperate partitions .. root and home I took the later route to protect my data sda1 .. grub sda2 .. root sda3 .. home Now I can issue the mount commands correctly cd / mount /dev/sda2 /mnt mount -t proc proc /mnt/proc mount -t sysfs sys /mnt/sys mount -o bind /dev /mnt/dev mount --bind /run /mnt/run mount /dev/sda1 /mnt/boot Then I change change the root with chroot chroot /mnt /bin/bash I grepped all the root mounts to make sure they were listed in mtab correctly grep -v rootfs /proc/mounts cat /etc/mtab I then issued 2 versions of dracut. The first confirms that it's working on the correct initramfs, and the 2nd one should update them. dracut --regenerate-all dracut -f --regenerate-all Then I exited chroot and dismounted all the mounts, and confirmed using mount and lsblk. exit umount /mnt/boot umount /mnt/run umount /mnt/{proc,sys,dev} umount /mnt mount lsblk And, finally shutdown the PC reboot -p However, upon reboot, the PC again attemped to locate the old BTRFS file system using the old UUID. I don't know where this UUID could be hiding? I went back through the process listed above, and issued lsinitrd /boot/initramfs-6.8.4-100.fc38.x86_64.img Only fstab.empty is listed 0 Nov 15 16:00 etc/fstab.empty So, I'm at a loss on what to change / do. ===== Update 2 ===== Since UUID's changed, you will need to run grub2's list and update commands. Make sure fstab lists the correct UUIDs cat /etc/fstab Use Grub to list the boot environments in the system grub2-editenv - list if you are still in chroot this shoudl list something like ... grub2-editenv - list saved_entry=a6a84281584b4fb69829b970ecb6d26b-6.8.4-100.fc38.x86_64 boot_success=0 boot_indeterminate=0 otherwise it will list something like boot_success=1 Now issue the update command .. 1 of the 2 will work. update-grub2 grub2-mkconfig -o /boot/grub2/grub.cfg Now confirm that the grub command actually updated the configuration file cd /boot/loader/entries ls -al All entries should have today's date cat a6a84281584b4fb69829b970ecb6d26b-6.8.4-100.fc38.x86_64.conf title Fedora Linux (6.8.4-100.fc38.x86_64) 38 (MATE-Compiz) version 6.8.4-100.fc38.x86_64 linux /vmlinuz-6.8.4-100.fc38.x86_64 initrd /initramfs-6.8.4-100.fc38.x86_64.img options root=UUID=6bec82ae-4d47-4704-adfa-fd51dab23cc8 ro video=HDMI-0:D video=VGA-1-1:d grub_users $grub_users grub_arg --unrestricted grub_class fedora
E Net Arch (153 rep)
May 4, 2024, 01:10 AM • Last activity: May 6, 2024, 02:54 AM
0 votes
1 answers
65 views
How to correct mistake of having allocated not enough space to the root partition (not a trivial case)
When partitioning my hard drive (the only one I have) prior to installing Linux I made a mistake of not allocating enough space for the root partition. And now I have the following set of partitions (from left to right): 1) `sda1` - 65 GB - `/` 2) `sda2` - 5 GB - `swap` 3) `sda3` - 360GB - `/home` T...
When partitioning my hard drive (the only one I have) prior to installing Linux I made a mistake of not allocating enough space for the root partition. And now I have the following set of partitions (from left to right): 1) sda1 - 65 GB - / 2) sda2 - 5 GB - swap 3) sda3 - 360GB - /home The problem is that sda1 is almost full and I need to install something that requires considerable amount of space. So, I would like to increase the size of sda1 at the expense of sda3 which is less than half full anyway. It is only too easy to resize sda3 with Gparted live USB to free up, say, 35 GB which would be quite enough for any foreseeable future. But what is next? How do I merge this empty space (which would, of course, be allocated after sda3) with sda1? P. S. I have already backed all the data up.
S. N. (317 rep)
Feb 23, 2024, 01:11 PM • Last activity: Feb 23, 2024, 01:29 PM
0 votes
1 answers
238 views
Ubuntu resize partition in in backward direction
I am using Ubuntu 22.04 LTS in a windows dual boot setup. This is the state of the partitions at the moment. (Windows Screenshot) [![Partition Screenshot][1]][1] On my Ubuntu, I have the following ```bash df -H Filesystem Size Used Avail Use% Mounted on tmpfs 3.4G 3.0M 3.4G 1% /run efivarfs 263k 138...
I am using Ubuntu 22.04 LTS in a windows dual boot setup. This is the state of the partitions at the moment. (Windows Screenshot) Partition Screenshot On my Ubuntu, I have the following
df -H                                                                     
Filesystem      Size  Used Avail Use% Mounted on
tmpfs           3.4G  3.0M  3.4G   1% /run
efivarfs        263k  138k  120k  54% /sys/firmware/efi/efivars
/dev/nvme0n1p6   51G   42G  6.2G  88% /
tmpfs            17G  1.1M   17G   1% /dev/shm
tmpfs           5.3M  4.1k  5.3M   1% /run/lock
/dev/nvme0n1p7  160G   57G   96G  38% /home
/dev/nvme0n1p1  101M   35M   67M  34% /boot/efi
tmpfs           3.4G  177k  3.4G   1% /run/user/1000
Partition 6 (/) and partition 8 (/home) are the ones I am using for Ubuntu and want to expand them to un-allocated spaces. **How can I safely resize my partition 6 to take up available space on the left?**
inquilabee (103 rep)
Feb 12, 2024, 01:52 PM • Last activity: Feb 12, 2024, 02:39 PM
0 votes
1 answers
811 views
How do I permanently recover from grub rescue?
This question relates to a Windows/Linux dual boot system on a DOS-partitioned SSD (i.e. none with GPT/UEFI). Originally, the computer only had Windows 10 on an HDD. Then I managed to transfer this system to the SSD, resize the partitions and install Xubuntu 20.04 alongside Windows 10, and it all wo...
This question relates to a Windows/Linux dual boot system on a DOS-partitioned SSD (i.e. none with GPT/UEFI). Originally, the computer only had Windows 10 on an HDD. Then I managed to transfer this system to the SSD, resize the partitions and install Xubuntu 20.04 alongside Windows 10, and it all worked fine. There always was an EFI partition on the drive. I don't know what it is good for since this is not an UEFI device. But I did not change this partition. - There is no swap partition on this system. I wanted to create more space for my Linux system partition. To be more flexible in case the requirements change later, I moved the Windows home partition between the two Linux partitions. The partition layout looks like this now: NAME FSTYPE PARTTYPE PARTFLAGS LABEL sda ├─sda1 ntfs 0x7 0x80 System-reserviert ├─sda2 ntfs 0x7 SSD-Windows-Sys ├─sda3 vfat 0xef SSD-EFI ├─sda4 0x5 ├─sda6 ext4 0x83 SSD-Linux-Sys ├─sda5 ntfs 0x7 SSD-Windows-Home └─sda7 ext4 0x83 SSD-Linux-Home (sda-numbers not strictly ascending, the partitions are shown **in SSD-storage order** sda6-sda5-sda7.) I did not alter any of the partitions 1 to 3. I succeeded to maintain the original UUIDs and LABELs using
to move and resize the ntfs partition SSD-Windows-Home. There is no equivalent to
-U
for vfat and ntfs and I did not want to exchange the serial numbers by fiddeling with
as proposed in this discussion , therefore I did it with resizing and moving the ntfs-partition
-Windows-Home
. For the Linux partitions, I used
to create an new ext4 partition at the end of the SSD,
to copy the contents from the old to the new partition, then I deleted the old one and resized the other partitions to fill the gaps. Finally I applied
to achieve the shown state, especially in maintaining the same LABELs and UUIDs for all partitions as they were before all this. During the partition change work, I encountered a warning that boot problems might show up after my changes. I did not care, since the LABELs and the UUIDs for each partition remained the same. **But this was a keen assumption, as I had to notice, when I tried to reboot:** The boot process stopped in
rescue>
rather than in the GRUB2 menu asking me which operating system to boot. I succeeded to boot the computer by issuing these commands: grub rescue> set prefix=(hd0,6)/boot/grub grub rescue> set root=(hd0,6)/ grub rescue> insmod linux grub rescue> insmod normal grub rescue> normal Then the GRUB2 menu was shown and I could select between Linux and Windows 10. **Both operating systems worked as before all my partition changes** (of course I had to shut down the computer in between and go through
rescue>
again). I was advised to run the following command after booting into the Linux system in order to permanently recover from the
rescue
problem: $LC_ALL=C sudo grub-install --target=/boot/grub/i386-pc /dev/sda grub-install: error: /usr/lib/grub/i386-pc/modinfo.sh doesn't exist. Please specify --target or --directory. $ There is a file
/boot/grub/i386-pc/modinfo.sh
(and there are two more of them in
/boot/grub/x86_64-efi
and in
/usr/lib/grub/x86_64-efi
). Therefore I have tried $LC_ALL=C sudo grub-install --target=/boot/grub/i386-pc /dev/sda6 grub-install: error: /usr/lib/grub/boot/grub/i386-pc/modinfo.sh doesn't exist. Please specify --target or --directory. $ It searches in the wrong directory. Therefore I have added
--directory=/boot/grub/i386-pc
: $ LC_ALL=C sudo grub-install --directory=/boot/grub/i386-pc /dev/sda6 Installing for i386-pc platform. grub-install: error: cannot open `/boot/grub/i386-pc/moddep.lst': No such file or directory. $ ls -l /boot/grub/i386-pc/moddep.lst -rw-r--r-- 1 root root 5416 2019-12-10 10:34 /boot/grub/i386-pc/moddep.lst $ As you can see from the
command, this error message is definitely wrong, because
/boot/grub/i386-pc/moddep.lst
exists and root can also access it! Now I'm at the end of my wits. After the computer was able to start with the
rescue
commands (rather than from a live stick and using
), it shouldn't be that difficult to permanently apply exactly the information I entered, but without having to enter it on each boot process. **How do you do this correctly?**
Adalbert Hanßen (303 rep)
Jan 12, 2024, 09:57 PM • Last activity: Jan 13, 2024, 01:31 PM
0 votes
1 answers
1648 views
How can I extend the root/filesystem to take unallocated space?
This is what my partitions look like. The first one is the `/root` partition that I need to extend, second one is the `/home` partition and the third is the `unallocated` space that I want to add to the `/root`. How can I do that? [![enter image description here][1]][1] [1]: https://i.sstatic.net/d7...
This is what my partitions look like. The first one is the /root partition that I need to extend, second one is the /home partition and the third is the unallocated space that I want to add to the /root. How can I do that? enter image description here
best_of_man (161 rep)
Jun 2, 2023, 08:43 PM • Last activity: Jun 2, 2023, 09:02 PM
0 votes
1 answers
3855 views
How to combine two partitions?
I installed Linux Mint in a dual boot alongside Windows 11, however now I am trying to get completely rid off Windows 11, however I haven't been able to combine the two partitions that I used for personal data storage (one of them is empty, so no need of keeping files). This is what my partitions lo...
I installed Linux Mint in a dual boot alongside Windows 11, however now I am trying to get completely rid off Windows 11, however I haven't been able to combine the two partitions that I used for personal data storage (one of them is empty, so no need of keeping files). This is what my partitions look like on lsblk: NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS nvme0n1 259:0 0 238,5G 0 disk ├─nvme0n1o1 │ 259:1 0 260M 0 part /boot/efi ├─nvme0n1p5 │ 259:2 0 27,9G 0 part / ├─nvme0n1p6 │ 259:3 0 5,7G 0 part ├─nvme0n1p7 │ 259:4 0 65G 0 part /media/user/ 262f └─nvme0n1p2 259:5 0 139,6G 0 part I would like to combine the 'nvme0n1p2' and 'nvme0n1p7', I don't know if that could be possible as I haven't been able to do it on GParted.
Vopbe (3 rep)
May 17, 2023, 02:37 AM • Last activity: May 17, 2023, 09:35 AM
1 votes
1 answers
1867 views
Moving root partition to a new drive, how do I mount both drives?
I currently have my root partition on a 480GB Sata SSD. I recently bought a new NVME 2TB drive which I would like to boot off of. Using Arch Linux btw. What I plan to do is the following: - Create a partition table on the new drive, with the same partition layout as the current boot drive (EFI, Swap...
I currently have my root partition on a 480GB Sata SSD. I recently bought a new NVME 2TB drive which I would like to boot off of. Using Arch Linux btw. What I plan to do is the following: - Create a partition table on the new drive, with the same partition layout as the current boot drive (EFI, Swap, /) - Backup as necessary - Boot into a live Arch USB environment. - Mount both drives, use rsync to copy the old root partition to the new root partition on the new drive. - Recreate boot partition as necessary following the arch install guide. Where I am stuck is on the 4th step, where do I mount the drives? When installing arch, usually you mount the drive you want to install to to /mnt, but what about the secondary drive, where do I mount that? Should I instead mount the drives to something like /mnt/new and /mnt/old? I have read the appropriate arch wiki articles, but they don't mention how/where to mount each drive before actually copying the data.
JLCarveth (75 rep)
Mar 10, 2023, 05:12 PM • Last activity: Mar 10, 2023, 11:10 PM
1 votes
1 answers
26 views
Move around data between boxes taking advantage of an external HDD
My aging computer will need a replacement. That will happen in a couple of months but, in the mean time, I would like to learn techniques related to improving performance and resilience of data. I also have an empty 2 TB usb external HDD, which is like 3-4 times the size of my current laptop's HDD....
My aging computer will need a replacement. That will happen in a couple of months but, in the mean time, I would like to learn techniques related to improving performance and resilience of data. I also have an empty 2 TB usb external HDD, which is like 3-4 times the size of my current laptop's HDD. So.... I would like to do two things: - use the external HDD to _mirror_ the data from my current laptop (assume /home is in a separate partition which is what I would like to experiment with.... I could setup a partition on the external HDD to hold a copy before I start the experiment) and use it along the laptop's HDD to improve performance when both HDDs are connected. Should be able to recover from disconnecting the external HDD and be able to sync up when I reconnect the external HDD. - when I get my new computer, be able to connect the external HDD and mirror the data into the new computer and be able to use it to improve performance while the external HDD is connected and be able to continue working if the external HDD is disconnected and sync up if I connect it again. We could assume that once I start using the new computer, the external HDD won't be connected to the old computer, if that makes the scenario a little simpler to handle. What would be possible ways to achieve it? If you need details about the current setup of the /home partition or about the drives involved, let me know, though I think that it could be laid down _in the air_. As a tip, partitions in my laptop's HDD are setup using LVM (of which I know some things but want to take advamtage of this experiment to learn more).
eftshift0 (707 rep)
Jan 27, 2023, 06:59 PM • Last activity: Jan 27, 2023, 10:42 PM
12 votes
3 answers
37208 views
Can I move boot Linux partition to another drive or partition and just boot from there?
Can I move a working boot partition / root filesystem to another drive/partition and just boot from there? Or will device names be changed and this cause the system to stop working?
Can I move a working boot partition / root filesystem to another drive/partition and just boot from there? Or will device names be changed and this cause the system to stop working?
Dims (3425 rep)
Aug 12, 2017, 04:38 PM • Last activity: Nov 14, 2022, 08:14 PM
2 votes
1 answers
746 views
Does moving a partition change its UUID?
I'm running Fedora 36 with a BTFS root partition, a Swap partition and an ext4 Boot partition. I ended up needing more space on my root partition for a couple of reasons and so I wish to delete my swap partition, move my boot partition to the end of the free space created by the deletion, and add th...
I'm running Fedora 36 with a BTFS root partition, a Swap partition and an ext4 Boot partition. I ended up needing more space on my root partition for a couple of reasons and so I wish to delete my swap partition, move my boot partition to the end of the free space created by the deletion, and add the free space to my root partition. What I don't want is that I render my system unbootable by the changes. The first question is thus would moving the boot partition without changing its size change its UUID? I'm asking this because, if I remember well, the boot process refers to the boot partition with its UUID.
To Do (1396 rep)
Nov 8, 2022, 03:12 PM • Last activity: Nov 8, 2022, 06:34 PM
1 votes
0 answers
703 views
How can I resize the partions, reduse /home partition, and increase the root partition without adding additional hard-drive space
For Virtual Machine I'm using with VMware, and for OS the Ubuntu 20.04. I create the `500Mb for /boot`, `30GB for root /`, `8192MB for /swap` and `others for /home` partition. When I installed the Ubuntu, I create the partitions disks. It was like: ``` /boot = 500MB / = 30GB /swap = 8192MB /home = 1...
For Virtual Machine I'm using with VMware, and for OS the Ubuntu 20.04. I create the 500Mb for /boot, 30GB for root /, 8192MB for /swap and others for /home partition.
When I installed the Ubuntu, I create the partitions disks. It was like:
/boot = 500MB
/     = 30GB
/swap = 8192MB
/home = 15GB
enter image description here
The output after installation by using *parted* command it likes:
dev@ops:~$ sudo parted -l
Model: VMware Virtual NVMe Disk (nvme)
Disk /dev/nvme0n1: 53.7GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type      File system     Flags
 1      1049kB  500MB   499MB   primary   ext2            boot
 2      501MB   53.7GB  53.2GB  extended
 5      501MB   30.5GB  30.0GB  logical   ext4
 6      30.5GB  38.7GB  8191MB  logical   linux-swap(v1)
 7      38.7GB  53.7GB  15.0GB  logical   ext4

Now I want to resize the partitions of 15GB and 30GB.
I want to take the 5GB from partition Number 7: and move it to the partition Number 5 (30GB) and merge it with a 30GB. After the process, it would be shows:
Number  Start   End     Size    Type      File system     Flags
 1      1049kB  500MB   499MB   primary   ext2            boot
 2      501MB   53.7GB  53.2GB  extended
 5      501MB   30.5GB  35.0GB  logical   ext4
 6      30.5GB  38.7GB  8191MB  logical   linux-swap(v1)
 7      38.7GB  53.7GB  10.0GB  logical   ext4

I don't use with the LVM methodologies, simple partitioning only.

Thank you in advance!
morris (13 rep)
Oct 5, 2022, 08:59 PM • Last activity: Oct 6, 2022, 09:19 PM
1 votes
2 answers
542 views
Extension partition /var with some giga of partition /home
I have a RHEL 7.9 virtual machine without GUI, and I would like to make updates via the yum update command but it tells me that the disk is full, especially on the **/var** folder. I thought I'd take 10GB/20GB from the **/home** partition and transfer it to **/var**. It's possible ? If so, what step...
I have a RHEL 7.9 virtual machine without GUI, and I would like to make updates via the yum update command but it tells me that the disk is full, especially on the **/var** folder. I thought I'd take 10GB/20GB from the **/home** partition and transfer it to **/var**. It's possible ? If so, what steps should I take so as not to damage the machine? enter image description here I have seen this post but it seems to me the ideal solution: Change size of /home partition and move /var/www on new partition
Kanuc (61 rep)
Sep 23, 2022, 12:53 PM • Last activity: Sep 23, 2022, 02:41 PM
0 votes
0 answers
927 views
Merge /home partition to partition mounted at /
My current situation is the one shown below: [![Partition Table of my 256GB drive][1]][1] What I want to do is to remove /home partition and have it as a directory in the file system mounted at / I consulted [this][2] in order to do so but in my case there is not enough space in the / partition to j...
My current situation is the one shown below: Partition Table of my 256GB drive What I want to do is to remove /home partition and have it as a directory in the file system mounted at / I consulted this in order to do so but in my case there is not enough space in the / partition to just copy all the contents of /home so I figured I'd try the following steps: 1. Transfer all the contents of ~ to a temporary partition. 2. Delete partition mounted at /home. 3. Grow partition mounted at / 4. Move everything from the temporary volume to my home directory. I used sudo rsync -H -A -a --progress ~ /media/mark/tmp/ in order to copy everything from my home directory into the temporary partition which happens to be a 64GB usb stick but even though both gparted(as shown above) and du -sh ~ show the used space of the partition mounted at /home as way less than 64GB, partition mounted at /home used space The output of rsync is the one bellow: rsync output That basically states that my temporary medium has run out of available space. Is there anything that I'm doing that is completely out of bound? Could it be a docker issue? Any feedback would be very much appreciated!
D.Mark (1 rep)
Sep 5, 2022, 10:12 PM
0 votes
0 answers
53 views
Resizing and moving win 10 partitions to a debian box
Context: After replacing a win 10 hdd with an ssd that runs debian 11, how can the partitions from the hdd be copied over to the ssd so that win 10 is bootable? # lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 931.5G 0 disk ├─sda1 8:1 0 500M 0 part ├─sda2 8:2 0 16M 0 part ├─sda3 8:3 0 57.7G...
Context: After replacing a win 10 hdd with an ssd that runs debian 11, how can the partitions from the hdd be copied over to the ssd so that win 10 is bootable? # lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 931.5G 0 disk ├─sda1 8:1 0 500M 0 part ├─sda2 8:2 0 16M 0 part ├─sda3 8:3 0 57.7G 0 part /media/sebi/423494AC3494A487 ├─sda4 8:4 0 881M 0 part ├─sda5 8:5 0 488.3G 0 part /media/sebi/New Volume ├─sda6 8:6 0 3.8G 0 part ├─sda7 8:7 0 28.6G 0 part /media/sebi/39d7f984-f73c-40bb-b51f-a2382c56ef37 ├─sda8 8:8 0 238.4G 0 part /media/sebi/0ee6e718-ee27-4bb7-8f74-ea1e89885b3d ├─sda9 8:9 0 112.8G 0 part /media/sebi/2826BEFD26BECB58 └─sda10 8:10 0 538M 0 part sdb 8:16 0 1.8T 0 disk └─sdb1 8:17 0 1.8T 0 part /media/sebi/Expansion Drive nvme0n1 259:0 0 931.5G 0 disk ├─nvme0n1p1 259:1 0 476M 0 part /boot/efi ├─nvme0n1p2 259:2 0 325.9G 0 part / └─nvme0n1p3 259:3 0 18.6G 0 part [SWAP] sda is the hdd with win, sdb is an external drive, nvme0n1 the debian drive (currently booted). Stuff tried: Since both drives are 1 TB in size, the initial approach was to move the win partitions to the ssd using clonezilla, move sda3, sda7 and sda8 to the left in gparted, so that they are next to one another, delete, and merge the unallocated partitions into a single partition where debian would be installed. Every time gparted moves, shrinks or extends a partition renders the drive unbootable (regardless whether it's win or linux). Current goal is to move all sdas except, sda1, sda7 and sda8 (which were not used by win) to nvme0n1 and create a setup that allows dual booting of both win and deb. What steps should be taken after copying (dd-ing) the sdas to nvme0n1?
Sebi (1029 rep)
Jul 22, 2022, 11:37 PM
Showing page 1 of 20 total questions