Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
From here I see that rootfs only has 9.8GB, I would like to allocate it more space from /dev/md2 so that I can use more space outside of /home. How would I do this?
From here I see that rootfs only has 9.8GB, I would like to allocate it more space from /dev/md2 so that I can use more space outside of /home. How would I do this?
Are you running LVM? Or some sort of filesystem that allows for growing/shrinking filesystems?
Unless you are able to apply LVM, you would have to repartition /dev/md2 - back up ALL your data before doing this in case something goes wrong - and make a new partition.
Instead of just increasing the space for / you could mount one of the directories on another partition - such as /var.
Unless you are able to apply LVM, you would have to repartition /dev/md2 - back up ALL your data before doing this in case something goes wrong - and make a new partition.
Instead of just increasing the space for / you could mount one of the directories on another partition - such as /var.
I can't repartition it as it's already in use. I just need to know how I can shrink /dev/md2 and increase the size of /.
but it looks like you've got 2 x 1TB disks, sda+sdb, each split 3 ways
1. root - mirrored on both - md1 (sda1+sdb1)
2. home - mirrored on both - md2 (sda2+sdb2)
3. 2 x swap - not mirrored - sda3, sdb3
You can only shrink a partition from the top down ie from the farthest end, backwards towards the start, so shrinking /home to add space to '/' is not practical.
(On your disks, '/' comes physically before /home)
You can
1. backup & re-partition; actually not a bad idea, and you should be making backups anyway
2. it would be possible to shrink the /home partition and put eg /var on the new space.
Remember to shrink the fs first, then the RAID partitions ie sda2+sdb2.
You definitely must do a backup before you try this.
yes, shrink /home first and create another partition. copy your data from / (or from /bin, /var ...) onto the new partition (the whole filesystem you want to put onto the new drive), reconfigure fstab. create mount points by renaming old /var. Take care about preserving all the permissions. All of these should be done by booting another OS (probably a CD). Reboot, check, and start over in case of error. You can safely restore the original state as long as you can restore the old fstab and /var (and other dirs).
but it looks like you've got 2 x 1TB disks, sda+sdb, each split 3 ways
1. root - mirrored on both - md1 (sda1+sdb1)
2. home - mirrored on both - md2 (sda2+sdb2)
3. 2 x swap - not mirrored - sda3, sdb3
You can only shrink a partition from the top down ie from the farthest end, backwards towards the start, so shrinking /home to add space to '/' is not practical.
(On your disks, '/' comes physically before /home)
You can
1. backup & re-partition; actually not a bad idea, and you should be making backups anyway
2. it would be possible to shrink the /home partition and put eg /var on the new space.
Remember to shrink the fs first, then the RAID partitions ie sda2+sdb2.
You definitely must do a backup before you try this.
I'll need to look into that more before I re-partition anything. Here's the output of those commands:
Code:
[~] mdadm --detail /dev/md1
/dev/md1:
Version : 0.90
Creation Time : Mon Aug 27 06:02:17 2012
Raid Level : raid1
Array Size : 10238912 (9.76 GiB 10.48 GB)
Used Dev Size : 10238912 (9.76 GiB 10.48 GB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 1
Persistence : Superblock is persistent
Update Time : Mon Sep 3 15:08:09 2012
State : active
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
UUID : 62fd2a8d:4fd0962f:a4d2adc2:26fd5302
Events : 0.7
Number Major Minor RaidDevice State
0 8 1 0 active sync /dev/sda1
1 8 17 1 active sync /dev/sdb1
[~] mdadm --detail /dev/md2
/dev/md2:
Version : 0.90
Creation Time : Mon Aug 27 06:02:23 2012
Raid Level : raid1
Array Size : 965994432 (921.24 GiB 989.18 GB)
Used Dev Size : 965994432 (921.24 GiB 989.18 GB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 2
Persistence : Superblock is persistent
Update Time : Mon Sep 3 15:08:07 2012
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
UUID : e296cbcf:93113984:a4d2adc2:26fd5302
Events : 0.30
Number Major Minor RaidDevice State
0 8 2 0 active sync /dev/sda2
1 8 18 1 active sync /dev/sdb2
[~]
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.