Re: [gentoo-user] moving /usr
On 3/10/06, Mark Knecht [EMAIL PROTECTED] wrote: On 3/10/06, Sergio Polini [EMAIL PROTECTED] wrote: Mark Knecht: Well...I did my best, but it wasn't good enough. The machine no longer boots to any level that a user could use. I'm told there are lots of messages on the screen about being unable to find files. (/usr/bin, /usr/sbin sort of things...) That happened to me too ;-) But the reason was quickly clear: I had deleted /usr instead of /usr/*! Remember: OK, so far I cannot get into the machine so I don't know how to double check that but I'm pretty sure I didn't do this. The issue in and around these instructions, for me was that: 1) I'm in a completely out of disk space situation 2) I'm trying to move /usr 3) /usr includes /usr/bin and /usr/sbin which is where all commands are to basically use the machine and make the changes. (mv, cp, ls and all the normal stuff.) so I 1) Copied everything to the new partition 2) Removed everything from the original /usr except /usr/bin and /usr/lib. The only copy of /usr/sbin is on the new partition. /usr/lib had to remain for me to use vim to edit fstab. 3) The new partition was labeled using e2label 4) fstab was edited to mount the new partition at the existing /usr direcotry which still contained /usr/bin and /usr/lib 5) As a backup, since I had removed most of /usr to create space I now made a new directory /usrBACKUP and placed a copy of what was left in /usr there so I could get to it if I needed to. 6) Unmounted /mnt/usr_temp and rebooted. The messages (I'm told over the phone by a 78 year old man who is hard of hearing) are in and around not being able to find /usr/sbin. I don't know what they really say as we didn't try to get that detailed. He has decided to ship the machine to me via FedEx and I'll have to fix it here when it arrives. He didn't want to mess with Knoppix or the Gentoo install disk as he felt it was way beyond what he could do. Again, thanks for the ideas below, but since the machine is 350 miles away it's hard to do the experiements below. I'll do them when it arrives next week. Cheers, Mark 9. delete the old /usr directory to free the unused space: cd /mnt/something/usr rm -rf * NB: do not delete /usr itself, just its contents, as /usr is the mount point for the new partition; Let us suppose that your /etc/fstab looks like: /dev/hda1 /boot type opts dump/pass /dev/hda2 / type opts dump/pass /dev/hda3 /usr type opts dump/pass The first and simplest try: reboot from a livecd, then: mount /dev/hda2 /mnt/something ls /mnt/something/usr If /mnt/something/usr doesn't exist, then: mkdir /mnt/something/usr reboot You could check that the new /usr partition is there, before rebooting: mount /dev/hda3 /mnt/something_else ls /mnt/something_else The old /usr contents should be there. Why not? So, if your reboot doesn't work, reboot again from a livecd and check /etc/fstab. Let me/us know! Sergio Hi Sergio, OK, the machine arrived here about an hour ago overnight express. It's now up and running. The mistake was mine, but I think it wasn't something that was very clearly warned about in the online docs, or at least I don't remember being warned about this. I created a new partition and copied all the information over. I labeled the partition USR using e2label and then carefully copied an existing line from elsewhere in the fstab file and changed the specifics to mount the partition, or so I thought. When the machine arrived here and I booted the new partition was not mounted, but I was able to immediately mount it by hand. Inspecting the fstab file quickly revealed that the line I had copied from elsewhere in the fstab file had the options 'noauto,noatime' sort of line. I removed noauto, rebooted, and the machine appears to be working fine. Since the machine is here I'll do a thorough set of updates and hopefully get it shipped out again on Monday. Live and learn! Thanks for your help! Thanks, Mark -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] moving /usr
i think this should be easy, make the new partition copy the contenet of /usr to it change your fstab to include the new modifications i'm not sure how to delete the old one after it's mounted maybe mount -o bind? or just boot a live cd and delete the content of your old /usr from there when you restart it shoudl be working fine On 3/10/06, Mark Knecht [EMAIL PROTECTED] wrote: Hi, I have an out of disk space problem machine. It looks like moving /usr to a new partition would be the best thing to do. How can I do this safely? Thanks, Mark -- gentoo-user@gentoo.org mailing list -- Cheers, Ghaith -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] moving /usr
Mark Knecht: http://forums.gentoo.org/viewtopic.php?t=121164 I'll proceed in this manner unless I hear back that there is some problem with doing it this way. There are several hints in that topic. I did move my /usr to a new partition, so I'ld say: 1. create and format your new partition; 2. mount your new partition in /mnt/whatever; 3. copy the content of your /usr into this partition by: cp -a /usr/* /mnt/whatever (the -a option is important; look at man cp); 4. reboot frome a livecd; 5. mount your root filesystem and edit /etc/fstab: /dev/hdXY /usr etc. 6. reboot from the hard disk to be sure that your new partition is well mounted and works; run mount to check that /usr is on your new partition; test this in other ways to be really sure ;-) 7. reboot again from a live cd; 8. mount your root filesystem in /mnt/something; 9. delete the old /usr directory to free the unused space: cd /mnt/something/usr rm -rf * NB: do not delete /usr itself, just its contents, as /usr is the mount point for the new partition; 10. cross your fingers and reboot from the hard disk ;-) HTH Sergio ___ Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB http://mail.yahoo.it -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] moving /usr
On Friday 10 March 2006 15:53, Mark Knecht wrote: Hi, I have an out of disk space problem machine. It looks like moving /usr to a new partition would be the best thing to do. How can I do this safely? go to the suse support database. Look up your question. They recommend tar (I did it once with their instructions and it worked perfectly). -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] moving /usr
On 3/10/06, Sergio Polini [EMAIL PROTECTED] wrote: Mark Knecht: http://forums.gentoo.org/viewtopic.php?t=121164 I'll proceed in this manner unless I hear back that there is some problem with doing it this way. There are several hints in that topic. I did move my /usr to a new partition, so I'ld say: 1. create and format your new partition; 2. mount your new partition in /mnt/whatever; 3. copy the content of your /usr into this partition by: cp -a /usr/* /mnt/whatever (the -a option is important; look at man cp); 4. reboot frome a livecd; 5. mount your root filesystem and edit /etc/fstab: /dev/hdXY /usr etc. 6. reboot from the hard disk to be sure that your new partition is well mounted and works; run mount to check that /usr is on your new partition; test this in other ways to be really sure ;-) 7. reboot again from a live cd; 8. mount your root filesystem in /mnt/something; 9. delete the old /usr directory to free the unused space: cd /mnt/something/usr rm -rf * NB: do not delete /usr itself, just its contents, as /usr is the mount point for the new partition; 10. cross your fingers and reboot from the hard disk ;-) HTH Sergio Well...I did my best, but it wasn't good enough. The machine no longer boots to any level that a user could use. I'm told there are lots of messages on the screen about being unable to find files. (/usr/bin, /usr/sbin sort of things...) To bad for me...I guess I know what I'll be doing this weekend. I'm hoping they can find their Gentoo install disk, boot the machine and get it on the network with sshd running. That will give me a fighting chance of getting the darn thing fixed. Thanks to all for the help. I'm sure it was something stupid on my part and not anyone's instructions. Cheers, Mark -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] moving /usr
Mark Knecht wrote: Well...I did my best, but it wasn't good enough. The machine no longer boots to any level that a user could use. Now that you've broke it, I'd like to suggest to learn and refrain from using old fashioned partitioning. Instead, I'd strongly suggest to use LVM instead. With LVM, it's no problem at all to increase the size of filesystems. Actually, the proper use of LVM includes that the filesystems will be increased when there's need; with LVM, it's normally suggested to make the filesystems as small as needed and then add space on them, when required. I'd suggest to read the LVM howto at http://tldp.org/HOWTO/LVM-HOWTO/ Alexander Skwar -- /* This bit of chicanery makes a unary function followed by a parenthesis into a function with one argument, highest precedence. */ -- Larry Wall in toke.c from the perl source code -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] moving /usr
On Friday 10 March 2006 09:43, Mark Knecht wrote: Well...I did my best, but it wasn't good enough. The machine no longer boots to any level that a user could use. I'm told there are lots of messages on the screen about being unable to find files. (/usr/bin, /usr/sbin sort of things...) To bad for me...I guess I know what I'll be doing this weekend. I'm hoping they can find their Gentoo install disk, boot the machine and get it on the network with sshd running. That will give me a fighting chance of getting the darn thing fixed. Thanks to all for the help. I'm sure it was something stupid on my part and not anyone's instructions. Cheers, Mark Before you do that... did you also edit /etc/mtab in addition to /etc/fstab? Just a thought, since we are talking about separate partitions to mount. -- Eric Bliss systems design and integration, CreativeCow.Net -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] moving /usr
On Friday 10 March 2006 18:05, Eric Bliss wrote: Before you do that... did you also edit /etc/mtab in addition to /etc/fstab? Just a thought, since we are talking about separate partitions to mount. Don't touch mtab. mtab is auto-magically generated by mount. Josh -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] moving /usr
On Friday 10 March 2006 03:17, Josh Helmer wrote: On Friday 10 March 2006 18:05, Eric Bliss wrote: Before you do that... did you also edit /etc/mtab in addition to /etc/fstab? Just a thought, since we are talking about separate partitions to mount. Don't touch mtab. mtab is auto-magically generated by mount. Josh Ah, okay. Learn something every day. I just remembered seeing mount information in that file when I was reading it (although why I was doing that, I now have no idea). Guess this would explain why. Now if only I could remember why I had even read the file in the past. You don't edit it during the original install process do you? -- Eric Bliss systems design and integration, CreativeCow.Net -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] moving /usr
On Mar 10, 2006, at 12:39 PM, Eric Bliss wrote: On Friday 10 March 2006 03:17, Josh Helmer wrote: On Friday 10 March 2006 18:05, Eric Bliss wrote: Before you do that... did you also edit /etc/mtab in addition to /etc/fstab? Just a thought, since we are talking about separate partitions to mount. Don't touch mtab. mtab is auto-magically generated by mount. Josh Ah, okay. Learn something every day. I just remembered seeing mount information in that file when I was reading it (although why I was doing that, I now have no idea). Guess this would explain why. Now if only I could remember why I had even read the file in the past. You don't edit it during the original install process do you? before you chroot, you copy /proc/mounts to it so your chrooted environment matches.maybe that's where you saw it. -- Eric Bliss systems design and integration, CreativeCow.Net -- gentoo-user@gentoo.org mailing list -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] moving /usr
Mark Knecht: Well...I did my best, but it wasn't good enough. The machine no longer boots to any level that a user could use. I'm told there are lots of messages on the screen about being unable to find files. (/usr/bin, /usr/sbin sort of things...) That happened to me too ;-) But the reason was quickly clear: I had deleted /usr instead of /usr/*! Remember: 9. delete the old /usr directory to free the unused space: cd /mnt/something/usr rm -rf * NB: do not delete /usr itself, just its contents, as /usr is the mount point for the new partition; Let us suppose that your /etc/fstab looks like: /dev/hda1 /boot type opts dump/pass /dev/hda2 / type opts dump/pass /dev/hda3 /usr type opts dump/pass The first and simplest try: reboot from a livecd, then: mount /dev/hda2 /mnt/something ls /mnt/something/usr If /mnt/something/usr doesn't exist, then: mkdir /mnt/something/usr reboot You could check that the new /usr partition is there, before rebooting: mount /dev/hda3 /mnt/something_else ls /mnt/something_else The old /usr contents should be there. Why not? So, if your reboot doesn't work, reboot again from a livecd and check /etc/fstab. Let me/us know! Sergio -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] moving /usr
On 3/10/06, Sergio Polini [EMAIL PROTECTED] wrote: Mark Knecht: Well...I did my best, but it wasn't good enough. The machine no longer boots to any level that a user could use. I'm told there are lots of messages on the screen about being unable to find files. (/usr/bin, /usr/sbin sort of things...) That happened to me too ;-) But the reason was quickly clear: I had deleted /usr instead of /usr/*! Remember: OK, so far I cannot get into the machine so I don't know how to double check that but I'm pretty sure I didn't do this. The issue in and around these instructions, for me was that: 1) I'm in a completely out of disk space situation 2) I'm trying to move /usr 3) /usr includes /usr/bin and /usr/sbin which is where all commands are to basically use the machine and make the changes. (mv, cp, ls and all the normal stuff.) so I 1) Copied everything to the new partition 2) Removed everything from the original /usr except /usr/bin and /usr/lib. The only copy of /usr/sbin is on the new partition. /usr/lib had to remain for me to use vim to edit fstab. 3) The new partition was labeled using e2label 4) fstab was edited to mount the new partition at the existing /usr direcotry which still contained /usr/bin and /usr/lib 5) As a backup, since I had removed most of /usr to create space I now made a new directory /usrBACKUP and placed a copy of what was left in /usr there so I could get to it if I needed to. 6) Unmounted /mnt/usr_temp and rebooted. The messages (I'm told over the phone by a 78 year old man who is hard of hearing) are in and around not being able to find /usr/sbin. I don't know what they really say as we didn't try to get that detailed. He has decided to ship the machine to me via FedEx and I'll have to fix it here when it arrives. He didn't want to mess with Knoppix or the Gentoo install disk as he felt it was way beyond what he could do. Again, thanks for the ideas below, but since the machine is 350 miles away it's hard to do the experiements below. I'll do them when it arrives next week. Cheers, Mark 9. delete the old /usr directory to free the unused space: cd /mnt/something/usr rm -rf * NB: do not delete /usr itself, just its contents, as /usr is the mount point for the new partition; Let us suppose that your /etc/fstab looks like: /dev/hda1 /boot type opts dump/pass /dev/hda2 / type opts dump/pass /dev/hda3 /usr type opts dump/pass The first and simplest try: reboot from a livecd, then: mount /dev/hda2 /mnt/something ls /mnt/something/usr If /mnt/something/usr doesn't exist, then: mkdir /mnt/something/usr reboot You could check that the new /usr partition is there, before rebooting: mount /dev/hda3 /mnt/something_else ls /mnt/something_else The old /usr contents should be there. Why not? So, if your reboot doesn't work, reboot again from a livecd and check /etc/fstab. Let me/us know! Sergio -- gentoo-user@gentoo.org mailing list -- gentoo-user@gentoo.org mailing list