exporting git files

General support questions
Post Reply
bukkake151
Posts: 3
Joined: 2024/02/23 10:17:40

exporting git files

Post by bukkake151 » 2024/02/23 11:08:05

Hi there.
My friend gave me a very neat desktop, and said i can keep it if i manage to bypass the root password and save his github projects from the drive.
Password, piece of cake, but i'm a debian guy, and this computer has been used as a server. I have 2x 1TB SSD drives, and i would like to write the existing system to one of them and simply hand over the SSD to my friend. But i'm worried i will mess things up which will result in me not getting to keep this very nice computer.
I have no experience with Oracle and centos, and only a tiny bit experience with servers.
My issue is that the system is divided on multiple virtual machines and locations.
Could anyone point out to me which specific folders i need to copy/export?
The system is showing the SSD's as a single 2TB Block device.
Now i'm not even able to access internet with this thing...

Here is lshw -c disk output

root@localhost oracle]# lshw-c disk

*-disk

description: ATA Disk
product: tigo SSD 1TB
physical id: 0.0.0
bus info: scsi@1:0.0.0
logical name: /dev/sda
version: 440
serial: TC225280M2A0006
size: 953GiB (1024GB)
capabilities: partitioned partitioned: dos
configuration: ansiversion=5 logicalsectorsize=512 sectorsize=512 signature=000c67ee

*-disk
description: ATA Disk
product: tigo SSD 1TB
physical id: 0.0.0
bus info: scsi@9:0.0.0
logical name: /dev/sdb
version: 4ΑΘ
serial: TC225280M2A0014
size: 953G1B (1024GB)
capabilities: partitioned partitioned:dos
configuration: ansiversion=5 logicalsectorsize=512 sectorsize=512 signature=000a40fd

Whoever
Posts: 1363
Joined: 2013/09/06 03:12:10

Re: exporting git files

Post by Whoever » 2024/02/23 14:13:47

"lsblk" may provide more information.

User avatar
jlehtone
Posts: 4551
Joined: 2007/12/11 08:17:33
Location: Finland

Re: exporting git files

Post by jlehtone » 2024/02/23 14:37:13

bukkake151 wrote:
2024/02/23 11:08:05
save his github projects from the drive
A real "github project" would have a a copy of the repo in GitHub that he should be able to access from any computer.
One could also ask why the friend did not copy the files self, being familiar with the system and all?
bukkake151 wrote:
2024/02/23 11:08:05
My issue is that the system is divided on multiple virtual machines and locations.
Default partitioning on EL systems has four/five filesystems:
/boot/efi (if UEFI is used)
/boot
/
/home
swap

The latter three are LVM2 logical volumes (LV). A VG -- and thus LV -- can span multiple physical devices.

The lsblk does indeed tell more. (Also lsblk --fs for extra details.)

Virtual machines -- guests -- are separate "computers". On the host the disk space that they use is a file or volume.
The host can show what VM guests it has with: virsh list --all

bukkake151
Posts: 3
Joined: 2024/02/23 10:17:40

Re: exporting git files

Post by bukkake151 » 2024/02/27 13:34:09

jlehtone wrote:
2024/02/23 14:37:13
bukkake151 wrote:
2024/02/23 11:08:05
save his github projects from the drive
A real "github project" would have a a copy of the repo in GitHub that he should be able to access from any computer.
One could also ask why the friend did not copy the files self, being familiar with the system and all?
bukkake151 wrote:
2024/02/23 11:08:05
My issue is that the system is divided on multiple virtual machines and locations.
Default partitioning on EL systems has four/five filesystems:
/boot/efi (if UEFI is used)
/boot
/
/home
swap

The latter three are LVM2 logical volumes (LV). A VG -- and thus LV -- can span multiple physical devices.

The lsblk does indeed tell more. (Also lsblk --fs for extra details.)

Virtual machines -- guests -- are separate "computers". On the host the disk space that they use is a file or volume.
The host can show what VM guests it has with: virsh list --all
Now a bit wiser i can add some details. It's a LVM blockdevice on 2 separate SSD's. Didn't know what LVM is until yesterday.
If i understood correct i can shrink the blockdevice to fit one of the SSD's, leaving the other one untouched? this would be ideal.

User avatar
jlehtone
Posts: 4551
Joined: 2007/12/11 08:17:33
Location: Finland

Re: exporting git files

Post by jlehtone » 2024/02/27 14:14:19

bukkake151 wrote:
2024/02/27 13:34:09
If i understood correct i can shrink the blockdevice to fit one of the SSD's, leaving the other one untouched?
That depends. You can see what filesystems you have with:

Code: Select all

lsblk --fs
If the filesystem within LVM logical volume (LV) is XFS, then it cannot be shrunk.


LV is a "list of blocks" -- bit like a plain partition. Filesystem has data in those blocks.
If one simply updates "last block" of LV/partition for "shrink", then all the blocks after the new end are now "outside" and if filesystem had any data on them, that will become lost.

That is why one has to first tell the filesystem to not use more than N blocks, and only after that change the size of LV to N blocks.
The lvreduce does have option --resizefs that does the necessary filesystem step.

However, there is no shrink operation of filesystem of type "XFS". For it the process is to copy files to backup, remove filesystem, create smaller filesystem, and finally restore files from backup.

Whoever
Posts: 1363
Joined: 2013/09/06 03:12:10

Re: exporting git files

Post by Whoever » 2024/02/27 14:28:43

bukkake151 wrote:
2024/02/27 13:34:09


Now a bit wiser i can add some details. It's a LVM blockdevice on 2 separate SSD's. Didn't know what LVM is until yesterday.
If i understood correct i can shrink the blockdevice to fit one of the SSD's, leaving the other one untouched? this would be ideal.
Run the commands:

Code: Select all

pvdisplay
vgdisplay
to see what the LVM space usage is. Take note of the "Free PE /Size" information from vgdisplay and the "PV Size" information from pvdisplay to see if the volume group has sufficient free space to allow removal of one of the physical volumes.

"lvdisplay" will list the logical volumes (these will also show up in lsblk), and you may find that you can remove one or more logical volumes to free sufficient space to remove a physical volume. However, take great care with this, since usage of a logical volume may not be obvious.

bukkake151
Posts: 3
Joined: 2024/02/23 10:17:40

Re: exporting git files

Post by bukkake151 » 2024/03/03 10:02:46

2024-03-03_13-05.png
2024-03-03_13-05.png (250.01 KiB) Viewed 1099 times
Thanks everyone for your replies. I found a super easy solution with 100% success rate: I bought myself a brand new 1Tb SSD, it's running like a charm.

Post Reply