Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Thought someone here might be able to advise me if what I'd like to do is even feasible.
Would like to take a Clonezilla image of a Rhel 7.6 Server system built on a 140GB and put that image on a 500GB drive. I'm wondering what tools I can use to take advantage of the HD space gain. The drive is split up into LVMs based on DOD Stig (/, /boot/ home/ /var /var/log, /var/log/audit, /tmp, and /swp.
What I'd like to do is to either create another LVM from the additional space or at least add it to home.
Piece of cake.
Most people want to restore onto a smaller target - that's a no-no. For you, just restore it and either resize the pv (if just one), or create a new pv and add it to the appropriate vg. Then start resizing your lv(s)/filesystem(s).
Seeing as we cannot know what you did, or didn't, do - and whether it was correct, you'll have to do some basic diagnostics.
Restore the image onto the new disk. Does it boot ?. Does it boot if you remove the old disk ?.
Once you have a boot-able system, proceed in steps and reboot each time. Where does it break ?.
Either restore to the new drive and expand it all or restore to some other resource and then use a file by file method to move if you can't expand LVM. https://www.linuxtechi.com/extend-lvm-partitions/
Usually you have to use a similar level live media I'd think to access /boot. It could be that your data can be grown.
Smaller drive to larger drive.
Ext4, 3 partitions example.
Stick larger drive in machine, clone sda to sdb. Depending on the drive size this could take a while. A 160GB drive takes about 25 min. Also depends on bus speed, drive speed blahblah..
Code:
dd if=/dev/sda of=/dev/sdb bs=1M
New drive. You can move the end of the last partition to the end of the drive.
Code:
(parted) resizepart 3 100%
Then resize the file system to the end of that partition on the new drive.
Code:
resize2fs /dev/sdb3 100%
You can't move the start of the partitions. You can move the last partition on the drive to take the free space of the larger drive.
So if you have sdb1 sdb2 sdb3...you can move the end of sdb3 to the end of the drive, or move it a little and make a sdb4, etc.
I apologize for my confusion. I'm not exactly new to Linux, but definitely new to doing something like this.
This is a system that has only 1 drive in it. Originally that was a 300GB drive although it was loaded from a CLonezilla live CD with an OS originally configured with a 140GB drive. . Now they want to put a 500GB drive in this system, image it with the same Clonezilla image that captured as before, but be able to gain the space. So I've put the 500GB drive in the system and loaded the Clonezilla image. Below are the results of the command "df -h". As you can see it thinks that it's only a 140GB drive (or so).
Were you able to read post 10. I told you exactly how to resize it. Move the end of the last partition to wherever you want it, then extend the file system on it.
What is the output of
Code:
fdisk -l
or
parted -l
If you have sda1 sda2 and sda3, and you want to extend sda2 for example:
1. You'll need to backup sda3,
2. Then delete the partition sda3
3. Move the end of sda2 where you want it
4. Extent the FS on sda2
5. Make a new sda3 out of the free space that is left
6. Put a file system on sda3
7. Put your stuff back on it if it will fit.
Or if you just want to enlarge sda3, that's easy.
1. Move the end of the partition sda3 where you want it
You have an LVM volume or more than one.
"
/dev/mapper/rhel-var /var 9.8G
/dev/mapper/rhel-home /home 45G
/dev/mapper/rhel-log /var/log 9.8G
/dev/mapper/rhel-audit /var/log/audit 9.8G"
Right?
The reference here is that the LVM sits on a drive. /dev/sda1 /boot 9.8G and that you seem to have a dedicated /boot outside of the LVM.
I believe that you could clone to the larger disk. Then expand the LVM using a live media. Leave /boot untouched.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.