Hi,
Now I'm pretty pissed with myself as i managed to fuckup the partitions on my laptop.
I've got 2 partitions one with 50 Gb the other with 250 Gb. Unfortunately they contain the wrong things.
/ is 50 Gb /home is 250 Gb
I want them the other way round really. What would be the best way of trying to achieve this?
/Martin S
On 26.07.2013, Martin Skjöldebrand wrote:
/ is 50 Gb /home is 250 Gb
I want them the other way round really. What would be the best way of trying to achieve this?
This seems quite fine to me. Anyway, if you want to change this, the easiest way would be to make a backup og both on an external drive, repartition and copy the data back. You can do that using rsync:
rsync -avxHSAX / /external-hd/root rsync -avxHSAX /home/ /external-hd/home
and the other way round to replay the data. Notice the subsequent "/" in the source directory.
On Fri, Jul 26, 2013 at 3:50 PM, Martin Skjöldebrand shieldfire@gmail.com wrote:
I want them the other way round really. What would be the best way of trying to achieve this?
You can do it with Logical Volume Manager, assuming LVM was used to create the partitions.
This is a procedure I use to remove the /home partition completely and grow the root partition into the available space. /home should be empty / or backed up..
In this example I want to remove the /home partition and reallocate the space to the / partiton to increase it's size.
root@db3 ~# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_db3-lv_root 50G 17G 31G 35% / tmpfs 1.9G 0 1.9G 0% /dev/shm /dev/sda1 485M 64M 396M 14% /boot
root@db3 ~ # lvdisplay --- Logical volume --- LV Name /dev/vg_db3/lv_root VG Name vg_db3 LV UUID eOnC1Q-9Iv7-FiNg-eveh-HVN3-XXz0-Tp1Xer LV Write Access read/write LV Status available # open 1 LV Size 50.00 GiB Current LE 12800 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:0
--- Logical volume --- LV Name /dev/vg_db3/lv_home VG Name vg_db3 LV UUID fzWyrF-8X8F-3d89-VMbO-cN66-MGZw-cgvQpS LV Write Access read/write LV Status available # open 0 LV Size 63.63 GiB Current LE 16290 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:2
--- Logical volume --- LV Name /dev/vg_db3/lv_swap VG Name vg_db3 LV UUID 4JVuin-Jm6F-OtO7-qyw8-Dakr-KcSI-A8M3D4 LV Write Access read/write LV Status available # open 1 LV Size 5.88 GiB Current LE 1504 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:1
# umount /home remove it from /etc/fstab
# vi /etc/fstab
delete the line that referers to the /home paritition
root@db3 ~ # lvm
deactivate the volume
lvm> lvchange -a n /dev/vg_db3/lv_home
remove it.
lvm> lvremove /dev/vg_db3/lv_home Logical volume "lv_home" successfully removed
lvm> lvscan ACTIVE '/dev/vg_db3/lv_root' [50.00 GiB] inherit ACTIVE '/dev/vg_db3/lv_swap' [5.88 GiB] inherit
lvm> pvscan PV /dev/sda2 VG vg_db3 lvm2 [119.51 GiB / 63.63 GiB free] Total: 1 [119.51 GiB] / in use: 1 [119.51 GiB] / in no VG: 0 [0 ]
lvm> lvextend -l +100%FREE /dev/vg_db3/lv_root /dev/sda2 Extending logical volume lv_root to 113.63 GiB Logical volume lv_root successfully resized
lvm> quit Exiting. root@db3 ~ # resize2fs /dev/vg_db3/lv_root resize2fs 1.41.12 (17-May-2010) Filesystem at /dev/vg_db3/lv_root is mounted on /; on-line resizing required old desc_blocks = 4, new_desc_blocks = 8 Performing an on-line resize of /dev/vg_db3/lv_root to 29788160 (4k) blocks. The filesystem on /dev/vg_db3/lv_root is now 29788160 blocks long.
root@db3 ~ # df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_db3-lv_root 112G 17G 91G 16% / tmpfs 1.9G 0 1.9G 0% /dev/shm /dev/sda1 485M 64M 396M 14% /boot
On Friday 26 July 2013 17.47.16 David Beveridge wrote:
On Fri, Jul 26, 2013 at 3:50 PM, Martin Skjöldebrand
shieldfire@gmail.com wrote:
I want them the other way round really. What would be the best way of trying to achieve this?
You can do it with Logical Volume Manager, assuming LVM was used to create the partitions.
Thank you David and Heinz for you input. It's been a while since using Linux daily on a private computer =)
/Martin S
On 7/26/2013 2:40 AM, Martin Skjöldebrand wrote:
On Friday 26 July 2013 17.47.16 David Beveridge wrote:
On Fri, Jul 26, 2013 at 3:50 PM, Martin Skjöldebrand
shieldfire@gmail.com wrote:
I want them the other way round really. What would be the best way of trying to achieve this?
You can do it with Logical Volume Manager, assuming LVM was used to create the partitions.
Thank you David and Heinz for you input. It's been a while since using Linux daily on a private computer =)
/Martin S
Using this kind of language on this list is against the guidlines. This user should be banned from future posting.
Once, long ago--actually, on Fri, Jul 26, 2013 at 09:58:30AM CDT--Alan Findly (afindly@ronan.net) said:
Using this kind of language on this list is against the guidlines.
Well, yes, but...
This user should be banned from future posting.
Excessive for a first mistake, especially if it's not repeated. Many don't grok (or read) the rules until gently reminded.
Cheers, -- Dave Ihnat dihnat@dminet.com
On 26/07/13 11:05, Dave Ihnat wrote:
Once, long ago--actually, on Fri, Jul 26, 2013 at 09:58:30AM CDT--Alan Findly (afindly@ronan.net) said:
Using this kind of language on this list is against the guidlines.
Well, yes, but...
This user should be banned from future posting.
Excessive for a first mistake, especially if it's not repeated. Many don't grok (or read) the rules until gently reminded.
Cheers,
Agreed. No one should be banned on a first offence, particularly when the offence occurred during a moment of panic. A simple "please don't do that again" is more than sufficient, I think.
On Friday 26 July 2013 08.58.30 Alan Findly wrote:
On 7/26/2013 2:40 AM, Martin Skjöldebrand wrote:
On Friday 26 July 2013 17.47.16 David Beveridge wrote:
On Fri, Jul 26, 2013 at 3:50 PM, Martin Skjöldebrand
shieldfire@gmail.com wrote:
I want them the other way round really. What would be the best way of trying to achieve this?
You can do it with Logical Volume Manager, assuming LVM was used to create the partitions.
Thank you David and Heinz for you input. It's been a while since using Linux daily on a private computer =)
/Martin S
Using this kind of language on this list is against the guidlines. This user should be banned from future posting.
I really like how you quoted my reply which thanked someone for sending input to my question and saying I should be banned to post to the list ...
OK, I'll never thank anyone ever again ....
/Martin S
On Fri, Jul 26, 2013 at 08:05:01PM +0200, Martin Skjöldebrand wrote:
On Friday 26 July 2013 08.58.30 Alan Findly wrote:
On 7/26/2013 2:40 AM, Martin Skjöldebrand wrote:
On Friday 26 July 2013 17.47.16 David Beveridge wrote:
On Fri, Jul 26, 2013 at 3:50 PM, Martin Skjöldebrand
shieldfire@gmail.com wrote:
I want them the other way round really. What would be the best way of trying to achieve this?
You can do it with Logical Volume Manager, assuming LVM was used to create the partitions.
Thank you David and Heinz for you input. It's been a while since using Linux daily on a private computer =)
/Martin S
Using this kind of language on this list is against the guidlines. This user should be banned from future posting.
I really like how you quoted my reply which thanked someone for sending input to my question and saying I should be banned to post to the list ...
OK, I'll never thank anyone ever again ....
Your thanks were very polite. :-) Let's not overreact; no harm, no foul.
Hopefully you're aware of the guidelines now, which are linked at the bottom of mail messages. All the community asks is that you abide by them now that you're aware of them. Thanks in advance!
On Friday 26 July 2013 19.38.06 Paul W. Frields wrote:
I really like how you quoted my reply which thanked someone for sending input to my question and saying I should be banned to post to the list ...
OK, I'll never thank anyone ever again ....
Your thanks were very polite. :-) Let's not overreact; no harm, no foul.
Hopefully you're aware of the guidelines now,
I think I know what the other guy was reacting to. Although to a non-US person it might not be overly obvious, so;
Simply pointing out what was inappropriate rather than go trolling on a mailing list in a thread that was pretty much closed and done with would have been the proper way of handling this.
/Martin S