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.
My problem is very simple and i hope the solution is also
My current linux partition is close to be full (900Mb free) and i want to move it to the beginning of my hda disk.
/dev/hda3 => /dev/hda1
What do i have to modify in my grub.conf and fstab to be able to boot in the new partition ?
Thanks.
Info on my system :
[root@sam ~]# uname -a
Code:
Linux sam.secretdomain.com 2.6.9-1.667 #1 Tue Nov 2 14:41:25 EST 2004 i686 athlon i386 GNU/Linux
[root@sam ~]# fdisk -l
Code:
Disk /dev/hda: 40.0 GB, 40025947648 bytes
255 heads, 63 sectors/track, 4866 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 3569 28667961 7 HPFS/NTFS # Current Windows XP
/dev/hda2 3570 3582 104422+ 83 Linux
/dev/hda3 3583 4866 10313730 8e Linux LVM #Current linux
Disk /dev/sda: 300.0 GB, 300090728448 bytes
255 heads, 63 sectors/track, 36483 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 2 36483 293041665 f W95 Ext'd (LBA)
/dev/sda5 2 2551 20482843+ b W95 FAT32
/dev/sda6 2552 3188 5116671 7 HPFS/NTFS
/dev/sda7 3189 4080 7164958+ b W95 FAT32
/dev/sda8 4081 5865 14337981 b W95 FAT32
/dev/sda9 5866 7140 10241406 7 HPFS/NTFS
/dev/sda10 7141 8415 10241406 7 HPFS/NTFS
/dev/sda11 8416 11000 20763981 83 Linux
/dev/sda12 11001 12275 10241406 7 HPFS/NTFS
/dev/sda13 12276 12884 4891761 83 Linux
/dev/sda14 12885 14709 14659281 83 Linux
[root@sam ~]# mount
Code:
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/hda2 on /boot type ext3 (rw)
none on /dev/shm type tmpfs (rw)
/dev/sda5 on /mnt/datadisk type vfat (rw,uid=501,gid=501,fmask=000,dmask=000)
/dev/sda8 on /mnt/music type vfat (rw,uid=501,gid=501,fmask=000,dmask=000)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
[root@sam ~]# cat /boot/grub/grub.conf
Code:
default=1
timeout=6
splashimage=(hd0,1)/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.12-1.1372_FC3)
root (hd0,1)
kernel /vmlinuz-2.6.12-1.1372_FC3 ro root=/dev/VolGroup00/LogVol00
initrd /initrd-2.6.12-1.1372_FC3.img
title Fedora Core (2.6.9-1.667)
root (hd0,1)
kernel /vmlinuz-2.6.9-1.667 ro root=/dev/VolGroup00/LogVol00
initrd /initrd-2.6.9-1.667.img
title Windoze XP
rootnoverify (hd0,0)
chainloader +1
If you “move” the partition, probably nothing needs to be changed (except to delete the “windoze” section, which will be gone), since you are using an LVM.
You will need to delete the “old” partition before starting it from the new location, since having duplicate volume groups and logical volumes with the same names will create major problems.
But how do you plan to “move” the partition? And after you “move” it, how do you plan to enlarge the size? Keep in mind that pvresize is not currently a supported lvm function.
As a simple, but somewhat inelegant alternative, you could always just convert the first partition to a physical volume and add it to the existing volume group.
What i was planing to do is to copy linux (with cp -a) from the current location to a new partition at the begining of the disk.
My new linux will have 25Gb and my windoze 15 gb.
If you create a new partition and cp over the old contents, then you will need to modify grub.conf and fstab to point to the new partition/filesystem. Do you plan to create an LVM in the new partition or do you plan to avoid using LVMs and format the new partition as ext3?
Also, look into using “rsync -a” instead of “cp -a”. For a large transfer, rsync will run faster then cp.
Originally posted by WhatsHisName
[B]If you create a new partition and cp over the old contents, then you will need to modify grub.conf and fstab to point to the new partition/filesystem.
If the new partition is hda1 and you directly format it as ext3 (i.e., mke2fs -j /dev/hda1) without using LVMs, your changes in fstab and grub.conf look correct.
Remember, since you will probably be deleting a partition and creating a new partition, just because the partition is the first one on the drive, doesn’t mean that it will be hda1. In your case, it could be hda4. Also, don’t be surprised if you need to “reinstall” grub after making the changes, which is easy to do.
You are always limited to a maximum of either 4 primary partitions or 3 primary plus 1 extended partition. The extended partition can contain as many logical partitions as you need and a logical partition will function in linux as well as a primary partition. If a partition gets deleted by accident, it is usually a lot easier to redetect a primary partition than it is to redetect a logical partition.
Note that you will not be able to easily resize the new ext3 formatted partition, or at least, how it is done makes most people really uncomfortable. Sorry, parted can’t do it with ext3's or with an ext3 converted to an ext2 (“unsupported feature”).
If you want to make at least one new logical volume in the new partition, here is what you will need to do from the terminal:
First, create the new partition using fdisk (or its equivalent) and change the partition type to “linux lvm” using the “t” command (linux lvm = 8e). Otherwise, you will get warning messages every time you boot.
As i exepted it didint work but i can boot on the 'old' partition. I have created a new partition over my WinXP and i copy data from my hda3 to hda1.
I created a (tempoarly) swap in sda15, and i reinstall grub. Grub work fine.
But when i boot in the new partition, kernel start and when it try to mount new / mount give me an error 6
According to man pages :
2 system error (out of memory, cannot fork, no more loop devices)
4 internal mount bug or missing nfs support in mount
Disk /dev/hda: 40.0 GB, 40025947648 bytes
255 heads, 63 sectors/track, 4866 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 1 3569 28667961 83 Linux
/dev/hda2 3570 3582 104422+ 83 Linux
/dev/hda3 * 3583 4866 10313730 8e Linux LVM
Disk /dev/sda: 300.0 GB, 300090728448 bytes
255 heads, 63 sectors/track, 36483 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 2 36483 293041665 f W95 Ext'd (LBA)
/dev/sda2 1 1 8001 83 Linux
/dev/sda5 2 2551 20482843+ b W95 FAT32
/dev/sda6 2552 3188 5116671 7 HPFS/NTFS
/dev/sda7 3189 4080 7164958+ b W95 FAT32
/dev/sda8 4081 5865 14337981 b W95 FAT32
/dev/sda9 5866 7140 10241406 7 HPFS/NTFS
/dev/sda10 7141 8415 10241406 7 HPFS/NTFS
/dev/sda11 8416 11000 20763981 83 Linux
/dev/sda12 11001 12275 10241406 7 HPFS/NTFS
/dev/sda13 12276 12884 4891761 83 Linux
/dev/sda14 12885 14709 14659281 83 Linux
/dev/sda15 14710 15400 5550426 82 Linux swap
Partition table entries are not in disk order
[root@sam ~]# cat /boot/grub/grub.conf
Code:
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,1)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/hda
default=
timeout=6
splashimage=(hd0,1)/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.12-1.1372_FC3)
root (hd0,1)
kernel /vmlinuz-2.6.12-1.1372_FC3 ro root=/dev/VolGroup00/LogVol00
initrd /initrd-2.6.12-1.1372_FC3.img
title Fedora Core (2.6.9-1.667)
root (hd0,1)
kernel /vmlinuz-2.6.9-1.667 ro root=/dev/VolGroup00/LogVol00
initrd /initrd-2.6.9-1.667.img
title Other
rootnoverify (hd1,13)
chainloader +1
title Fedora Core (2.6.9-1.667) COPY
root (hd0,1)
kernel /vmlinuz-2.6.9-1.667 ro root=/dev/hda0
initrd /initrd-2.6.9-1.667.img
[root@sam ~]# e2fsck -fy /dev/hda1
Code:
Unattached inode 4068
Connect to /lost+found? yes
Inode 4068 ref count is 2, should be 1. Fix? yes
[[.....]]
Free inodes count wrong for group #60 (16192, counted=16168).
Fix? yes
[[.....]]
and many others errors ....
I run e2fsck one more time
Code:
Pass 1B: Rescan for duplicate/bad blocks
Duplicate/bad block(s) in inode 7: 4 5 6 11 12 14 16 [[.....]]
File /lost+found/#984595 (inode #984595, mod time Tue Mar 8 08:00:27 2005)
has 509 duplicate block(s), shared with 1 file(s):
<The group descriptor inode> (inode #7, mod time Thu Aug 11 13:25:37 2005)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.